diff mbox

Btrfs: num_tolerated_disk_barrier_failures is incorrect for RAID6

Message ID 1373457270-18909-1-git-send-email-idryomov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ilya Dryomov July 10, 2013, 11:54 a.m. UTC
Currently num_tolerated_disk_barrier_failures gets the value of
fs_devices->num_devices in the RAID6 case.  But, RAID6 can tolerate only
two simultaneous failures, so set it to 2.

CC: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
 fs/btrfs/disk-io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Behrens July 10, 2013, 12:23 p.m. UTC | #1
On Wed, 10 Jul 2013 14:54:30 +0300, Ilya Dryomov wrote:
> Currently num_tolerated_disk_barrier_failures gets the value of
> fs_devices->num_devices in the RAID6 case.  But, RAID6 can tolerate only
> two simultaneous failures, so set it to 2.
> 
> CC: Stefan Behrens <sbehrens@giantdisaster.de>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>  fs/btrfs/disk-io.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index b8b60b6..aecf788 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3258,7 +3258,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
>  					    BTRFS_BLOCK_GROUP_RAID10)) {
>  						num_tolerated_disk_barrier_failures = 1;
>  					} else if (flags &
> -						   BTRFS_BLOCK_GROUP_RAID5) {
> +						   BTRFS_BLOCK_GROUP_RAID6) {
>  						num_tolerated_disk_barrier_failures = 2;
>  					}
>  				}
> 

ELATE :), Henrik Nordvik already fixed it with commit 15b0a89d7.

--
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/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b8b60b6..aecf788 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3258,7 +3258,7 @@  int btrfs_calc_num_tolerated_disk_barrier_failures(
 					    BTRFS_BLOCK_GROUP_RAID10)) {
 						num_tolerated_disk_barrier_failures = 1;
 					} else if (flags &
-						   BTRFS_BLOCK_GROUP_RAID5) {
+						   BTRFS_BLOCK_GROUP_RAID6) {
 						num_tolerated_disk_barrier_failures = 2;
 					}
 				}