All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] btrfs: nodatasum drop compress
@ 2014-09-18  8:25 Satoru Takeuchi
  2014-09-18  8:28 ` [PATCH 2/5] btrfs: correct a message on setting nodatacow Satoru Takeuchi
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Satoru Takeuchi @ 2014-09-18  8:25 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

From: Naohiro Aota <naota@elisp.net>

We can enable both compress option and nodatasum option at the same time
with the following command.

===
$ sudo mount -o remount,compress,nodatasum /
$ mount | grep btrfs
/dev/vda2 on / type btrfs (rw,relatime,seclabel,nodatasum,compress=zlib,space_cache)
===

This behavior collides with Documentation/filesystems/btrfs.txt:

===
...
  If compression is enabled, nodatacow and nodatasum are disabled.
...
===

This patch drops the compress flags upon nodatasum flag.

Signed-off-by: Naohiro Aota <naota@elisp.net>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
 fs/btrfs/super.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c4124de..d1c5b6d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -440,8 +440,15 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
 			 */
 			break;
 		case Opt_nodatasum:
-			btrfs_set_and_info(root, NODATASUM,
-					   "setting nodatasum");
+			if (!btrfs_test_opt(root, NODATASUM)) {
+				if (btrfs_test_opt(root, COMPRESS))
+					btrfs_info(root->fs_info, "setting nodatasum, compression disabled");
+				else
+					btrfs_info(root->fs_info, "setting nodatasum");
+			}
+			btrfs_clear_opt(info->mount_opt, COMPRESS);
+			btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
+			btrfs_set_opt(info->mount_opt, NODATASUM);
 			break;
 		case Opt_datasum:
 			if (btrfs_test_opt(root, NODATASUM)) {
-- 1.8.3.1 


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

end of thread, other threads:[~2014-09-19  7:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.