From patchwork Thu Sep 18 08:25:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satoru Takeuchi X-Patchwork-Id: 4929771 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 045469F350 for ; Thu, 18 Sep 2014 08:25:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1CDE2010B for ; Thu, 18 Sep 2014 08:26:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17E43200FF for ; Thu, 18 Sep 2014 08:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250AbaIRI0M (ORCPT ); Thu, 18 Sep 2014 04:26:12 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:44325 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751817AbaIRI0K (ORCPT ); Thu, 18 Sep 2014 04:26:10 -0400 Received: from kw-mxoi2.gw.nic.fujitsu.com (unknown [10.0.237.143]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 540423EE0BD for ; Thu, 18 Sep 2014 17:26:08 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by kw-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 69ED2AC07B1 for ; Thu, 18 Sep 2014 17:26:07 +0900 (JST) Received: from g01jpfmpwyt02.exch.g01.fujitsu.local (g01jpfmpwyt02.exch.g01.fujitsu.local [10.128.193.56]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 19C501DB8032 for ; Thu, 18 Sep 2014 17:26:07 +0900 (JST) Received: from g01jpexchyt37.g01.fujitsu.local (unknown [10.128.193.4]) by g01jpfmpwyt02.exch.g01.fujitsu.local (Postfix) with ESMTP id 1E35758431A for ; Thu, 18 Sep 2014 17:26:06 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.0.1 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20120718-4 Message-ID: <541A9717.5000003@jp.fujitsu.com> Date: Thu, 18 Sep 2014 17:25:59 +0900 From: Satoru Takeuchi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "linux-btrfs@vger.kernel.org" Subject: [PATCH 1/5] btrfs: nodatasum drop compress X-SecurityPolicyCheck-GC: OK by FENCE-Mail Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Naohiro Aota We can enable both compress option and nodatasum option at the same time with the following command. -- 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 === $ 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 Signed-off-by: Satoru Takeuchi --- 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)) {