Skip to contentSkip to conversation

ceph: fix posix acl couldn't be settable

PATCH Superseded [email protected] 2 participants 4 messages Feb 10, 2020 – Feb 11, 2020 Ceph client

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: fix posix acl couldn't be settable

From: Xiubo Li <[email protected]>

For the old mount API, the module parameters parseing function will be called in ceph_mount() and also just after the default posix acl flag set, so we can control to enable/disable it via the mount option.

But for the new mount API, it will call the module parameters parseing function before ceph_get_tree(), so the posix acl will always be enabled.

Fixes 82995cc6c5ae ("libceph, rbd, ceph: convert to use the new mount API")
---
 fs/ceph/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +4 -4
index 5fef4f59e13e..69fa498391dc 100644
@@ -341,6 +341,10 @@ static int ceph_parse_mount_param(struct fs_context *fc,
 	unsigned int mode;
 	int token, ret;
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	fc->sb_flags |= SB_POSIXACL;
+#endif
+
 	ret = ceph_parse_param(param, pctx->copts, fc);
 	if (ret != -ENOPARAM)
 		return ret;
@@ -1089,10 +1093,6 @@ static int ceph_get_tree(struct fs_context *fc)
 	if (!fc->source)
 		return invalf(fc, "ceph: No source");
 
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	fc->sb_flags |= SB_POSIXACL;
-#endif
-
 	/* create client (which we may/may not use) */
 	fsc = create_fs_client(pctx->opts, pctx->copts);
 	pctx->opts = NULL;
Signature · 1 line
2.21.0
author
#1 lore raw
Quoted 21 lines · On 2020/2/10 21:58, [email protected] wrote:

From: Xiubo Li <[email protected]>

For the old mount API, the module parameters parseing function will be called in ceph_mount() and also just after the default posix acl flag set, so we can control to enable/disable it via the mount option.

But for the new mount API, it will call the module parameters parseing function before ceph_get_tree(), so the posix acl will always be enabled.

Fixes 82995cc6c5ae ("libceph, rbd, ceph: convert to use the new mount API")
---
  fs/ceph/super.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +0 -0
index 5fef4f59e13e..69fa498391dc 100644

fs/ceph/super.c static int ceph_parse_mount_param(struct fs_context *fc, · line 347

Quoted 7 lines
fs/ceph/super.c +4 -0
@@ -341,6 +341,10 @@ static int ceph_parse_mount_param(struct fs_context *fc,
  	unsigned int mode;
  	int token, ret;
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	fc->sb_flags |= SB_POSIXACL;
+#endif
+

Maybe we should move this to ceph_init_fs_context().

Quoted 14 lines
fs/ceph/super.c +0 -4
  	ret = ceph_parse_param(param, pctx->copts, fc);
  	if (ret != -ENOPARAM)
  		return ret;
@@ -1089,10 +1093,6 @@ static int ceph_get_tree(struct fs_context *fc)
  	if (!fc->source)
  		return invalf(fc, "ceph: No source");
 
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	fc->sb_flags |= SB_POSIXACL;
-#endif
-
  	/* create client (which we may/may not use) */
  	fsc = create_fs_client(pctx->opts, pctx->copts);
  	pctx->opts = NULL;
maintainer
#2 lore raw
Quoted 26 lines · Xiubo Li
Quoted 24 lines · On 2020/2/10 21:58, [email protected] wrote:

From: Xiubo Li <[email protected]>

For the old mount API, the module parameters parseing function will be called in ceph_mount() and also just after the default posix acl flag set, so we can control to enable/disable it via the mount option.

But for the new mount API, it will call the module parameters parseing function before ceph_get_tree(), so the posix acl will always be enabled.

Fixes 82995cc6c5ae ("libceph, rbd, ceph: convert to use the new mount API")
---
  fs/ceph/super.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +0 -0
index 5fef4f59e13e..69fa498391dc 100644
@@ -341,6 +341,10 @@ static int ceph_parse_mount_param(struct fs_context *fc,
      unsigned int mode;
      int token, ret;
 
Quoted 6 lines

fs/ceph/super.c static int ceph_parse_mount_param(struct fs_context *fc, · line 347

Quoted 4 lines
fs/ceph/super.c +4 -0
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+     fc->sb_flags |= SB_POSIXACL;
+#endif
+

Maybe we should move this to ceph_init_fs_context().

Hi Xiubo,

Yes -- so it is together with fsopt defaults.

Thanks,

Ilya

author
#3 lore raw
Quoted 26 lines · Ilya Dryomov
Quoted 25 lines · Xiubo Li
Quoted 24 lines · On 2020/2/10 21:58, [email protected] wrote:

From: Xiubo Li <[email protected]>

For the old mount API, the module parameters parseing function will be called in ceph_mount() and also just after the default posix acl flag set, so we can control to enable/disable it via the mount option.

But for the new mount API, it will call the module parameters parseing function before ceph_get_tree(), so the posix acl will always be enabled.

Fixes 82995cc6c5ae ("libceph, rbd, ceph: convert to use the new mount API")
---
   fs/ceph/super.c | 8 ++++----
   1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +0 -0
index 5fef4f59e13e..69fa498391dc 100644
@@ -341,6 +341,10 @@ static int ceph_parse_mount_param(struct fs_context *fc,
       unsigned int mode;
       int token, ret;
 
Quoted 9 lines
Quoted 5 lines

fs/ceph/super.c static int ceph_parse_mount_param(struct fs_context *fc, · line 347

Quoted 4 lines
fs/ceph/super.c +4 -0
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+     fc->sb_flags |= SB_POSIXACL;
+#endif
+

Maybe we should move this to ceph_init_fs_context().

Hi Xiubo,

Yes -- so it is together with fsopt defaults.

Okay, will fix it.

Thanks.