7540 loader zfs should check all labels

Review Request #250 — Created Nov. 7, 2016 and submitted

tsoome
illumos-gate
7540
0a4b58f...
general

7540 loader zfs should check all labels

Verified the boot; also verified the label read and data from reads (txg and ub).

  • 0
  • 0
  • 9
  • 0
  • 9
Description From Last Updated
tsoome
avgapon
  1. Ship It!
  2. 
      
otis
  1. 
      
  2. An explicit cast maybe?

    1. void * does not need the cast, in my opinion such casts do not add extra value anyhow, because we already know the type.

  3. Should these be here for illumos?

    1. Leftover, I'll remove it.

  4. 
      
yuripv
  1. 
      
  2. style - function name on new line.

  3. usr/src/boot/sys/boot/efi/loader/main.c (Diff revision 1)
     
     

    style - function name on new line.

  4. style - function name on new line.

  5. style - function name on new line.

  6. usr/src/boot/sys/boot/zfs/zfsimpl.c (Diff revision 1)
     
     

    some suspicious bracketing here ( () ( ? : () ) )

    1. Ah, got it, could you please put the condition in brackets, i.e., (l < VDEV_LABELS / 2) ?, so I'd stop asking stupid questions :-)

    2. you want also look at: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/vdev_label.c#155

      :D

    3. I actually split it up, there is no reason to have such hard to read construct.

  7. usr/src/boot/sys/boot/zfs/zfsimpl.c (Diff revision 1)
     
     

    whitespace after sizeof

  8. usr/src/boot/sys/boot/zfs/zfsimpl.c (Diff revision 1)
     
     

    This is better written as (without val = 0):

    if (nvlist_find(...) == 0 && val != 0)
            return (EIO);
    

    And, BTW, about that '0' arg which is supposed to be int* elementsp - should we use NULL there instead?

    1. yap, replaced them. Also removed unneeded 0 assignment from dnode_cache_obj and duplicate zfs_crc64_table.

  9. usr/src/boot/sys/boot/zfs/zfsimpl.c (Diff revision 1)
     
     

    you could really combine these 2 ifs into just one as resulting assignment is the same:

    if (up->ub_txg > spa->spa_uberblock.ub_txg ||
        (up->ub_txg == spa->spa_uberblock.ub_txg &&
        up->ub_timestamp > spa->spa_uberblock.ub_timestamp))
            spa->spa_uberblock = *up;
    
  10. 
      
tsoome
tsoome
tsoome
pcd
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...