Project

General

Profile

Bug #14007

Updated by Yuri Pankov 4 months ago

Just had my rpool destroyed (overwritten) by zfs-tests using the -a (auto detect) option. 
 <pre> 
         NAME                       STATE       READ WRITE CKSUM 
         rpool                      ONLINE         0       0       0 
           c2t7A40F34B5A21C0F1d0    ONLINE         0       0       0 
 </pre> 
 Here disk name contains @A-F@ while find_disks only checks @a-f@, so this was treated as unused. 

 Following should help: 
 <pre> 
 --- a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh 
 +++ b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh 
 @@ -41,7 +41,7 @@ function find_disks 
         typeset all_disks=$(echo '' | sudo -k format | awk \ 
             '/c[0-9]/ {print $2}') 
         typeset used_disks=$(zpool status | awk \ 
 -             '/c[0-9]+(t[0-9a-f]+)?d[0-9]+/ {print $1}' | sed -E \ 
 +             '/c[0-9]+(t[0-9a-fA-F]+)?d[0-9]+/ {print $1}' | sed -E \ 
             's/(s|p)[0-9]+//g') 

         typeset disk used avail_disks 
 </pre> 

 To test this, I ran zfs-tests suite on the system with disk names as shown above, and this time my rpool was not destroyed.

Back