From patchwork Wed Oct 4 02:05:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 9983737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CADB260237 for ; Wed, 4 Oct 2017 02:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC49224B44 for ; Wed, 4 Oct 2017 02:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B059A28A4E; Wed, 4 Oct 2017 02:05:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A85824B44 for ; Wed, 4 Oct 2017 02:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751172AbdJDCFw (ORCPT ); Tue, 3 Oct 2017 22:05:52 -0400 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:48935 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbdJDCFw (ORCPT ); Tue, 3 Oct 2017 22:05:52 -0400 Received: from yt-mxoi1.gw.nic.fujitsu.com (unknown [192.168.229.67]) by mgwym04.jp.fujitsu.com with smtp id 3ae7_c677_a9ee6d83_fc8f_466b_9d39_f17d214094b4; Wed, 04 Oct 2017 11:05:47 +0900 Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by yt-mxoi1.gw.nic.fujitsu.com (Postfix) with ESMTP id 2AFE0AC021C for ; Wed, 4 Oct 2017 11:05:45 +0900 (JST) Received: from WIN-5MHF4RKU941.jp.fujitsu.com (unknown [10.124.101.65]) by m3051.s.css.fujitsu.com (Postfix) with SMTP id 15792183; Wed, 4 Oct 2017 11:05:45 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: da92d12101b6408f814963b0abf65ea3 Message-Id: <201710040205.AA00002@WIN-5MHF4RKU941.jp.fujitsu.com> From: Tsutomu Itoh Date: Wed, 04 Oct 2017 11:05:17 +0900 To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH v2] Btrfs: fix overlap of fs_info->flags values MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Because the values of BTRFS_FS_EXCL_OP and BTRFS_FS_QUOTA_OVERRIDE overlap, we should change the value. First, BTRFS_FS_EXCL_OP was set to 14. commit 171938e52807 ("btrfs: track exclusive filesystem operation in flags") Next, the value of BTRFS_FS_QUOTA_OVERRIDE was set to 14. commit f29efe292198 ("btrfs: add quota override flag to enable quota override for CAP_SYS_RESOURCE") As a result, the value 14 overlapped. This problem is solved by defining the value of BTRFS_FS_QUOTA_OVERRIDE as 16. Fixes: f29efe292198 ("btrfs: add quota override flag to enable quota override for CAP_SYS_RESOURCE") CC: stable@vger.kernel.org # 4.13+ Signed-off-by: Tsutomu Itoh Reviewed-by: David Sterba --- v2: changed the value of BTRFS_FS_QUOTA_OVERRIDE instead of BTRFS_FS_EXCL_OP to 16. fs/btrfs/ctree.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 899ddaeeacec..d265ea7f763e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -714,15 +714,14 @@ struct btrfs_delayed_root; #define BTRFS_FS_BTREE_ERR 11 #define BTRFS_FS_LOG1_ERR 12 #define BTRFS_FS_LOG2_ERR 13 -#define BTRFS_FS_QUOTA_OVERRIDE 14 -/* Used to record internally whether fs has been frozen */ -#define BTRFS_FS_FROZEN 15 - /* * Indicate that a whole-filesystem exclusive operation is running * (device replace, resize, device add/delete, balance) */ #define BTRFS_FS_EXCL_OP 14 +/* Used to record internally whether fs has been frozen */ +#define BTRFS_FS_FROZEN 15 +#define BTRFS_FS_QUOTA_OVERRIDE 16 struct btrfs_fs_info { u8 fsid[BTRFS_FSID_SIZE];