Re: [PATCH 2/4] btrfs: delete identified alien device in open_fs_devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 06ec3577c6b4..05ade8c7342b 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -803,10 +803,10 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
  	disk_super = (struct btrfs_super_block *)bh->b_data;
  	devid = btrfs_stack_device_id(&disk_super->dev_item);
  	if (devid != device->devid)
-		goto error_brelse;
+		goto free_alien;
if (memcmp(device->uuid, disk_super->dev_item.uuid, BTRFS_UUID_SIZE))
-		goto error_brelse;
+		goto free_alien;

Imo a better approach is to return a particular error code and do the
deletion in open_fs_devices. Otherwise it's not apparent why you use
list_for_each_entry_safe in one function to delete something in a
different one (whose name by the way doesn't suggest a deletion is going
on). Looking at the error I think enodev/enxio is appropriate.

 Agreed. And used -EUCLEAN I think that's most appropriate.
 Thanks, Anand



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux