linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/5] btrfs: correct a message on setting nodatacow
Date: Fri, 19 Sep 2014 10:03:52 +0800	[thread overview]
Message-ID: <541B8F08.5020102@cn.fujitsu.com> (raw)
In-Reply-To: <541A979D.8060409@jp.fujitsu.com>


-------- Original Message --------
Subject: [PATCH 2/5] btrfs: correct a message on setting nodatacow
From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: linux-btrfs@vger.kernel.org <linux-btrfs@vger.kernel.org>
Date: 2014年09月18日 16:28
> From: Naohiro Aota <naota@elisp.net>
>
> If we set nodatacow mount option after compress-force option,
> we don't get compression disabling message.
>
> ===
> $ sudo mount -o remount,compress-force,nodatacow /; dmesg|tail -n 3
> [ 3845.719047] BTRFS info (device vda2): force zlib compression
> [ 3845.719052] BTRFS info (device vda2): setting nodatacow
> [ 3845.719055] BTRFS info (device vda2): disk space caching is enabled
> ===
>
> Signed-off-by: Naohiro Aota <naota@elisp.net>
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> ---
>   fs/btrfs/super.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index d1c5b6d..d131098 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -462,8 +462,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
>   			break;
>   		case Opt_nodatacow:
>   			if (!btrfs_test_opt(root, NODATACOW)) {
> -				if (!btrfs_test_opt(root, COMPRESS) ||
> -				    !btrfs_test_opt(root, FORCE_COMPRESS)) {
> +				if (btrfs_test_opt(root, COMPRESS)) {
>   					btrfs_info(root->fs_info,
>   						   "setting nodatacow, compression disabled");
>   				} else {
> -- 1.8.3.1
>
> --
> 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
Although the patch makes the output ok, the core problem is missing 
conflict options check.

compress-force mount options implies datacow and datasum, but following 
nodatasum will disable datasum and compress, in fact they are 
conflicting mount option...

Even the current behavior(later mount option will override previous 
ones) provides great tolerance,
IMO there should better be some conflicting check for mount options.

For example, we first save all the mount options passed in into a 
temporary bitmaps to finds out the conflicting
and only when they contains no conflicts, set the mount options to fs_info.
(Maybe bitmap is not enough for this case, since we can't distinguish 
default value and value to be set?)

What do you think about this idea ?

Thanks,
Qu

  reply	other threads:[~2014-09-19  2:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  8:25 [PATCH 1/5] btrfs: nodatasum drop compress Satoru Takeuchi
2014-09-18  8:28 ` [PATCH 2/5] btrfs: correct a message on setting nodatacow Satoru Takeuchi
2014-09-19  2:03   ` Qu Wenruo [this message]
2014-09-19  6:45     ` Satoru Takeuchi
2014-09-19  7:01       ` Qu Wenruo
2014-09-18  8:30 ` [PATCH 3/5] btrfs: notice nodatasum is also enabled with nodatacow Satoru Takeuchi
2014-09-18  8:32 ` [PATCH 4/5] btrfs: suppress a verbose message about enabling space cache on remounting Satoru Takeuchi
2014-09-18  8:43 ` [PATCH 5/5] btrfs: rework compression related options processing Satoru Takeuchi

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=541B8F08.5020102@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=takeuchi_satoru@jp.fujitsu.com \
    /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).