diff mbox

[v2] Btrfs: fix overlap of fs_info->flags values

Message ID 201710040205.AA00002@WIN-5MHF4RKU941.jp.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tsutomu Itoh Oct. 4, 2017, 2:05 a.m. UTC
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 <t-itoh@jp.fujitsu.com>
---
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(-)

Comments

David Sterba Oct. 4, 2017, 2:41 p.m. UTC | #1
On Wed, Oct 04, 2017 at 11:05:17AM +0900, Tsutomu Itoh wrote:
> 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 <t-itoh@jp.fujitsu.com>
> ---
> 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

Thanks. I think we can keep the patch minimal and only change
BTRFS_FS_EXCL_OP to 16, I'll update the patch and commit.

Reviewed-by: David Sterba <dsterba@suse.com>
--
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
diff mbox

Patch

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];