linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Anand Jain <anand.jain@oracle.com>
Cc: Lutz Vieweg <lvml@5t9.de>, linux-btrfs@vger.kernel.org
Subject: Mixed and raid [was Re: BUG: btrfsRe: Does btrfs "raid1" actually provide any resilience?]
Date: Thu, 14 Nov 2013 22:21:22 +0100	[thread overview]
Message-ID: <52853ED2.8040606@libero.it> (raw)
In-Reply-To: <528536F7.6030503@libero.it>

Hi Anand,

after some tests and looking at the code I discovered that the current
mkfs.btrfs doesn't allow any raid profile other than SINGLE for data and
meta-data when the mixed metadata/data group is enabled. It seems this
behaviour was introduce by a your commit [1].


mkfs.c line 1384 onwards

	/*
	* Set default profiles according to number of added devices.
	* For mixed groups defaults are single/single.
	*/
	if (!mixed) {
[....]
	} else {
		u32 best_leafsize = max_t(u32, sysconf(_SC_PAGESIZE),
				sectorsize);
		metadata_profile = 0;
		data_profile = 0;


But in another your commit [2] it seems that you check that in case of
mixed, the metadata and data profile have to be equal (implicitly
allowing that they could be different than single ?).

mkfs.c line 1373 onward

	if (is_vol_small(file)) {
		printf("SMALL VOLUME: forcing mixed metadata/data
				groups\n");
		mixed = 1;
		if (metadata_profile != data_profile) {
			if (metadata_profile_opt || data_profile_opt) {
				fprintf(stderr, "With mixed block
	 groups data and metadata profiles must be the same\n");
				exit(1);
			}
		}
	}


So I am a bit confusing: it is allowed a raid profile different than
single when the mixed is enabled ? Of course mixed and raid together
doesn't make sense (or almost make very little sense) but the code of
mkfs is a bit confused, and a warning should be raised when the raid
profile are forced to a default different from the one selected by the user.


Thanks for the attention.
BR
G.Baroncelli


[1] btrfs-progs: avoid write to the disk before sure to create fs
71d6bd3c8d70fb682c7fd50796f587ce1f1cf6f8
.
[2] btrfs-progs: mkfs should check for small vol well before
cdbc10729266c03aeb2eb812c17a3ef6c1ceae26
-- 
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2013-11-14 21:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 11:02 Does btrfs "raid1" actually provide any resilience? Lutz Vieweg
2013-11-14 17:18 ` George Mitchell
2013-11-14 17:35   ` Lutz Vieweg
2013-11-14 19:59     ` Kyle Gates
2013-11-15  1:58     ` George Mitchell
2013-11-14 18:22 ` Goffredo Baroncelli
2013-11-14 20:47   ` BUG: btrfsRe: " Goffredo Baroncelli
2013-11-14 21:21     ` Goffredo Baroncelli [this message]
2013-11-15  4:44       ` Mixed and raid [was Re: BUG: btrfsRe: Does btrfs "raid1" actually provide any resilience?] Anand Jain
2013-11-15 10:35         ` Lutz Vieweg
2013-11-15 10:36         ` Lutz Vieweg
2013-11-15  7:12       ` Duncan
2013-11-15  7:30         ` Goffredo Baroncelli
2013-11-15  9:37           ` Duncan
2013-11-14 21:22     ` BUG: btrfsRe: Does btrfs "raid1" actually provide any resilience? Chris Murphy
2013-11-14 21:31       ` Goffredo Baroncelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52853ED2.8040606@libero.it \
    --to=kreijack@libero.it \
    --cc=anand.jain@oracle.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lvml@5t9.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).