diff mbox

btrfs-progs: mkfs: fix an error when using DUP on multidev fs

Message ID 56F49A96.70808@jp.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Satoru Takeuchi March 25, 2016, 1:55 a.m. UTC
To accept DUP on multidev fs, in addition to the following
commit, we need to mark DUP as an allowed data/metadata
profile.

commit 42f1279bf8e9 ("btrfs-progs: mkfs: allow DUP on multidev fs, only warn")

* actual result

  =============================================
  # ./mkfs.btrfs -f -m DUP -d DUP /dev/sdb1 /dev/sdb2
  btrfs-progs v4.5-24-ga35b7e6
  See http://btrfs.wiki.kernel.org for more information.

  WARNING: DUP is not recommended on filesystem with multiple devices
  ERROR: unable to create FS with metadata profile DUP (have 2 devices but 1 devices are required)
  =============================================

* expected result

  =============================================
  # ./mkfs.btrfs -f -m dup -d dup /dev/sdb1 /dev/sdb2
  WARNING: DUP is not recommended on filesystem with multiple devices
  btrfs-progs v4.5-25-g1a10a3c
  See http://btrfs.wiki.kernel.org for more information.

  Label:              (null)
  UUID:               010d72ff-c87c-4516-8916-5e635719d110
  Node size:          16384
  Sector size:        4096
  Filesystem size:    28.87GiB
  Block group profiles:
    Data:             DUP               1.01GiB
    Metadata:         DUP               1.01GiB
    System:           DUP              12.00MiB
  SSD detected:       no
  Incompat features:  extref, skinny-metadata
  Number of devices:  2
  Devices:
     ID        SIZE  PATH
      1   953.00MiB  /dev/sdb1
      2    27.94GiB  /dev/sdb2

  ==================================================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
This patch can be applied to devel branch (commit: a35b7e6ee122)
---
 utils.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Sterba March 30, 2016, 2:20 p.m. UTC | #1
On Fri, Mar 25, 2016 at 10:55:34AM +0900, Satoru Takeuchi wrote:
> To accept DUP on multidev fs, in addition to the following
> commit, we need to mark DUP as an allowed data/metadata
> profile.
> 
> commit 42f1279bf8e9 ("btrfs-progs: mkfs: allow DUP on multidev fs, only warn")
> 
> * actual result
> 
>   =============================================
>   # ./mkfs.btrfs -f -m DUP -d DUP /dev/sdb1 /dev/sdb2
>   btrfs-progs v4.5-24-ga35b7e6
>   See http://btrfs.wiki.kernel.org for more information.
> 
>   WARNING: DUP is not recommended on filesystem with multiple devices
>   ERROR: unable to create FS with metadata profile DUP (have 2 devices but 1 devices are required)
>   =============================================
> 
> * expected result
> 
>   =============================================
>   # ./mkfs.btrfs -f -m dup -d dup /dev/sdb1 /dev/sdb2
>   WARNING: DUP is not recommended on filesystem with multiple devices
>   btrfs-progs v4.5-25-g1a10a3c
>   See http://btrfs.wiki.kernel.org for more information.
> 
>   Label:              (null)
>   UUID:               010d72ff-c87c-4516-8916-5e635719d110
>   Node size:          16384
>   Sector size:        4096
>   Filesystem size:    28.87GiB
>   Block group profiles:
>     Data:             DUP               1.01GiB
>     Metadata:         DUP               1.01GiB
>     System:           DUP              12.00MiB
>   SSD detected:       no
>   Incompat features:  extref, skinny-metadata
>   Number of devices:  2
>   Devices:
>      ID        SIZE  PATH
>       1   953.00MiB  /dev/sdb1
>       2    27.94GiB  /dev/sdb2
> 
>   ==================================================
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Applied, mkfs tests updated. Thanks.
--
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/utils.c b/utils.c
index 75ce6ea..7e45702 100644
--- a/utils.c
+++ b/utils.c
@@ -2455,7 +2455,6 @@  int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
 	case 2:
 		allowed |= BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
 			BTRFS_BLOCK_GROUP_RAID5;
-		break;
 	case 1:
 		allowed |= BTRFS_BLOCK_GROUP_DUP;
 	}