Re: [PATCH v3] Btrfs: Check metadata redundancy on balance

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

 



On Wed, Jan 06, 2016 at 09:02:31AM +0000, sam tygier wrote:
> From: Sam Tygier <samtygier@xxxxxxxxxxx>
> Date: Wed, 6 Jan 2016 08:46:12 +0000
> Subject: [PATCH] Btrfs: Check metadata redundancy on balance
> 
> When converting a filesystem via balance check that metadata mode
> is at least as redundant as the data mode. For example give warning
> when:
> -dconvert=raid1 -mconvert=single
> 
> Signed-off-by: Sam Tygier <samtygier@xxxxxxxxxxx>
> ---
> v3:
>   Use btrfs_warn()
>   Mention profiles in message
> v2:
>   Use btrfs_get_num_tolerated_disk_barrier_failures()
> ---
>  fs/btrfs/volumes.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index a23399e..be91458 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -3756,6 +3756,14 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
>  		}
>  	} while (read_seqretry(&fs_info->profiles_lock, seq));
>  
> +	if (btrfs_get_num_tolerated_disk_barrier_failures(bctl->meta.target) <
> +		btrfs_get_num_tolerated_disk_barrier_failures(bctl->data.target)) {
> +		btrfs_warn(fs_info,
> +			"Warning: metatdata profile %llu has lower redundancy "
> +		        "than data profile %llu\n", bctl->meta.target,

Thanks. FYI, I made some minor adjustments to the message ("warning" is
not necessary, numer format looks better in hexa, no ending \n).
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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