]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: handle errors in btrfs_sysfs_add_fs_devices
authorAnand Jain <anand.jain@oracle.com>
Fri, 4 Sep 2020 17:34:29 +0000 (01:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:22 +0000 (12:12 +0200)
commita6010913bca14fb47c09a441ba4de153a63ec8d0
tree3e3a6fce64cef2dc1fe238d542295e693ba50c93
parentb4f46aad900bd88aa57b35d350ab6b74038d68f2
btrfs: handle errors in btrfs_sysfs_add_fs_devices

btrfs_sysfs_add_fs_devices() is called by btrfs_sysfs_add_mounted().
btrfs_sysfs_add_mounted() assumes that btrfs_sysfs_add_fs_devices() will
either add sysfs entries for all the devices or none. So this patch keeps up
to its caller expecatation and cleans up the created sysfs entries if it
has to fail at some device in the list.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c