You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: fs: take the ACL checks to common code bury posix_acl_..._masq() variants kill boilerplates around posix_acl_create_masq() generic_acl: no need to clone acl just to push it to set_cached_acl() kill boilerplate around posix_acl_chmod_masq() reiserfs: cache negative ACLs for v1 stat format xfs: cache negative ACLs if there is no attribute fork 9p: do no return 0 from ->check_acl without actually checking vfs: move ACL cache lookup into generic code CIFS: Fix oops while mounting with prefixpath xfs: Fix wrong return value of xfs_file_aio_write fix devtmpfs race caam: don't pass bogus S_IFCHR to debugfs_create_...() get rid of create_proc_entry() abuses - proc_mkdir() is there for purpose asus-wmi: ->is_visible() can't return negative fix jffs2 ACLs on big-endian with 16bit mode_t 9p: close ACL leaks ocfs2_init_acl(): fix a leak VFS : mount lock scalability for internal mounts
This commit is contained in:
@@ -52,7 +52,7 @@ ata *);
|
||||
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
||||
void (*truncate) (struct inode *);
|
||||
int (*permission) (struct inode *, int, unsigned int);
|
||||
int (*check_acl)(struct inode *, int);
|
||||
int (*get_acl)(struct inode *, int);
|
||||
int (*setattr) (struct dentry *, struct iattr *);
|
||||
int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
|
||||
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
|
||||
@@ -80,7 +80,7 @@ put_link: no
|
||||
truncate: yes (see below)
|
||||
setattr: yes
|
||||
permission: no (may not block if called in rcu-walk mode)
|
||||
check_acl: no
|
||||
get_acl: no
|
||||
getattr: no
|
||||
setxattr: yes
|
||||
getxattr: no
|
||||
|
||||
@@ -407,10 +407,11 @@ to some pointer to returning that pointer. On errors return ERR_PTR(...).
|
||||
|
||||
--
|
||||
[mandatory]
|
||||
->permission(), generic_permission() and ->check_acl() have lost flags
|
||||
->permission() and generic_permission()have lost flags
|
||||
argument; instead of passing IPERM_FLAG_RCU we add MAY_NOT_BLOCK into mask.
|
||||
generic_permission() has also lost the check_acl argument; if you want
|
||||
non-NULL to be used for that inode, put it into ->i_op->check_acl.
|
||||
generic_permission() has also lost the check_acl argument; ACL checking
|
||||
has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl
|
||||
to read an ACL from disk.
|
||||
|
||||
--
|
||||
[mandatory]
|
||||
|
||||
@@ -356,7 +356,7 @@ struct inode_operations {
|
||||
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
||||
void (*truncate) (struct inode *);
|
||||
int (*permission) (struct inode *, int);
|
||||
int (*check_acl)(struct inode *, int);
|
||||
int (*get_acl)(struct inode *, int);
|
||||
int (*setattr) (struct dentry *, struct iattr *);
|
||||
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
|
||||
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
|
||||
|
||||
@@ -835,7 +835,7 @@ int dma_init(void)
|
||||
|
||||
/* Create /proc/dma/channels and /proc/dma/devices */
|
||||
|
||||
gDmaDir = create_proc_entry("dma", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
|
||||
gDmaDir = proc_mkdir("dma", NULL);
|
||||
|
||||
if (gDmaDir == NULL) {
|
||||
printk(KERN_ERR "Unable to create /proc/dma\n");
|
||||
|
||||
@@ -406,9 +406,10 @@ static int devtmpfsd(void *p)
|
||||
requests = NULL;
|
||||
spin_unlock(&req_lock);
|
||||
while (req) {
|
||||
struct req *next = req->next;
|
||||
req->err = handle(req->name, req->mode, req->dev);
|
||||
complete(&req->done);
|
||||
req = req->next;
|
||||
req = next;
|
||||
}
|
||||
spin_lock(&req_lock);
|
||||
}
|
||||
|
||||
+13
-13
@@ -166,52 +166,52 @@ static int caam_probe(struct platform_device *pdev)
|
||||
/* Controller-level - performance monitor counters */
|
||||
ctrlpriv->ctl_rq_dequeued =
|
||||
debugfs_create_u64("rq_dequeued",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->req_dequeued);
|
||||
ctrlpriv->ctl_ob_enc_req =
|
||||
debugfs_create_u64("ob_rq_encrypted",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ob_enc_req);
|
||||
ctrlpriv->ctl_ib_dec_req =
|
||||
debugfs_create_u64("ib_rq_decrypted",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ib_dec_req);
|
||||
ctrlpriv->ctl_ob_enc_bytes =
|
||||
debugfs_create_u64("ob_bytes_encrypted",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ob_enc_bytes);
|
||||
ctrlpriv->ctl_ob_prot_bytes =
|
||||
debugfs_create_u64("ob_bytes_protected",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ob_prot_bytes);
|
||||
ctrlpriv->ctl_ib_dec_bytes =
|
||||
debugfs_create_u64("ib_bytes_decrypted",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ib_dec_bytes);
|
||||
ctrlpriv->ctl_ib_valid_bytes =
|
||||
debugfs_create_u64("ib_bytes_validated",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->ib_valid_bytes);
|
||||
|
||||
/* Controller level - global status values */
|
||||
ctrlpriv->ctl_faultaddr =
|
||||
debugfs_create_u64("fault_addr",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->faultaddr);
|
||||
ctrlpriv->ctl_faultdetail =
|
||||
debugfs_create_u32("fault_detail",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->faultdetail);
|
||||
ctrlpriv->ctl_faultstatus =
|
||||
debugfs_create_u32("fault_status",
|
||||
S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
S_IRUSR | S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl, &perfmon->status);
|
||||
|
||||
/* Internal covering keys (useful in non-secure mode only) */
|
||||
ctrlpriv->ctl_kek_wrap.data = &ctrlpriv->ctrl->kek[0];
|
||||
ctrlpriv->ctl_kek_wrap.size = KEK_KEY_SIZE * sizeof(u32);
|
||||
ctrlpriv->ctl_kek = debugfs_create_blob("kek",
|
||||
S_IFCHR | S_IRUSR |
|
||||
S_IRUSR |
|
||||
S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl,
|
||||
&ctrlpriv->ctl_kek_wrap);
|
||||
@@ -219,7 +219,7 @@ static int caam_probe(struct platform_device *pdev)
|
||||
ctrlpriv->ctl_tkek_wrap.data = &ctrlpriv->ctrl->tkek[0];
|
||||
ctrlpriv->ctl_tkek_wrap.size = KEK_KEY_SIZE * sizeof(u32);
|
||||
ctrlpriv->ctl_tkek = debugfs_create_blob("tkek",
|
||||
S_IFCHR | S_IRUSR |
|
||||
S_IRUSR |
|
||||
S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl,
|
||||
&ctrlpriv->ctl_tkek_wrap);
|
||||
@@ -227,7 +227,7 @@ static int caam_probe(struct platform_device *pdev)
|
||||
ctrlpriv->ctl_tdsk_wrap.data = &ctrlpriv->ctrl->tdsk[0];
|
||||
ctrlpriv->ctl_tdsk_wrap.size = KEK_KEY_SIZE * sizeof(u32);
|
||||
ctrlpriv->ctl_tdsk = debugfs_create_blob("tdsk",
|
||||
S_IFCHR | S_IRUSR |
|
||||
S_IRUSR |
|
||||
S_IRGRP | S_IROTH,
|
||||
ctrlpriv->ctl,
|
||||
&ctrlpriv->ctl_tdsk_wrap);
|
||||
|
||||
@@ -1192,7 +1192,7 @@ err_unregister_chdev:
|
||||
static void __exit cleanup_mtdchar(void)
|
||||
{
|
||||
unregister_mtd_user(&mtdchar_notifier);
|
||||
mntput(mtd_inode_mnt);
|
||||
kern_unmount(mtd_inode_mnt);
|
||||
unregister_filesystem(&mtd_inodefs_type);
|
||||
__unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd");
|
||||
}
|
||||
|
||||
@@ -857,7 +857,7 @@ static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
|
||||
int err = asus_wmi_get_devstate(asus, dev_id, &value);
|
||||
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0; /* can't return negative here */
|
||||
}
|
||||
|
||||
if (dev_id == ASUS_WMI_DEVID_FAN_CTRL) {
|
||||
|
||||
@@ -307,7 +307,7 @@ static int proc_get_stats_tx(char *page, char **start,
|
||||
void rtl8180_proc_module_init(void)
|
||||
{
|
||||
DMESG("Initializing proc filesystem");
|
||||
rtl8180_proc = create_proc_entry(RTL8180_MODULE_NAME, S_IFDIR, init_net.proc_net);
|
||||
rtl8180_proc = proc_mkdir(RTL8180_MODULE_NAME, init_net.proc_net);
|
||||
}
|
||||
|
||||
void rtl8180_proc_module_remove(void)
|
||||
|
||||
@@ -311,7 +311,7 @@ int __init ieee80211_rtl_init(void)
|
||||
}
|
||||
|
||||
ieee80211_debug_level = debug;
|
||||
ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
|
||||
ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
|
||||
if (ieee80211_proc == NULL) {
|
||||
IEEE80211_ERROR("Unable to create " DRV_NAME
|
||||
" proc directory\n");
|
||||
|
||||
@@ -508,7 +508,7 @@ static int proc_get_stats_rx(char *page, char **start,
|
||||
static void rtl8192_proc_module_init(void)
|
||||
{
|
||||
RT_TRACE(COMP_INIT, "Initializing proc filesystem\n");
|
||||
rtl8192_proc=create_proc_entry(RTL819xE_MODULE_NAME, S_IFDIR, init_net.proc_net);
|
||||
rtl8192_proc = proc_mkdir(RTL819xE_MODULE_NAME, init_net.proc_net);
|
||||
}
|
||||
|
||||
|
||||
@@ -540,9 +540,7 @@ static void rtl8192_proc_init_one(struct r8192_priv *priv)
|
||||
struct net_device *dev = priv->ieee80211->dev;
|
||||
struct proc_dir_entry *e;
|
||||
|
||||
priv->dir_dev = create_proc_entry(dev->name,
|
||||
S_IFDIR | S_IRUGO | S_IXUGO,
|
||||
rtl8192_proc);
|
||||
priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc);
|
||||
if (!priv->dir_dev) {
|
||||
RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
|
||||
dev->name);
|
||||
|
||||
@@ -283,7 +283,7 @@ int __init ieee80211_debug_init(void)
|
||||
|
||||
ieee80211_debug_level = debug;
|
||||
|
||||
ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
|
||||
ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
|
||||
if (ieee80211_proc == NULL) {
|
||||
IEEE80211_ERROR("Unable to create " DRV_NAME
|
||||
" proc directory\n");
|
||||
|
||||
@@ -671,7 +671,7 @@ static int proc_get_stats_rx(char *page, char **start,
|
||||
void rtl8192_proc_module_init(void)
|
||||
{
|
||||
RT_TRACE(COMP_INIT, "Initializing proc filesystem");
|
||||
rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net);
|
||||
rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net);
|
||||
}
|
||||
|
||||
|
||||
@@ -706,9 +706,7 @@ void rtl8192_proc_init_one(struct net_device *dev)
|
||||
{
|
||||
struct proc_dir_entry *e;
|
||||
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
|
||||
priv->dir_dev = create_proc_entry(dev->name,
|
||||
S_IFDIR | S_IRUGO | S_IXUGO,
|
||||
rtl8192_proc);
|
||||
priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc);
|
||||
if (!priv->dir_dev) {
|
||||
RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
|
||||
dev->name);
|
||||
|
||||
+23
-45
@@ -96,14 +96,11 @@ static struct posix_acl *v9fs_get_cached_acl(struct inode *inode, int type)
|
||||
return acl;
|
||||
}
|
||||
|
||||
int v9fs_check_acl(struct inode *inode, int mask)
|
||||
struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type)
|
||||
{
|
||||
struct posix_acl *acl;
|
||||
struct v9fs_session_info *v9ses;
|
||||
|
||||
if (mask & MAY_NOT_BLOCK)
|
||||
return -ECHILD;
|
||||
|
||||
v9ses = v9fs_inode2v9ses(inode);
|
||||
if (((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) ||
|
||||
((v9ses->flags & V9FS_ACL_MASK) != V9FS_POSIX_ACL)) {
|
||||
@@ -111,18 +108,10 @@ int v9fs_check_acl(struct inode *inode, int mask)
|
||||
* On access = client and acl = on mode get the acl
|
||||
* values from the server
|
||||
*/
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
|
||||
return v9fs_get_cached_acl(inode, type);
|
||||
|
||||
if (IS_ERR(acl))
|
||||
return PTR_ERR(acl);
|
||||
if (acl) {
|
||||
int error = posix_acl_permission(inode, acl, mask);
|
||||
posix_acl_release(acl);
|
||||
return error;
|
||||
}
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl)
|
||||
@@ -165,32 +154,32 @@ err_free_out:
|
||||
int v9fs_acl_chmod(struct dentry *dentry)
|
||||
{
|
||||
int retval = 0;
|
||||
struct posix_acl *acl, *clone;
|
||||
struct posix_acl *acl;
|
||||
struct inode *inode = dentry->d_inode;
|
||||
|
||||
if (S_ISLNK(inode->i_mode))
|
||||
return -EOPNOTSUPP;
|
||||
acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
|
||||
if (acl) {
|
||||
clone = posix_acl_clone(acl, GFP_KERNEL);
|
||||
retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
|
||||
if (retval)
|
||||
return retval;
|
||||
retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, acl);
|
||||
posix_acl_release(acl);
|
||||
if (!clone)
|
||||
return -ENOMEM;
|
||||
retval = posix_acl_chmod_masq(clone, inode->i_mode);
|
||||
if (!retval)
|
||||
retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, clone);
|
||||
posix_acl_release(clone);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int v9fs_set_create_acl(struct dentry *dentry,
|
||||
struct posix_acl *dpacl, struct posix_acl *pacl)
|
||||
struct posix_acl **dpacl, struct posix_acl **pacl)
|
||||
{
|
||||
v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl);
|
||||
v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl);
|
||||
posix_acl_release(dpacl);
|
||||
posix_acl_release(pacl);
|
||||
if (dentry) {
|
||||
v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, *dpacl);
|
||||
v9fs_set_acl(dentry, ACL_TYPE_ACCESS, *pacl);
|
||||
}
|
||||
posix_acl_release(*dpacl);
|
||||
posix_acl_release(*pacl);
|
||||
*dpacl = *pacl = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -209,29 +198,18 @@ int v9fs_acl_mode(struct inode *dir, mode_t *modep,
|
||||
mode &= ~current_umask();
|
||||
}
|
||||
if (acl) {
|
||||
struct posix_acl *clone;
|
||||
|
||||
if (S_ISDIR(mode))
|
||||
*dpacl = acl;
|
||||
clone = posix_acl_clone(acl, GFP_NOFS);
|
||||
retval = -ENOMEM;
|
||||
if (!clone)
|
||||
goto cleanup;
|
||||
|
||||
retval = posix_acl_create_masq(clone, &mode);
|
||||
if (retval < 0) {
|
||||
posix_acl_release(clone);
|
||||
goto cleanup;
|
||||
}
|
||||
*dpacl = posix_acl_dup(acl);
|
||||
retval = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
if (retval < 0)
|
||||
return retval;
|
||||
if (retval > 0)
|
||||
*pacl = clone;
|
||||
*pacl = acl;
|
||||
else
|
||||
posix_acl_release(acl);
|
||||
}
|
||||
*modep = mode;
|
||||
return 0;
|
||||
cleanup:
|
||||
posix_acl_release(acl);
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
static int v9fs_remote_get_acl(struct dentry *dentry, const char *name,
|
||||
|
||||
+5
-5
@@ -16,14 +16,14 @@
|
||||
|
||||
#ifdef CONFIG_9P_FS_POSIX_ACL
|
||||
extern int v9fs_get_acl(struct inode *, struct p9_fid *);
|
||||
extern int v9fs_check_acl(struct inode *inode, int mask);
|
||||
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
|
||||
extern int v9fs_acl_chmod(struct dentry *);
|
||||
extern int v9fs_set_create_acl(struct dentry *,
|
||||
struct posix_acl *, struct posix_acl *);
|
||||
struct posix_acl **, struct posix_acl **);
|
||||
extern int v9fs_acl_mode(struct inode *dir, mode_t *modep,
|
||||
struct posix_acl **dpacl, struct posix_acl **pacl);
|
||||
#else
|
||||
#define v9fs_check_acl NULL
|
||||
#define v9fs_iop_get_acl NULL
|
||||
static inline int v9fs_get_acl(struct inode *inode, struct p9_fid *fid)
|
||||
{
|
||||
return 0;
|
||||
@@ -33,8 +33,8 @@ static inline int v9fs_acl_chmod(struct dentry *dentry)
|
||||
return 0;
|
||||
}
|
||||
static inline int v9fs_set_create_acl(struct dentry *dentry,
|
||||
struct posix_acl *dpacl,
|
||||
struct posix_acl *pacl)
|
||||
struct posix_acl **dpacl,
|
||||
struct posix_acl **pacl)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
|
||||
goto error;
|
||||
|
||||
/* Now set the ACL based on the default value */
|
||||
v9fs_set_create_acl(dentry, dacl, pacl);
|
||||
v9fs_set_create_acl(dentry, &dacl, &pacl);
|
||||
|
||||
v9inode = V9FS_I(inode);
|
||||
mutex_lock(&v9inode->v_mutex);
|
||||
@@ -328,6 +328,7 @@ error:
|
||||
err_clunk_old_fid:
|
||||
if (ofid)
|
||||
p9_client_clunk(ofid);
|
||||
v9fs_set_create_acl(NULL, &dacl, &pacl);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -421,12 +422,13 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
|
||||
d_instantiate(dentry, inode);
|
||||
}
|
||||
/* Now set the ACL based on the default value */
|
||||
v9fs_set_create_acl(dentry, dacl, pacl);
|
||||
v9fs_set_create_acl(dentry, &dacl, &pacl);
|
||||
inc_nlink(dir);
|
||||
v9fs_invalidate_inode_attr(dir);
|
||||
error:
|
||||
if (fid)
|
||||
p9_client_clunk(fid);
|
||||
v9fs_set_create_acl(NULL, &dacl, &pacl);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -826,10 +828,11 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
|
||||
d_instantiate(dentry, inode);
|
||||
}
|
||||
/* Now set the ACL based on the default value */
|
||||
v9fs_set_create_acl(dentry, dacl, pacl);
|
||||
v9fs_set_create_acl(dentry, &dacl, &pacl);
|
||||
error:
|
||||
if (fid)
|
||||
p9_client_clunk(fid);
|
||||
v9fs_set_create_acl(NULL, &dacl, &pacl);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -914,7 +917,7 @@ const struct inode_operations v9fs_dir_inode_operations_dotl = {
|
||||
.getxattr = generic_getxattr,
|
||||
.removexattr = generic_removexattr,
|
||||
.listxattr = v9fs_listxattr,
|
||||
.check_acl = v9fs_check_acl,
|
||||
.get_acl = v9fs_iop_get_acl,
|
||||
};
|
||||
|
||||
const struct inode_operations v9fs_file_inode_operations_dotl = {
|
||||
@@ -924,7 +927,7 @@ const struct inode_operations v9fs_file_inode_operations_dotl = {
|
||||
.getxattr = generic_getxattr,
|
||||
.removexattr = generic_removexattr,
|
||||
.listxattr = v9fs_listxattr,
|
||||
.check_acl = v9fs_check_acl,
|
||||
.get_acl = v9fs_iop_get_acl,
|
||||
};
|
||||
|
||||
const struct inode_operations v9fs_symlink_inode_operations_dotl = {
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ static int __init anon_inode_init(void)
|
||||
return 0;
|
||||
|
||||
err_mntput:
|
||||
mntput(anon_inode_mnt);
|
||||
kern_unmount(anon_inode_mnt);
|
||||
err_unregister_filesystem:
|
||||
unregister_filesystem(&anon_inode_fs_type);
|
||||
err_exit:
|
||||
|
||||
+14
-49
@@ -30,7 +30,7 @@
|
||||
|
||||
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
|
||||
|
||||
static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
|
||||
struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
|
||||
{
|
||||
int size;
|
||||
const char *name;
|
||||
@@ -195,27 +195,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int btrfs_check_acl(struct inode *inode, int mask)
|
||||
{
|
||||
int error = -EAGAIN;
|
||||
|
||||
if (mask & MAY_NOT_BLOCK) {
|
||||
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
|
||||
error = -ECHILD;
|
||||
} else {
|
||||
struct posix_acl *acl;
|
||||
acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS);
|
||||
if (IS_ERR(acl))
|
||||
return PTR_ERR(acl);
|
||||
if (acl) {
|
||||
error = posix_acl_permission(inode, acl, mask);
|
||||
posix_acl_release(acl);
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
* btrfs_init_acl is already generally called under fs_mutex, so the locking
|
||||
* stuff has been fixed to work with that. If the locking stuff changes, we
|
||||
@@ -243,8 +222,7 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans,
|
||||
}
|
||||
|
||||
if (IS_POSIXACL(dir) && acl) {
|
||||
struct posix_acl *clone;
|
||||
mode_t mode;
|
||||
mode_t mode = inode->i_mode;
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
ret = btrfs_set_acl(trans, inode, acl,
|
||||
@@ -252,22 +230,15 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans,
|
||||
if (ret)
|
||||
goto failed;
|
||||
}
|
||||
clone = posix_acl_clone(acl, GFP_NOFS);
|
||||
ret = -ENOMEM;
|
||||
if (!clone)
|
||||
goto failed;
|
||||
ret = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mode = inode->i_mode;
|
||||
ret = posix_acl_create_masq(clone, &mode);
|
||||
if (ret >= 0) {
|
||||
inode->i_mode = mode;
|
||||
if (ret > 0) {
|
||||
/* we need an acl */
|
||||
ret = btrfs_set_acl(trans, inode, clone,
|
||||
ACL_TYPE_ACCESS);
|
||||
}
|
||||
inode->i_mode = mode;
|
||||
if (ret > 0) {
|
||||
/* we need an acl */
|
||||
ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS);
|
||||
}
|
||||
posix_acl_release(clone);
|
||||
}
|
||||
failed:
|
||||
posix_acl_release(acl);
|
||||
@@ -277,7 +248,7 @@ failed:
|
||||
|
||||
int btrfs_acl_chmod(struct inode *inode)
|
||||
{
|
||||
struct posix_acl *acl, *clone;
|
||||
struct posix_acl *acl;
|
||||
int ret = 0;
|
||||
|
||||
if (S_ISLNK(inode->i_mode))
|
||||
@@ -290,17 +261,11 @@ int btrfs_acl_chmod(struct inode *inode)
|
||||
if (IS_ERR_OR_NULL(acl))
|
||||
return PTR_ERR(acl);
|
||||
|
||||
clone = posix_acl_clone(acl, GFP_KERNEL);
|
||||
ret = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = btrfs_set_acl(NULL, inode, acl, ACL_TYPE_ACCESS);
|
||||
posix_acl_release(acl);
|
||||
if (!clone)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = posix_acl_chmod_masq(clone, inode->i_mode);
|
||||
if (!ret)
|
||||
ret = btrfs_set_acl(NULL, inode, clone, ACL_TYPE_ACCESS);
|
||||
|
||||
posix_acl_release(clone);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2645,9 +2645,9 @@ do { \
|
||||
|
||||
/* acl.c */
|
||||
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
|
||||
int btrfs_check_acl(struct inode *inode, int mask);
|
||||
struct posix_acl *btrfs_get_acl(struct inode *inode, int type);
|
||||
#else
|
||||
#define btrfs_check_acl NULL
|
||||
#define btrfs_get_acl NULL
|
||||
#endif
|
||||
int btrfs_init_acl(struct btrfs_trans_handle *trans,
|
||||
struct inode *inode, struct inode *dir);
|
||||
|
||||
+5
-5
@@ -7351,12 +7351,12 @@ static const struct inode_operations btrfs_dir_inode_operations = {
|
||||
.listxattr = btrfs_listxattr,
|
||||
.removexattr = btrfs_removexattr,
|
||||
.permission = btrfs_permission,
|
||||
.check_acl = btrfs_check_acl,
|
||||
.get_acl = btrfs_get_acl,
|
||||
};
|
||||
static const struct inode_operations btrfs_dir_ro_inode_operations = {
|
||||
.lookup = btrfs_lookup,
|
||||
.permission = btrfs_permission,
|
||||
.check_acl = btrfs_check_acl,
|
||||
.get_acl = btrfs_get_acl,
|
||||
};
|
||||
|
||||
static const struct file_operations btrfs_dir_file_operations = {
|
||||
@@ -7425,7 +7425,7 @@ static const struct inode_operations btrfs_file_inode_operations = {
|
||||
.removexattr = btrfs_removexattr,
|
||||
.permission = btrfs_permission,
|
||||
.fiemap = btrfs_fiemap,
|
||||
.check_acl = btrfs_check_acl,
|
||||
.get_acl = btrfs_get_acl,
|
||||
};
|
||||
static const struct inode_operations btrfs_special_inode_operations = {
|
||||
.getattr = btrfs_getattr,
|
||||
@@ -7435,7 +7435,7 @@ static const struct inode_operations btrfs_special_inode_operations = {
|
||||
.getxattr = btrfs_getxattr,
|
||||
.listxattr = btrfs_listxattr,
|
||||
.removexattr = btrfs_removexattr,
|
||||
.check_acl = btrfs_check_acl,
|
||||
.get_acl = btrfs_get_acl,
|
||||
};
|
||||
static const struct inode_operations btrfs_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
@@ -7447,7 +7447,7 @@ static const struct inode_operations btrfs_symlink_inode_operations = {
|
||||
.getxattr = btrfs_getxattr,
|
||||
.listxattr = btrfs_listxattr,
|
||||
.removexattr = btrfs_removexattr,
|
||||
.check_acl = btrfs_check_acl,
|
||||
.get_acl = btrfs_get_acl,
|
||||
};
|
||||
|
||||
const struct dentry_operations btrfs_dentry_operations = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user