Skip to contentSkip to conversation

several misc patches

PATCH Applied Guangliang Zhao 3 participants 12 messages Feb 14, 2014 – Feb 18, 2014 Ceph client

lore
Share & tools
lore
#0 lore raw

cover several misc patches

Hi,

These are several misc changes: acl option for ceph mount, ACL inheritable related bug fix, some have in Zheng's patches, so this only include symlink's.

Guangliang Zhao (3):
ceph: make ceph_forget_all_cached_acls() static inline
ceph: add acl, noacl options for cephfs mount
ceph: make ceph ACL for symlink inheritable

 fs/ceph/acl.c   |    5 -----
 fs/ceph/dir.c   |    4 ++++
 fs/ceph/super.c |   24 ++++++++++++++++++++----
 fs/ceph/super.h |    6 +++++-
 4 files changed, 29 insertions(+), 10 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 ceph: make ceph_forget_all_cached_acls() static inline

---
 fs/ceph/acl.c   |    5 -----
 fs/ceph/super.h |    6 +++++-
 2 files changed, 5 insertions(+), 6 deletions(-)
fs/ceph/acl.c +0 -5
index 64fddbc..48af0b3 100644
@@ -54,11 +54,6 @@ static inline struct posix_acl *ceph_get_cached_acl(struct inode *inode,
 	return acl;
 }
 
-void ceph_forget_all_cached_acls(struct inode *inode)
-{
-	forget_all_cached_acls(inode);
-}
-
 struct posix_acl *ceph_get_acl(struct inode *inode, int type)
 {
 	int size;
fs/ceph/super.h +5 -1
index c299f7d..8851dc2 100644
@@ -13,6 +13,7 @@
 #include <linux/wait.h>
 #include <linux/writeback.h>
 #include <linux/slab.h>
+#include <linux/posix_acl.h>
 
 #include <linux/ceph/libceph.h>
 
@@ -745,7 +746,10 @@ extern const struct xattr_handler *ceph_xattr_handlers[];
 struct posix_acl *ceph_get_acl(struct inode *, int);
 int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
 int ceph_acl_chmod(struct dentry *, struct inode *);
-void ceph_forget_all_cached_acls(struct inode *inode);
+static inline void ceph_forget_all_cached_acls(struct inode *inode)
+{
+	forget_all_cached_acls(inode);
+}
 
 #else
 
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] ceph: make ceph_forget_all_cached_acls() static inline

Quoted 1 line · Guangliang Zhao

Looks good. Is there a reason we can't just call forget_all_cached_acls(inode) directly? Or is it just so that we have our own complete private ACL interface? (I have no problem with it, just asking.)

Quoted 46 lines
---
 fs/ceph/acl.c   |    5 -----
 fs/ceph/super.h |    6 +++++-
 2 files changed, 5 insertions(+), 6 deletions(-)
fs/ceph/acl.c +0 -5
index 64fddbc..48af0b3 100644
@@ -54,11 +54,6 @@ static inline struct posix_acl *ceph_get_cached_acl(struct inode *inode,
 	return acl;
 }
 
-void ceph_forget_all_cached_acls(struct inode *inode)
-{
-	forget_all_cached_acls(inode);
-}
-
 struct posix_acl *ceph_get_acl(struct inode *inode, int type)
 {
 	int size;
fs/ceph/super.h +5 -1
index c299f7d..8851dc2 100644
@@ -13,6 +13,7 @@
 #include <linux/wait.h>
 #include <linux/writeback.h>
 #include <linux/slab.h>
+#include <linux/posix_acl.h>
 
 #include <linux/ceph/libceph.h>
 
@@ -745,7 +746,10 @@ extern const struct xattr_handler *ceph_xattr_handlers[];
 struct posix_acl *ceph_get_acl(struct inode *, int);
 int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
 int ceph_acl_chmod(struct dentry *, struct inode *);
-void ceph_forget_all_cached_acls(struct inode *inode);
+static inline void ceph_forget_all_cached_acls(struct inode *inode)
+{
+	forget_all_cached_acls(inode);
+}
 
 #else
 
Applied
#3 lore raw

Re: [PATCH 1/3] ceph: make ceph_forget_all_cached_acls() static inline

Applied.

Quoted 63 lines · Alex Elder
Quoted 1 line · Guangliang Zhao

Looks good. Is there a reason we can't just call forget_all_cached_acls(inode) directly? Or is it just so that we have our own complete private ACL interface? (I have no problem with it, just asking.)

Quoted 36 lines
---
 fs/ceph/acl.c   |    5 -----
 fs/ceph/super.h |    6 +++++-
 2 files changed, 5 insertions(+), 6 deletions(-)
fs/ceph/acl.c +0 -5
index 64fddbc..48af0b3 100644
@@ -54,11 +54,6 @@ static inline struct posix_acl *ceph_get_cached_acl(struct inode *inode,
 	return acl;
 }
 
-void ceph_forget_all_cached_acls(struct inode *inode)
-{
-	forget_all_cached_acls(inode);
-}
-
 struct posix_acl *ceph_get_acl(struct inode *inode, int type)
 {
 	int size;
fs/ceph/super.h +1 -0
index c299f7d..8851dc2 100644
@@ -13,6 +13,7 @@
 #include <linux/wait.h>
 #include <linux/writeback.h>
 #include <linux/slab.h>
+#include <linux/posix_acl.h>
 
 #include <linux/ceph/libceph.h>
 
@@ -745,7 +746,10 @@ extern const struct xattr_handler *ceph_xattr_handlers[];
 struct posix_acl *ceph_get_acl(struct inode *, int);

fs/ceph/super.h extern const struct xattr_handler *ceph_xattr_handlers[]; · line 755

Quoted 10 lines
fs/ceph/super.h +4 -1
 int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
 int ceph_acl_chmod(struct dentry *, struct inode *);
-void ceph_forget_all_cached_acls(struct inode *inode);
+static inline void ceph_forget_all_cached_acls(struct inode *inode)
+{
+	forget_all_cached_acls(inode);
+}
 
 #else
 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 2/3 ceph: add acl, noacl options for cephfs mount

In reply to Guangliang Zhao
---
 fs/ceph/super.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
fs/ceph/super.c +20 -4
index 2df963f..9d65c08 100644
@@ -144,7 +144,9 @@ enum {
 	Opt_ino32,
 	Opt_noino32,
 	Opt_fscache,
-	Opt_nofscache
+	Opt_nofscache,
+	Opt_acl,
+	Opt_noacl
 };
 
 static match_table_t fsopt_tokens = {
@@ -172,6 +174,8 @@ static match_table_t fsopt_tokens = {
 	{Opt_noino32, "noino32"},
 	{Opt_fscache, "fsc"},
 	{Opt_nofscache, "nofsc"},
+	{Opt_acl, "acl"},
+	{Opt_noacl, "noacl"},
 	{-1, NULL}
 };
 
@@ -271,6 +275,12 @@ static int parse_fsopt_token(char *c, void *private)
 	case Opt_nofscache:
 		fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE;
 		break;
+	case Opt_acl:
+		fsopt->sb_flags |= MS_POSIXACL;
+		break;
+	case Opt_noacl:
+		fsopt->sb_flags &= ~MS_POSIXACL;
+		break;
 	default:
 		BUG_ON(token);
 	}
@@ -438,6 +448,11 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	else
 		seq_puts(m, ",nofsc");
 
+	if (fsopt->sb_flags & MS_POSIXACL)
+		seq_puts(m, ",acl");
+	else
+		seq_puts(m, ",noacl");
+
 	if (fsopt->wsize)
 		seq_printf(m, ",wsize=%d", fsopt->wsize);
 	if (fsopt->rsize != CEPH_RSIZE_DEFAULT)
@@ -819,9 +834,6 @@ static int ceph_set_super(struct super_block *s, void *data)
 
 	s->s_flags = fsc->mount_options->sb_flags;
 	s->s_maxbytes = 1ULL << 40;  /* temp value until we get mdsmap */
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	s->s_flags |= MS_POSIXACL;
-#endif
 
 	s->s_xattr = ceph_xattr_handlers;
 	s->s_fs_info = fsc;
@@ -911,6 +923,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
 	struct ceph_options *opt = NULL;
 
 	dout("ceph_mount\n");
+
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+       flags |= MS_POSIXACL;
+#endif
 	err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
 	if (err < 0) {
 		res = ERR_PTR(err);
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 2/3] ceph: add acl, noacl options for cephfs mount

Quoted 1 line · Guangliang Zhao

If CONFIG_CEPH_FS_POSIX_ACL is defined, the default is to have them enabled; if it is not, the default is to have it disabled. But now, whether enabled or not is possible to enable/disable them using a mount option.

Well, it appears that way. However fs/ceph/acl.o is not built unless CONFIG_CEP_FS_POSIX_ACL is enabled. So the mount options will appear to be supported but will be silently ignored.

I don't think you want to require CEPH_FS_POSIX_ACL, because that requires the inclusion of FS_POSIX_ACL which may not be desired.

So you should probably make all the code related to the the acl options (or at least the acl enabled option) be conditional on CEPH_FS_POSIX_ACL, even though I think that won't look all that nice.

I have another question/suggestion for you to consider, below, which is sort of separate from this particular change.

Quoted 29 lines
---
 fs/ceph/super.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
fs/ceph/super.c +5 -1
index 2df963f..9d65c08 100644
@@ -144,7 +144,9 @@ enum {
 	Opt_ino32,
 	Opt_noino32,
 	Opt_fscache,
-	Opt_nofscache
+	Opt_nofscache,
+	Opt_acl,
+	Opt_noacl
 };
 
 static match_table_t fsopt_tokens = {
@@ -172,6 +174,8 @@ static match_table_t fsopt_tokens = {
 	{Opt_noino32, "noino32"},
 	{Opt_fscache, "fsc"},
 	{Opt_nofscache, "nofsc"},
+	{Opt_acl, "acl"},
+	{Opt_noacl, "noacl"},
 	{-1, NULL}
 };
 

fs/ceph/super.c static int parse_fsopt_token(char *c, void *private) · line 282

Quoted 8 lines
fs/ceph/super.c +5 -0
@@ -271,6 +275,12 @@ static int parse_fsopt_token(char *c, void *private)
 	case Opt_nofscache:
 		fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE;
 		break;
+	case Opt_acl:
+		fsopt->sb_flags |= MS_POSIXACL;
+		break;
+	case Opt_noacl:
+		fsopt->sb_flags &= ~MS_POSIXACL;

This hunk would be affected by my suggestion, below.

Quoted 27 lines
fs/ceph/super.c +6 -3
+		break;
 	default:
 		BUG_ON(token);
 	}
@@ -438,6 +448,11 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	else
 		seq_puts(m, ",nofsc");
 
+	if (fsopt->sb_flags & MS_POSIXACL)
+		seq_puts(m, ",acl");
+	else
+		seq_puts(m, ",noacl");
+
 	if (fsopt->wsize)
 		seq_printf(m, ",wsize=%d", fsopt->wsize);
 	if (fsopt->rsize != CEPH_RSIZE_DEFAULT)
@@ -819,9 +834,6 @@ static int ceph_set_super(struct super_block *s, void *data)
 
 	s->s_flags = fsc->mount_options->sb_flags;
 	s->s_maxbytes = 1ULL << 40;  /* temp value until we get mdsmap */
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	s->s_flags |= MS_POSIXACL;
-#endif
 
 	s->s_xattr = ceph_xattr_handlers;
 	s->s_fs_info = fsc;

fs/ceph/super.c static struct dentry *ceph_mount(struct file_system_type *fs_type, · line 928

Quoted 6 lines
fs/ceph/super.c +3 -0
@@ -911,6 +923,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
 	struct ceph_options *opt = NULL;
 
 	dout("ceph_mount\n");
+
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+       flags |= MS_POSIXACL;

(You appear to have spaces here instead of a tab.)

fs/ceph/super.c static struct dentry *ceph_mount(struct file_system_type *fs_type, · line 932

Quoted 5 lines
fs/ceph/super.c +1 -0
+#endif
 	err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
 	if (err < 0) {
 		res = ERR_PTR(err);

OK, here's my question/suggestion. Why are superblock/mount options not treated the same way as the rest? I think there should be a CEPH_MOUNT_OPT_FS_ACL flag added to the set available for ceph_mount_options->flags, and just get rid of the fs_flags field in that structure. Then a new function like ceph_set_super_flags() could be called from ceph_set_super() which would pick out superblock related flags from the ceph_mount_option->flags field and set the appropriate bits in super_block->flags.

-Alex

#6 lore raw

Re: [PATCH 2/3] ceph: add acl, noacl options for cephfs mount

Hi Alex, Guangliang,

Quoted 13 lines · Alex Elder
Quoted 1 line · Guangliang Zhao

If CONFIG_CEPH_FS_POSIX_ACL is defined, the default is to have them enabled; if it is not, the default is to have it disabled. But now, whether enabled or not is possible to enable/disable them using a mount option.

Well, it appears that way. However fs/ceph/acl.o is not built unless CONFIG_CEP_FS_POSIX_ACL is enabled. So the mount options will appear to be supported but will be silently ignored.

Quoted 8 lines

I don't think you want to require CEPH_FS_POSIX_ACL, because that requires the inclusion of FS_POSIX_ACL which may not be desired.

So you should probably make all the code related to the the acl options (or at least the acl enabled option) be conditional on CEPH_FS_POSIX_ACL, even though I think that won't look all that nice.

I've gone ahead and done this. Please see the patch below...

sage

From bc199dc7a5e891fe7d95bf9cd583a9e222a8e1fd Mon Sep 17 00:00:00 2001
From: Sage Weil <[email protected]>
Date: Sun, 16 Feb 2014 10:05:29 -0800
Subject: [PATCH] ceph: add acl, noacl options for cephfs mount

Make the 'acl' option dependent on having ACL support compiled in. Make the 'noacl' option work even without it so that one can always ask it to be off and not error out on mount when it is not supported.

---
 fs/ceph/super.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)
fs/ceph/super.c +28 -4
index 2df963f..10a4ccb 100644
@@ -144,7 +144,11 @@ enum {
 	Opt_ino32,
 	Opt_noino32,
 	Opt_fscache,
-	Opt_nofscache
+	Opt_nofscache,
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	Opt_acl,
+#endif
+	Opt_noacl
 };
 
 static match_table_t fsopt_tokens = {
@@ -172,6 +176,10 @@ static match_table_t fsopt_tokens = {
 	{Opt_noino32, "noino32"},
 	{Opt_fscache, "fsc"},
 	{Opt_nofscache, "nofsc"},
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	{Opt_acl, "acl"},
+#endif
+	{Opt_noacl, "noacl"},
 	{-1, NULL}
 };
 
@@ -271,6 +279,14 @@ static int parse_fsopt_token(char *c, void *private)
 	case Opt_nofscache:
 		fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE;
 		break;
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	case Opt_acl:
+		fsopt->sb_flags |= MS_POSIXACL;
+		break;
+#endif
+	case Opt_noacl:
+		fsopt->sb_flags &= ~MS_POSIXACL;
+		break;
 	default:
 		BUG_ON(token);
 	}
@@ -438,6 +454,13 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	else
 		seq_puts(m, ",nofsc");
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	if (fsopt->sb_flags & MS_POSIXACL)
+		seq_puts(m, ",acl");
+	else
+		seq_puts(m, ",noacl");
+#endif
+
 	if (fsopt->wsize)
 		seq_printf(m, ",wsize=%d", fsopt->wsize);
 	if (fsopt->rsize != CEPH_RSIZE_DEFAULT)
@@ -819,9 +842,6 @@ static int ceph_set_super(struct super_block *s, void *data)
 
 	s->s_flags = fsc->mount_options->sb_flags;
 	s->s_maxbytes = 1ULL << 40;  /* temp value until we get mdsmap */
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	s->s_flags |= MS_POSIXACL;
-#endif
 
 	s->s_xattr = ceph_xattr_handlers;
 	s->s_fs_info = fsc;
@@ -911,6 +931,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
 	struct ceph_options *opt = NULL;
 
 	dout("ceph_mount\n");
+
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	flags |= MS_POSIXACL;
+#endif
 	err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
 	if (err < 0) {
 		res = ERR_PTR(err);
Signature · 1 line
1.8.5.1
#7 lore raw

Re: [PATCH 2/3] ceph: add acl, noacl options for cephfs mount

Quoted 20 lines · Sage Weil

Hi Alex, Guangliang,

Quoted 17 lines · Alex Elder
Quoted 1 line · Guangliang Zhao

If CONFIG_CEPH_FS_POSIX_ACL is defined, the default is to have them enabled; if it is not, the default is to have it disabled. But now, whether enabled or not is possible to enable/disable them using a mount option.

Well, it appears that way. However fs/ceph/acl.o is not built unless CONFIG_CEP_FS_POSIX_ACL is enabled. So the mount options will appear to be supported but will be silently ignored.

I don't think you want to require CEPH_FS_POSIX_ACL, because that requires the inclusion of FS_POSIX_ACL which may not be desired.

Quoted 6 lines
Quoted 4 lines

So you should probably make all the code related to the the acl options (or at least the acl enabled option) be conditional on CEPH_FS_POSIX_ACL, even though I think that won't look all that nice.

I've gone ahead and done this. Please see the patch below...

It looks good to me.

Quoted 99 lines

sage

From bc199dc7a5e891fe7d95bf9cd583a9e222a8e1fd Mon Sep 17 00:00:00 2001
From: Sage Weil <[email protected]>
Date: Sun, 16 Feb 2014 10:05:29 -0800
Subject: [PATCH] ceph: add acl, noacl options for cephfs mount

Make the 'acl' option dependent on having ACL support compiled in. Make the 'noacl' option work even without it so that one can always ask it to be off and not error out on mount when it is not supported.

---
 fs/ceph/super.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)
fs/ceph/super.c +28 -4
index 2df963f..10a4ccb 100644
@@ -144,7 +144,11 @@ enum {
 	Opt_ino32,
 	Opt_noino32,
 	Opt_fscache,
-	Opt_nofscache
+	Opt_nofscache,
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	Opt_acl,
+#endif
+	Opt_noacl
 };
 
 static match_table_t fsopt_tokens = {
@@ -172,6 +176,10 @@ static match_table_t fsopt_tokens = {
 	{Opt_noino32, "noino32"},
 	{Opt_fscache, "fsc"},
 	{Opt_nofscache, "nofsc"},
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	{Opt_acl, "acl"},
+#endif
+	{Opt_noacl, "noacl"},
 	{-1, NULL}
 };
 
@@ -271,6 +279,14 @@ static int parse_fsopt_token(char *c, void *private)
 	case Opt_nofscache:
 		fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE;
 		break;
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	case Opt_acl:
+		fsopt->sb_flags |= MS_POSIXACL;
+		break;
+#endif
+	case Opt_noacl:
+		fsopt->sb_flags &= ~MS_POSIXACL;
+		break;
 	default:
 		BUG_ON(token);
 	}
@@ -438,6 +454,13 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	else
 		seq_puts(m, ",nofsc");
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	if (fsopt->sb_flags & MS_POSIXACL)
+		seq_puts(m, ",acl");
+	else
+		seq_puts(m, ",noacl");
+#endif
+
 	if (fsopt->wsize)
 		seq_printf(m, ",wsize=%d", fsopt->wsize);
 	if (fsopt->rsize != CEPH_RSIZE_DEFAULT)
@@ -819,9 +842,6 @@ static int ceph_set_super(struct super_block *s, void *data)
 
 	s->s_flags = fsc->mount_options->sb_flags;
 	s->s_maxbytes = 1ULL << 40;  /* temp value until we get mdsmap */
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	s->s_flags |= MS_POSIXACL;
-#endif
 
 	s->s_xattr = ceph_xattr_handlers;
 	s->s_fs_info = fsc;
@@ -911,6 +931,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
 	struct ceph_options *opt = NULL;
 
 	dout("ceph_mount\n");
+
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	flags |= MS_POSIXACL;
+#endif
 	err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
 	if (err < 0) {
 		res = ERR_PTR(err);
Signature · 1 line
1.8.5.1
Signature · 2 lines
Best regards,
Guangliang
Reviewed-by
#8 lore raw

Re: [PATCH 2/3] ceph: add acl, noacl options for cephfs mount

In reply to Sage Weil
Quoted 1 line · Sage Weil

Hi Alex, Guangliang,

Looks good to me.

Quoted 121 lines · Alex Elder
Quoted 13 lines · Guangliang Zhao
Quoted 1 line

If CONFIG_CEPH_FS_POSIX_ACL is defined, the default is to have them enabled; if it is not, the default is to have it disabled. But now, whether enabled or not is possible to enable/disable them using a mount option.

Well, it appears that way. However fs/ceph/acl.o is not built unless CONFIG_CEP_FS_POSIX_ACL is enabled. So the mount options will appear to be supported but will be silently ignored.

Quoted 8 lines

I don't think you want to require CEPH_FS_POSIX_ACL, because that requires the inclusion of FS_POSIX_ACL which may not be desired.

So you should probably make all the code related to the the acl options (or at least the acl enabled option) be conditional on CEPH_FS_POSIX_ACL, even though I think that won't look all that nice.

I've gone ahead and done this. Please see the patch below...

sage

From bc199dc7a5e891fe7d95bf9cd583a9e222a8e1fd Mon Sep 17 00:00:00 2001
From: Sage Weil <[email protected]>
Date: Sun, 16 Feb 2014 10:05:29 -0800
Subject: [PATCH] ceph: add acl, noacl options for cephfs mount

Make the 'acl' option dependent on having ACL support compiled in. Make the 'noacl' option work even without it so that one can always ask it to be off and not error out on mount when it is not supported.

---
 fs/ceph/super.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)
fs/ceph/super.c +28 -4
index 2df963f..10a4ccb 100644
@@ -144,7 +144,11 @@ enum {
 	Opt_ino32,
 	Opt_noino32,
 	Opt_fscache,
-	Opt_nofscache
+	Opt_nofscache,
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	Opt_acl,
+#endif
+	Opt_noacl
 };
 
 static match_table_t fsopt_tokens = {
@@ -172,6 +176,10 @@ static match_table_t fsopt_tokens = {
 	{Opt_noino32, "noino32"},
 	{Opt_fscache, "fsc"},
 	{Opt_nofscache, "nofsc"},
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	{Opt_acl, "acl"},
+#endif
+	{Opt_noacl, "noacl"},
 	{-1, NULL}
 };
 
@@ -271,6 +279,14 @@ static int parse_fsopt_token(char *c, void *private)
 	case Opt_nofscache:
 		fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE;
 		break;
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	case Opt_acl:
+		fsopt->sb_flags |= MS_POSIXACL;
+		break;
+#endif
+	case Opt_noacl:
+		fsopt->sb_flags &= ~MS_POSIXACL;
+		break;
 	default:
 		BUG_ON(token);
 	}
@@ -438,6 +454,13 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	else
 		seq_puts(m, ",nofsc");
 
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	if (fsopt->sb_flags & MS_POSIXACL)
+		seq_puts(m, ",acl");
+	else
+		seq_puts(m, ",noacl");
+#endif
+
 	if (fsopt->wsize)
 		seq_printf(m, ",wsize=%d", fsopt->wsize);
 	if (fsopt->rsize != CEPH_RSIZE_DEFAULT)
@@ -819,9 +842,6 @@ static int ceph_set_super(struct super_block *s, void *data)
 
 	s->s_flags = fsc->mount_options->sb_flags;
 	s->s_maxbytes = 1ULL << 40;  /* temp value until we get mdsmap */
-#ifdef CONFIG_CEPH_FS_POSIX_ACL
-	s->s_flags |= MS_POSIXACL;
-#endif
 
 	s->s_xattr = ceph_xattr_handlers;
 	s->s_fs_info = fsc;
@@ -911,6 +931,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
 	struct ceph_options *opt = NULL;
 
 	dout("ceph_mount\n");
+
+#ifdef CONFIG_CEPH_FS_POSIX_ACL
+	flags |= MS_POSIXACL;
+#endif
 	err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
 	if (err < 0) {
 		res = ERR_PTR(err);
#9 lore raw

PATCH 3/3 ceph: make ceph ACL for symlink inheritable

In reply to Guangliang Zhao

Default ACL couldn't be inherited by the symlink in the parent directory. This resolve it.

---
 fs/ceph/dir.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ceph/dir.c +4 -0
index 619616d..2650570 100644
@@ -735,6 +735,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
 	if (!err && !req->r_reply_info.head->is_dentry)
 		err = ceph_handle_notrace_create(dir, dentry);
 	ceph_mdsc_put_request(req);
+
+	if (!err)
+		err = ceph_init_acl(dentry, dentry->d_inode, dir);
+
 	if (err)
 		d_drop(dentry);
 	return err;
Signature · 1 line
1.7.9.5
Reviewed-by on v1 3/3
#10 lore raw

Re: [PATCH 3/3] ceph: make ceph ACL for symlink inheritable

Quoted 2 lines · Guangliang Zhao

Default ACL couldn't be inherited by the symlink in the parent directory. This resolve it.

This looks good to me, and it seems to be consistent with what other file systems do.

Quoted 21 lines
---
 fs/ceph/dir.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ceph/dir.c +4 -0
index 619616d..2650570 100644
@@ -735,6 +735,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
 	if (!err && !req->r_reply_info.head->is_dentry)
 		err = ceph_handle_notrace_create(dir, dentry);
 	ceph_mdsc_put_request(req);
+
+	if (!err)
+		err = ceph_init_acl(dentry, dentry->d_inode, dir);
+
 	if (err)
 		d_drop(dentry);
 	return err;
#11 lore raw

Re: [PATCH 3/3] ceph: make ceph ACL for symlink inheritable

This one is subsumed by Zheng's updated patch.

All of this is now in the testing branch. Assuming all goes well I'll send it to Linus in the next day or two.

Thanks!
sage

Quoted 32 lines · Alex Elder
Quoted 2 lines · Guangliang Zhao

Default ACL couldn't be inherited by the symlink in the parent directory. This resolve it.

This looks good to me, and it seems to be consistent with what other file systems do.

Quoted 21 lines
---
 fs/ceph/dir.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ceph/dir.c +4 -0
index 619616d..2650570 100644
@@ -735,6 +735,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
 	if (!err && !req->r_reply_info.head->is_dentry)
 		err = ceph_handle_notrace_create(dir, dentry);
 	ceph_mdsc_put_request(req);
+
+	if (!err)
+		err = ceph_init_acl(dentry, dentry->d_inode, dir);
+
 	if (err)
 		d_drop(dentry);
 	return err;