Re: [PATCH] btrfs: resize: Allow user to shrink missing device

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

 



On Tue, Nov 19, 2019 at 03:40:42PM +0800, Anand Jain wrote:
>   IMO changing the size of the missing device is point less. What if
>   in between the resize and replace the missing device reappears
>   in the following unmount and mount.

The reappearing device is always tricky. If the device is missing from
the beginning, it'll exist in the fs_devices structure with MISSING bit
set. If it reappears, device_list_add will find it, update the path and
drop the missing bit.

>From that point the device is regular but might miss some data updates.
There's a check for last generation of the device to pick the latest
one, but this applies only to mount.

Now when there's a replace in progress, and on a redundant profile, like
in the reported case, the device can be used as source device as long as
the data are not stale. This is detected by generation mismatch.

The resize of missing device happens on the in-memory structure as it is
represented in the fs_devices list, before the device reappears. And
after it's scanned again, the device item in memory is not changed, so
the size stays and is used until replace finishes.

Which is IMO all ok for the usecase, but the device states are tricky so
I could have missed something.



[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