Re: [PATCH 5/6] btrfs: copy fsid and metadata_uuid for pulled disk without INCOMPAT_METADATA_UUID

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

 




On 12.12.19 г. 13:01 ч., damenly.su@xxxxxxxxx wrote:
> From: Su Yue <Damenly_Su@xxxxxxx>
> 
> Since a scanned device may be the device pulled into disk without
> metadata_uuid feature, there may already be changing devices there.
> Here copy fsid and metadata_uuid for above case.
> 
> Signed-off-by: Su Yue <Damenly_Su@xxxxxxx>


What does this patch fix, why is it needed? It seems to be independent
of the split brain fixes?

> ---
>  fs/btrfs/volumes.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index faf9cdd14f33..b21ab45e76a0 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -964,13 +964,16 @@ static noinline struct btrfs_device *device_list_add(const char *path,
>  	 * metadata_uuid/fsid values of the fs_devices.
>  	 */
>  	if (*new_device_added && fs_devices_found &&
> -	    has_metadata_uuid && fs_devices->fsid_change &&
> +	    fs_devices->fsid_change &&
>  	    found_transid > fs_devices->latest_generation) {
>  		memcpy(fs_devices->fsid, disk_super->fsid,
>  		       BTRFS_FSID_SIZE);
> -		memcpy(fs_devices->metadata_uuid,
> -		       disk_super->metadata_uuid, BTRFS_FSID_SIZE);
> -
> +		if (has_metadata_uuid)
> +			memcpy(fs_devices->metadata_uuid,
> +			       disk_super->metadata_uuid, BTRFS_FSID_SIZE);
> +		else
> +			memcpy(fs_devices->metadata_uuid,
> +			       disk_super->fsid, BTRFS_FSID_SIZE);
>  		fs_devices->fsid_change = false;
>  	}
>  
> 



[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