linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn
@ 2016-03-24 15:56 David Sterba
  2016-03-25  1:55 ` [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs Satoru Takeuchi
  2016-03-25  1:59 ` [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn Duncan
  0 siblings, 2 replies; 5+ messages in thread
From: David Sterba @ 2016-03-24 15:56 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

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

Signed-off-by: David Sterba <dsterba@suse.com>
---
 utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/utils.c b/utils.c
index eabc36dca7a1..9bc18d4508fc 100644
--- a/utils.c
+++ b/utils.c
@@ -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,
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs
  2016-03-24 15:56 [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn David Sterba
@ 2016-03-25  1:55 ` Satoru Takeuchi
  2016-03-30 14:20   ` David Sterba
  2016-03-25  1:59 ` [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn Duncan
  1 sibling, 1 reply; 5+ messages in thread
From: Satoru Takeuchi @ 2016-03-25  1:55 UTC (permalink / raw)
  To: David Sterba, linux-btrfs

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(-)

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;
 	}
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn
  2016-03-24 15:56 [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn David Sterba
  2016-03-25  1:55 ` [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs Satoru Takeuchi
@ 2016-03-25  1:59 ` Duncan
  2016-03-25  3:58   ` Hugo Mills
  1 sibling, 1 reply; 5+ messages in thread
From: Duncan @ 2016-03-25  1:59 UTC (permalink / raw)
  To: linux-btrfs

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

> The DUP profile can work on multiple filesystems, the limitation is
> rather artificial. Let the user make the decision and print a warning.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---

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

-- 
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn
  2016-03-25  1:59 ` [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn Duncan
@ 2016-03-25  3:58   ` Hugo Mills
  0 siblings, 0 replies; 5+ messages in thread
From: Hugo Mills @ 2016-03-25  3:58 UTC (permalink / raw)
  To: Duncan; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

On Fri, Mar 25, 2016 at 01:59:20AM +0000, Duncan wrote:
> David Sterba posted on Thu, 24 Mar 2016 16:56:13 +0100 as excerpted:
> 
> > The DUP profile can work on multiple filesystems, the limitation is
> > rather artificial. Let the user make the decision and print a warning.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> 
> 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.

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs
  2016-03-25  1:55 ` [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs Satoru Takeuchi
@ 2016-03-30 14:20   ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2016-03-30 14:20 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: David Sterba, linux-btrfs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-30 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 15:56 [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn David Sterba
2016-03-25  1:55 ` [PATCH] btrfs-progs: mkfs: fix an error when using DUP on multidev fs Satoru Takeuchi
2016-03-30 14:20   ` David Sterba
2016-03-25  1:59 ` [PATCH] btrfs-progs: mkfs: allow DUP on multidev fs, only warn Duncan
2016-03-25  3:58   ` Hugo Mills

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).