• Anand Jain's avatar
    btrfs: scan but don't register device on single device filesystem · bc27d6f0
    Anand Jain authored
    After the commit 5f58d783 ("btrfs: free device in btrfs_close_devices
    for a single device filesystem") we unregister the device from the kernel
    memory upon unmounting for a single device.
    
    So, device registration that was performed before mounting if any is no
    longer in the kernel memory.
    
    However, in fact, note that device registration is unnecessary for a
    single-device btrfs filesystem unless it's a seed device.
    
    So for commands like 'btrfs device scan' or 'btrfs device ready' with a
    non-seed single-device btrfs filesystem, they can return success just
    after superblock verification and without the actual device scan.  When
    'device scan --forget' is called on such device no error is returned.
    
    The seed device must remain in the kernel memory to allow the sprout
    device to mount without the need to specify the seed device explicitly.
    Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    bc27d6f0
volumes.h 22.8 KB