Re: [PATCH v4 3/3] btrfs: free alien device due to device add

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

 







Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
Reviewed-by: Josef Bacik <josef@xxxxxxxxxxxxxx>

So I'm not sure how much the review holds when the code changes between
iterations. The right way is to drop the rev-by and CC the person for
any non-trivial or maybe for all changes.


 only thing that changed is use of helper function
 btrfs_forget_devices() instead of the open-code, so I kept the rev-by.
 Yeah I kind of noticed late that cc list added during git format-patch
 didn't actually add cc in the git send <patch-file>


--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2664,6 +2664,15 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
/* Update ctime/mtime for libblkid */
  	update_dev_time(device_path);
+
+	/*
+	 * Now that we have written a new sb into this device, check all other
+	 * fs_devices list if device_path alienates any other scanned device.
+	 * Ignore the return as we are successfull in the core task - add
+	 * the device.
+	 */
+	btrfs_forget_devices(device_path);

Actually this should go before update_dev_time, as this is the point
when the file change could be detected by udev and rescanned, which
increases the window between commit and removal from fs_devices.


 You are right, theoretically btrfs_forget_devices() should be before
 update_dev_time()


Noted and agreed on rest of the stuffs.

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