• Anand Jain's avatar
    btrfs: print name and pid when device scanning processes race · 7f9879eb
    Anand Jain authored
    There is a race between systemd and mount, as both of them try to register
    the device in the kernel. When systemd loses the race, it prints the
    following message:
    
      BTRFS error: device /dev/sdb7 belongs to fsid 1b3bacbf-14db-49c9-a3ef-547998aacc4e, and the fs is already mounted.
    
    The 'btrfs dev scan' registers one device at a time, so there is no way
    for the mount thread to wait in the kernel for all the devices to have
    registered as it won't know if all the devices are discovered.
    
    For now, improve the error log by printing the command name and process
    ID along with the error message.
    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>
    7f9879eb
volumes.c 218 KB