ceph: fix posix ACL hooks
The merge of commit7221fe4c2e
("ceph: add acl for cephfs") raced with upstream changes in the generic POSIX ACL code (eg commit2aeccbe957
"fs: add generic xattr_acl handlers" and others). Some of the fallout was fixed in commit4db658ea0c
("ceph: Fix up after semantic merge conflict"), but it was incomplete: the set_acl inode_operation wasn't getting set, and the prototype needed to be adjusted a bit (it doesn't take a dentry anymore). Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Родитель
0e47c969c6
Коммит
72466d0b92
|
@ -107,14 +107,14 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type)
|
||||||
return acl;
|
return acl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ceph_set_acl(struct dentry *dentry, struct inode *inode,
|
int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
|
||||||
struct posix_acl *acl, int type)
|
|
||||||
{
|
{
|
||||||
int ret = 0, size = 0;
|
int ret = 0, size = 0;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
char *value = NULL;
|
char *value = NULL;
|
||||||
struct iattr newattrs;
|
struct iattr newattrs;
|
||||||
umode_t new_mode = inode->i_mode, old_mode = inode->i_mode;
|
umode_t new_mode = inode->i_mode, old_mode = inode->i_mode;
|
||||||
|
struct dentry *dentry = d_find_alias(inode);
|
||||||
|
|
||||||
if (acl) {
|
if (acl) {
|
||||||
ret = posix_acl_valid(acl);
|
ret = posix_acl_valid(acl);
|
||||||
|
@ -208,8 +208,7 @@ int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir)
|
||||||
|
|
||||||
if (IS_POSIXACL(dir) && acl) {
|
if (IS_POSIXACL(dir) && acl) {
|
||||||
if (S_ISDIR(inode->i_mode)) {
|
if (S_ISDIR(inode->i_mode)) {
|
||||||
ret = ceph_set_acl(dentry, inode, acl,
|
ret = ceph_set_acl(inode, acl, ACL_TYPE_DEFAULT);
|
||||||
ACL_TYPE_DEFAULT);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_release;
|
goto out_release;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +216,7 @@ int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
else if (ret > 0)
|
else if (ret > 0)
|
||||||
ret = ceph_set_acl(dentry, inode, acl, ACL_TYPE_ACCESS);
|
ret = ceph_set_acl(inode, acl, ACL_TYPE_ACCESS);
|
||||||
else
|
else
|
||||||
cache_no_acl(inode);
|
cache_no_acl(inode);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1303,6 +1303,7 @@ const struct inode_operations ceph_dir_iops = {
|
||||||
.listxattr = ceph_listxattr,
|
.listxattr = ceph_listxattr,
|
||||||
.removexattr = ceph_removexattr,
|
.removexattr = ceph_removexattr,
|
||||||
.get_acl = ceph_get_acl,
|
.get_acl = ceph_get_acl,
|
||||||
|
.set_acl = ceph_set_acl,
|
||||||
.mknod = ceph_mknod,
|
.mknod = ceph_mknod,
|
||||||
.symlink = ceph_symlink,
|
.symlink = ceph_symlink,
|
||||||
.mkdir = ceph_mkdir,
|
.mkdir = ceph_mkdir,
|
||||||
|
|
|
@ -97,6 +97,7 @@ const struct inode_operations ceph_file_iops = {
|
||||||
.listxattr = ceph_listxattr,
|
.listxattr = ceph_listxattr,
|
||||||
.removexattr = ceph_removexattr,
|
.removexattr = ceph_removexattr,
|
||||||
.get_acl = ceph_get_acl,
|
.get_acl = ceph_get_acl,
|
||||||
|
.set_acl = ceph_set_acl,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1616,6 +1617,7 @@ static const struct inode_operations ceph_symlink_iops = {
|
||||||
.listxattr = ceph_listxattr,
|
.listxattr = ceph_listxattr,
|
||||||
.removexattr = ceph_removexattr,
|
.removexattr = ceph_removexattr,
|
||||||
.get_acl = ceph_get_acl,
|
.get_acl = ceph_get_acl,
|
||||||
|
.set_acl = ceph_set_acl,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -718,6 +718,7 @@ extern void ceph_queue_writeback(struct inode *inode);
|
||||||
extern int ceph_do_getattr(struct inode *inode, int mask);
|
extern int ceph_do_getattr(struct inode *inode, int mask);
|
||||||
extern int ceph_permission(struct inode *inode, int mask);
|
extern int ceph_permission(struct inode *inode, int mask);
|
||||||
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
|
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
|
||||||
|
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
|
||||||
extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||||
struct kstat *stat);
|
struct kstat *stat);
|
||||||
|
|
||||||
|
@ -741,12 +742,14 @@ extern const struct xattr_handler *ceph_xattr_handlers[];
|
||||||
#ifdef CONFIG_CEPH_FS_POSIX_ACL
|
#ifdef CONFIG_CEPH_FS_POSIX_ACL
|
||||||
|
|
||||||
struct posix_acl *ceph_get_acl(struct inode *, int);
|
struct posix_acl *ceph_get_acl(struct inode *, int);
|
||||||
|
int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type);
|
||||||
int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
|
int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
|
||||||
void ceph_forget_all_cached_acls(struct inode *inode);
|
void ceph_forget_all_cached_acls(struct inode *inode);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define ceph_get_acl NULL
|
#define ceph_get_acl NULL
|
||||||
|
#define ceph_set_acl NULL
|
||||||
|
|
||||||
static inline int ceph_init_acl(struct dentry *dentry, struct inode *inode,
|
static inline int ceph_init_acl(struct dentry *dentry, struct inode *inode,
|
||||||
struct inode *dir)
|
struct inode *dir)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче