• Shin'ichiro Kawasaki's avatar
    block: Fix partition check for host-aware zoned block devices · e0c60d01
    Shin'ichiro Kawasaki authored
    Commit a33df75c ("block: use an xarray for disk->part_tbl") modified
    the method to check partition existence in host-aware zoned block
    devices from disk_has_partitions() helper function call to empty check
    of xarray disk->part_tbl. However, disk->part_tbl always has single
    entry for disk->part0 and never becomes empty. This resulted in the
    host-aware zoned devices always judged to have partitions, and it made
    the sysfs queue/zoned attribute to be "none" instead of "host-aware"
    regardless of partition existence in the devices.
    
    This also caused DEBUG_LOCKS_WARN_ON(lock->magic != lock) for
    sdkp->rev_mutex in scsi layer when the kernel detects host-aware zoned
    device. Since block layer handled the host-aware zoned devices as non-
    zoned devices, scsi layer did not have chance to initialize the mutex
    for zone revalidation. Therefore, the warning was triggered.
    
    To fix the issues, call the helper function disk_has_partitions() in
    place of disk->p...
    e0c60d01
blk-settings.c 28.7 KB