diff mbox

Btrfs-progs: fix typo in btrfs_err_str()

Message ID 1378706892-5341-1-git-send-email-wangsl.fnst@cn.fujitsu.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Wang Shilong Sept. 9, 2013, 6:08 a.m. UTC
Raid5 and raid6 at least need three and foure devices respectively,
fix it.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
based on david's integration 20130903
---
 ioctl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anand Jain Sept. 15, 2013, 4:59 a.m. UTC | #1
Glad that you noticed. as I did when error strings
  were given the error-code at the kernel patch
     183860f btrfs: device delete to get errors from the kernel

  which didn't alter the original error strings.

  Now, The new error string proposed here is wrong as shown below..

-----
# btrfs fi show
Label: none  uuid: 22bcca66-a10e-4f1b-b333-c79dba190db7 mounted: /btrfs
	Group profile: Metadata: RAID5    <--------
	Total devices 3 FS bytes used 32.00KiB
	devid    1 size 1.98GiB used 164.00MiB path /dev/mapper/mpatha
	devid    2 size 2.00GiB used 160.00MiB path /dev/mapper/mpathb
	devid    3 size 1.07GiB used 160.00MiB path /dev/sdd

# btrfs dev del /dev/sdd /btrfs
# btrfs fi show
Label: none  uuid: 22bcca66-a10e-4f1b-b333-c79dba190db7 mounted: /btrfs
	Group profile: Metadata: RAID5
	Total devices 2 FS bytes used 28.00KiB
	devid    1 size 1.98GiB used 292.00MiB path /dev/mapper/mpatha
	devid    2 size 2.00GiB used 288.00MiB path /dev/mapper/mpathb

# btrfs dev del /dev/mapper/mpathb /btrfs
ERROR: error removing the device '/dev/mapper/mpathb' - unable to go 
below three devices on raid5
#
-------
   ^^^  we are already at two disks !


Thanks, Anand


On 09/09/2013 02:08 PM, Wang Shilong wrote:
> Raid5 and raid6 at least need three and foure devices respectively,
> fix it.
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> ---
> based on david's integration 20130903
> ---
>   ioctl.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ioctl.h b/ioctl.h
> index e959720..c0dcc06 100644
> --- a/ioctl.h
> +++ b/ioctl.h
> @@ -484,9 +484,9 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>   		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
>   			return "unable to go below four devices on raid10";
>   		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
> -			return "unable to go below two devices on raid5";
> +			return "unable to go below three devices on raid5";
>   		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
> -			return "unable to go below three devices on raid6";
> +			return "unable to go below four devices on raid6";
>   		case BTRFS_ERROR_DEV_TGT_REPLACE:
>   			return "unable to remove the dev_replace target dev";
>   		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ioctl.h b/ioctl.h
index e959720..c0dcc06 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -484,9 +484,9 @@  static inline char *btrfs_err_str(enum btrfs_err_code err_code)
 		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
 			return "unable to go below four devices on raid10";
 		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-			return "unable to go below two devices on raid5";
+			return "unable to go below three devices on raid5";
 		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-			return "unable to go below three devices on raid6";
+			return "unable to go below four devices on raid6";
 		case BTRFS_ERROR_DEV_TGT_REPLACE:
 			return "unable to remove the dev_replace target dev";
 		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND: