Skip to contentSkip to conversation

btrfs-progs: mkfs: allow DUP on multidev fs, only warn

PATCH In review David Sterba 5 participants 5 messages Mar 24, 2016 – Mar 30, 2016 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs-progs: mkfs: allow DUP on multidev fs, only warn

The DUP profile can work on multiple filesystems, the limitation is rather artificial. Let the user make the decision and print a warning.

---
 utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
utils.c +1 -3
index eabc36dca7a1..9bc18d4508fc 100644
@@ -2484,9 +2484,7 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
 
 	if (dev_cnt > 1 &&
 	    ((metadata_profile | data_profile) & BTRFS_BLOCK_GROUP_DUP)) {
-		fprintf(stderr,
-		    "ERROR: DUP is not allowed when FS has multiple devices\n");
-		return 1;
+		warning("DUP is not recommended on filesystem with multiple devices");
 	}
 	if (metadata_profile & ~allowed) {
 		fprintf(stderr,
Signature · 1 line
2.7.1
#1 lore raw

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

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

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

---
This patch can be applied to devel branch (commit: a35b7e6ee122)

---
 utils.c | 1 -
 1 file changed, 1 deletion(-)
utils.c +0 -1
index 75ce6ea..7e45702 100644
@@ -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;
 	}
Signature · 1 line
2.5.0
#2 lore raw

Re: [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs

Quoted 42 lines · Satoru Takeuchi

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
Quoted 3 lines

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

Applied, mkfs tests updated. Thanks.

#3 lore raw
In reply to David Sterba

David Sterba posted on Thu, 24 Mar 2016 16:56:13 +0100 as excerpted:

Quoted 5 lines

The DUP profile can work on multiple filesystems, the limitation is rather artificial. Let the user make the decision and print a warning.

---

I like the change, but typo in the commit comment... What filesystems other than btrfs allow DUP? =:^) It's correct in the posting subject.

Signature · 3 lines
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman
#4 lore raw
Quoted 10 lines · Duncan

David Sterba posted on Thu, 24 Mar 2016 16:56:13 +0100 as excerpted:

Quoted 5 lines

The DUP profile can work on multiple filesystems, the limitation is rather artificial. Let the user make the decision and print a warning.

---

I like the change, but typo in the commit comment... What filesystems other than btrfs allow DUP? =:^) It's correct in the posting subject.

Class/instance problem. :)

Is that class of filesystems, btrfs, or instance of a btrfs
filesystem? "Filesystem" covers both cases.

Hugo, Ontologist(*).

(*) Yes, that's actually my job title these days.

Signature · 4 lines
Hugo Mills             | Be pure.
hugo@... carfax.org.uk | Be vigilant.
http://carfax.org.uk/  | Behave.
PGP: E2AB1DE4          |                                   Torquemada, Nemesis