Skip to contentSkip to conversation

ceph: fix posix acl couldn't be settable

PATCH Applied [email protected] 3 participants 3 messages Feb 11, 2020 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH v2 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")

---

Changed in V2:
- move default fc->sb_flags setting to ceph_init_fs_context().

 fs/ceph/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +4 -4
index 5fef4f59e13e..c3d9ac768cec 100644
@@ -1089,10 +1089,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;
@@ -1215,6 +1211,10 @@ static int ceph_init_fs_context(struct fs_context *fc)
 	fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
 	fsopt->congestion_kb = default_congestion_kb();
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	fc->sb_flags |= SB_POSIXACL;
+#endif
+
 	fc->fs_private = pctx;
 	fc->ops = &ceph_context_ops;
 	return 0;
Signature · 1 line
2.21.0
maintainer Applied
#1 lore raw
Quoted 37 lines · On Tue, Feb 11, 2020 at 7:53 AM <[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")

---

Changed in V2:
- move default fc->sb_flags setting to ceph_init_fs_context().

 fs/ceph/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +0 -4
index 5fef4f59e13e..c3d9ac768cec 100644
@@ -1089,10 +1089,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;

fs/ceph/super.c static int ceph_init_fs_context(struct fs_context *fc) · line 1220

Quoted 10 lines
fs/ceph/super.c +4 -0
@@ -1215,6 +1211,10 @@ static int ceph_init_fs_context(struct fs_context *fc)
        fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
        fsopt->congestion_kb = default_congestion_kb();
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+       fc->sb_flags |= SB_POSIXACL;
+#endif
+
        fc->fs_private = pctx;
        fc->ops = &ceph_context_ops;
        return 0;

Applied.

Thanks,

Ilya

Reviewed-by on v2 1/1
#2 lore raw
In reply to [email protected]
Quoted 36 lines · On Tue, 2020-02-11 at 01:53 -0500, [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")

---

Changed in V2:
- move default fc->sb_flags setting to ceph_init_fs_context().

 fs/ceph/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ceph/super.c +0 -4
index 5fef4f59e13e..c3d9ac768cec 100644
@@ -1089,10 +1089,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;

fs/ceph/super.c static int ceph_init_fs_context(struct fs_context *fc) · line 1220

Quoted 10 lines
fs/ceph/super.c +4 -0
@@ -1215,6 +1211,10 @@ static int ceph_init_fs_context(struct fs_context *fc)
 	fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
 	fsopt->congestion_kb = default_congestion_kb();
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	fc->sb_flags |= SB_POSIXACL;
+#endif
+
 	fc->fs_private = pctx;
 	fc->ops = &ceph_context_ops;
 	return 0;

Nice catch.