Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+476 -794
+2 -2
Documentation/filesystems/Locking
··· 52 52 void (*put_link) (struct dentry *, struct nameidata *, void *); 53 53 void (*truncate) (struct inode *); 54 54 int (*permission) (struct inode *, int, unsigned int); 55 - int (*check_acl)(struct inode *, int); 55 + int (*get_acl)(struct inode *, int); 56 56 int (*setattr) (struct dentry *, struct iattr *); 57 57 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *); 58 58 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); ··· 80 80 truncate: yes (see below) 81 81 setattr: yes 82 82 permission: no (may not block if called in rcu-walk mode) 83 - check_acl: no 83 + get_acl: no 84 84 getattr: no 85 85 setxattr: yes 86 86 getxattr: no
+4 -3
Documentation/filesystems/porting
··· 407 407 408 408 -- 409 409 [mandatory] 410 - ->permission(), generic_permission() and ->check_acl() have lost flags 410 + ->permission() and generic_permission()have lost flags 411 411 argument; instead of passing IPERM_FLAG_RCU we add MAY_NOT_BLOCK into mask. 412 - generic_permission() has also lost the check_acl argument; if you want 413 - non-NULL to be used for that inode, put it into ->i_op->check_acl. 412 + generic_permission() has also lost the check_acl argument; ACL checking 413 + has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl 414 + to read an ACL from disk. 414 415 415 416 -- 416 417 [mandatory]
+1 -1
Documentation/filesystems/vfs.txt
··· 356 356 void (*put_link) (struct dentry *, struct nameidata *, void *); 357 357 void (*truncate) (struct inode *); 358 358 int (*permission) (struct inode *, int); 359 - int (*check_acl)(struct inode *, int); 359 + int (*get_acl)(struct inode *, int); 360 360 int (*setattr) (struct dentry *, struct iattr *); 361 361 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); 362 362 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
+1 -1
arch/arm/mach-bcmring/dma.c
··· 835 835 836 836 /* Create /proc/dma/channels and /proc/dma/devices */ 837 837 838 - gDmaDir = create_proc_entry("dma", S_IFDIR | S_IRUGO | S_IXUGO, NULL); 838 + gDmaDir = proc_mkdir("dma", NULL); 839 839 840 840 if (gDmaDir == NULL) { 841 841 printk(KERN_ERR "Unable to create /proc/dma\n");
+2 -1
drivers/base/devtmpfs.c
··· 406 406 requests = NULL; 407 407 spin_unlock(&req_lock); 408 408 while (req) { 409 + struct req *next = req->next; 409 410 req->err = handle(req->name, req->mode, req->dev); 410 411 complete(&req->done); 411 - req = req->next; 412 + req = next; 412 413 } 413 414 spin_lock(&req_lock); 414 415 }
+13 -13
drivers/crypto/caam/ctrl.c
··· 166 166 /* Controller-level - performance monitor counters */ 167 167 ctrlpriv->ctl_rq_dequeued = 168 168 debugfs_create_u64("rq_dequeued", 169 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 169 + S_IRUSR | S_IRGRP | S_IROTH, 170 170 ctrlpriv->ctl, &perfmon->req_dequeued); 171 171 ctrlpriv->ctl_ob_enc_req = 172 172 debugfs_create_u64("ob_rq_encrypted", 173 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 173 + S_IRUSR | S_IRGRP | S_IROTH, 174 174 ctrlpriv->ctl, &perfmon->ob_enc_req); 175 175 ctrlpriv->ctl_ib_dec_req = 176 176 debugfs_create_u64("ib_rq_decrypted", 177 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 177 + S_IRUSR | S_IRGRP | S_IROTH, 178 178 ctrlpriv->ctl, &perfmon->ib_dec_req); 179 179 ctrlpriv->ctl_ob_enc_bytes = 180 180 debugfs_create_u64("ob_bytes_encrypted", 181 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 181 + S_IRUSR | S_IRGRP | S_IROTH, 182 182 ctrlpriv->ctl, &perfmon->ob_enc_bytes); 183 183 ctrlpriv->ctl_ob_prot_bytes = 184 184 debugfs_create_u64("ob_bytes_protected", 185 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 185 + S_IRUSR | S_IRGRP | S_IROTH, 186 186 ctrlpriv->ctl, &perfmon->ob_prot_bytes); 187 187 ctrlpriv->ctl_ib_dec_bytes = 188 188 debugfs_create_u64("ib_bytes_decrypted", 189 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 189 + S_IRUSR | S_IRGRP | S_IROTH, 190 190 ctrlpriv->ctl, &perfmon->ib_dec_bytes); 191 191 ctrlpriv->ctl_ib_valid_bytes = 192 192 debugfs_create_u64("ib_bytes_validated", 193 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 193 + S_IRUSR | S_IRGRP | S_IROTH, 194 194 ctrlpriv->ctl, &perfmon->ib_valid_bytes); 195 195 196 196 /* Controller level - global status values */ 197 197 ctrlpriv->ctl_faultaddr = 198 198 debugfs_create_u64("fault_addr", 199 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 199 + S_IRUSR | S_IRGRP | S_IROTH, 200 200 ctrlpriv->ctl, &perfmon->faultaddr); 201 201 ctrlpriv->ctl_faultdetail = 202 202 debugfs_create_u32("fault_detail", 203 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 203 + S_IRUSR | S_IRGRP | S_IROTH, 204 204 ctrlpriv->ctl, &perfmon->faultdetail); 205 205 ctrlpriv->ctl_faultstatus = 206 206 debugfs_create_u32("fault_status", 207 - S_IFCHR | S_IRUSR | S_IRGRP | S_IROTH, 207 + S_IRUSR | S_IRGRP | S_IROTH, 208 208 ctrlpriv->ctl, &perfmon->status); 209 209 210 210 /* Internal covering keys (useful in non-secure mode only) */ 211 211 ctrlpriv->ctl_kek_wrap.data = &ctrlpriv->ctrl->kek[0]; 212 212 ctrlpriv->ctl_kek_wrap.size = KEK_KEY_SIZE * sizeof(u32); 213 213 ctrlpriv->ctl_kek = debugfs_create_blob("kek", 214 - S_IFCHR | S_IRUSR | 214 + S_IRUSR | 215 215 S_IRGRP | S_IROTH, 216 216 ctrlpriv->ctl, 217 217 &ctrlpriv->ctl_kek_wrap); ··· 219 219 ctrlpriv->ctl_tkek_wrap.data = &ctrlpriv->ctrl->tkek[0]; 220 220 ctrlpriv->ctl_tkek_wrap.size = KEK_KEY_SIZE * sizeof(u32); 221 221 ctrlpriv->ctl_tkek = debugfs_create_blob("tkek", 222 - S_IFCHR | S_IRUSR | 222 + S_IRUSR | 223 223 S_IRGRP | S_IROTH, 224 224 ctrlpriv->ctl, 225 225 &ctrlpriv->ctl_tkek_wrap); ··· 227 227 ctrlpriv->ctl_tdsk_wrap.data = &ctrlpriv->ctrl->tdsk[0]; 228 228 ctrlpriv->ctl_tdsk_wrap.size = KEK_KEY_SIZE * sizeof(u32); 229 229 ctrlpriv->ctl_tdsk = debugfs_create_blob("tdsk", 230 - S_IFCHR | S_IRUSR | 230 + S_IRUSR | 231 231 S_IRGRP | S_IROTH, 232 232 ctrlpriv->ctl, 233 233 &ctrlpriv->ctl_tdsk_wrap);
+1 -1
drivers/mtd/mtdchar.c
··· 1192 1192 static void __exit cleanup_mtdchar(void) 1193 1193 { 1194 1194 unregister_mtd_user(&mtdchar_notifier); 1195 - mntput(mtd_inode_mnt); 1195 + kern_unmount(mtd_inode_mnt); 1196 1196 unregister_filesystem(&mtd_inodefs_type); 1197 1197 __unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd"); 1198 1198 }
+1 -1
drivers/platform/x86/asus-wmi.c
··· 857 857 int err = asus_wmi_get_devstate(asus, dev_id, &value); 858 858 859 859 if (err < 0) 860 - return err; 860 + return 0; /* can't return negative here */ 861 861 } 862 862 863 863 if (dev_id == ASUS_WMI_DEVID_FAN_CTRL) {
+1 -1
drivers/staging/rtl8187se/r8180_core.c
··· 307 307 void rtl8180_proc_module_init(void) 308 308 { 309 309 DMESG("Initializing proc filesystem"); 310 - rtl8180_proc = create_proc_entry(RTL8180_MODULE_NAME, S_IFDIR, init_net.proc_net); 310 + rtl8180_proc = proc_mkdir(RTL8180_MODULE_NAME, init_net.proc_net); 311 311 } 312 312 313 313 void rtl8180_proc_module_remove(void)
+1 -1
drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
··· 311 311 } 312 312 313 313 ieee80211_debug_level = debug; 314 - ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net); 314 + ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net); 315 315 if (ieee80211_proc == NULL) { 316 316 IEEE80211_ERROR("Unable to create " DRV_NAME 317 317 " proc directory\n");
+2 -4
drivers/staging/rtl8192e/r8192E_core.c
··· 508 508 static void rtl8192_proc_module_init(void) 509 509 { 510 510 RT_TRACE(COMP_INIT, "Initializing proc filesystem\n"); 511 - rtl8192_proc=create_proc_entry(RTL819xE_MODULE_NAME, S_IFDIR, init_net.proc_net); 511 + rtl8192_proc = proc_mkdir(RTL819xE_MODULE_NAME, init_net.proc_net); 512 512 } 513 513 514 514 ··· 540 540 struct net_device *dev = priv->ieee80211->dev; 541 541 struct proc_dir_entry *e; 542 542 543 - priv->dir_dev = create_proc_entry(dev->name, 544 - S_IFDIR | S_IRUGO | S_IXUGO, 545 - rtl8192_proc); 543 + priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc); 546 544 if (!priv->dir_dev) { 547 545 RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", 548 546 dev->name);
+1 -1
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
··· 283 283 284 284 ieee80211_debug_level = debug; 285 285 286 - ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net); 286 + ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net); 287 287 if (ieee80211_proc == NULL) { 288 288 IEEE80211_ERROR("Unable to create " DRV_NAME 289 289 " proc directory\n");
+2 -4
drivers/staging/rtl8192u/r8192U_core.c
··· 671 671 void rtl8192_proc_module_init(void) 672 672 { 673 673 RT_TRACE(COMP_INIT, "Initializing proc filesystem"); 674 - rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net); 674 + rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net); 675 675 } 676 676 677 677 ··· 706 706 { 707 707 struct proc_dir_entry *e; 708 708 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 709 - priv->dir_dev = create_proc_entry(dev->name, 710 - S_IFDIR | S_IRUGO | S_IXUGO, 711 - rtl8192_proc); 709 + priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc); 712 710 if (!priv->dir_dev) { 713 711 RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", 714 712 dev->name);
+23 -45
fs/9p/acl.c
··· 96 96 return acl; 97 97 } 98 98 99 - int v9fs_check_acl(struct inode *inode, int mask) 99 + struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type) 100 100 { 101 101 struct posix_acl *acl; 102 102 struct v9fs_session_info *v9ses; 103 - 104 - if (mask & MAY_NOT_BLOCK) 105 - return -ECHILD; 106 103 107 104 v9ses = v9fs_inode2v9ses(inode); 108 105 if (((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) || ··· 108 111 * On access = client and acl = on mode get the acl 109 112 * values from the server 110 113 */ 111 - return 0; 114 + return NULL; 112 115 } 113 - acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS); 116 + return v9fs_get_cached_acl(inode, type); 114 117 115 - if (IS_ERR(acl)) 116 - return PTR_ERR(acl); 117 - if (acl) { 118 - int error = posix_acl_permission(inode, acl, mask); 119 - posix_acl_release(acl); 120 - return error; 121 - } 122 - return -EAGAIN; 123 118 } 124 119 125 120 static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl) ··· 154 165 int v9fs_acl_chmod(struct dentry *dentry) 155 166 { 156 167 int retval = 0; 157 - struct posix_acl *acl, *clone; 168 + struct posix_acl *acl; 158 169 struct inode *inode = dentry->d_inode; 159 170 160 171 if (S_ISLNK(inode->i_mode)) 161 172 return -EOPNOTSUPP; 162 173 acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS); 163 174 if (acl) { 164 - clone = posix_acl_clone(acl, GFP_KERNEL); 175 + retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 176 + if (retval) 177 + return retval; 178 + retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, acl); 165 179 posix_acl_release(acl); 166 - if (!clone) 167 - return -ENOMEM; 168 - retval = posix_acl_chmod_masq(clone, inode->i_mode); 169 - if (!retval) 170 - retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, clone); 171 - posix_acl_release(clone); 172 180 } 173 181 return retval; 174 182 } 175 183 176 184 int v9fs_set_create_acl(struct dentry *dentry, 177 - struct posix_acl *dpacl, struct posix_acl *pacl) 185 + struct posix_acl **dpacl, struct posix_acl **pacl) 178 186 { 179 - v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl); 180 - v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl); 181 - posix_acl_release(dpacl); 182 - posix_acl_release(pacl); 187 + if (dentry) { 188 + v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, *dpacl); 189 + v9fs_set_acl(dentry, ACL_TYPE_ACCESS, *pacl); 190 + } 191 + posix_acl_release(*dpacl); 192 + posix_acl_release(*pacl); 193 + *dpacl = *pacl = NULL; 183 194 return 0; 184 195 } 185 196 ··· 198 209 mode &= ~current_umask(); 199 210 } 200 211 if (acl) { 201 - struct posix_acl *clone; 202 - 203 212 if (S_ISDIR(mode)) 204 - *dpacl = acl; 205 - clone = posix_acl_clone(acl, GFP_NOFS); 206 - retval = -ENOMEM; 207 - if (!clone) 208 - goto cleanup; 209 - 210 - retval = posix_acl_create_masq(clone, &mode); 211 - if (retval < 0) { 212 - posix_acl_release(clone); 213 - goto cleanup; 214 - } 213 + *dpacl = posix_acl_dup(acl); 214 + retval = posix_acl_create(&acl, GFP_NOFS, &mode); 215 + if (retval < 0) 216 + return retval; 215 217 if (retval > 0) 216 - *pacl = clone; 218 + *pacl = acl; 219 + else 220 + posix_acl_release(acl); 217 221 } 218 222 *modep = mode; 219 223 return 0; 220 - cleanup: 221 - posix_acl_release(acl); 222 - return retval; 223 - 224 224 } 225 225 226 226 static int v9fs_remote_get_acl(struct dentry *dentry, const char *name,
+5 -5
fs/9p/acl.h
··· 16 16 17 17 #ifdef CONFIG_9P_FS_POSIX_ACL 18 18 extern int v9fs_get_acl(struct inode *, struct p9_fid *); 19 - extern int v9fs_check_acl(struct inode *inode, int mask); 19 + extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type); 20 20 extern int v9fs_acl_chmod(struct dentry *); 21 21 extern int v9fs_set_create_acl(struct dentry *, 22 - struct posix_acl *, struct posix_acl *); 22 + struct posix_acl **, struct posix_acl **); 23 23 extern int v9fs_acl_mode(struct inode *dir, mode_t *modep, 24 24 struct posix_acl **dpacl, struct posix_acl **pacl); 25 25 #else 26 - #define v9fs_check_acl NULL 26 + #define v9fs_iop_get_acl NULL 27 27 static inline int v9fs_get_acl(struct inode *inode, struct p9_fid *fid) 28 28 { 29 29 return 0; ··· 33 33 return 0; 34 34 } 35 35 static inline int v9fs_set_create_acl(struct dentry *dentry, 36 - struct posix_acl *dpacl, 37 - struct posix_acl *pacl) 36 + struct posix_acl **dpacl, 37 + struct posix_acl **pacl) 38 38 { 39 39 return 0; 40 40 }
+8 -5
fs/9p/vfs_inode_dotl.c
··· 287 287 goto error; 288 288 289 289 /* Now set the ACL based on the default value */ 290 - v9fs_set_create_acl(dentry, dacl, pacl); 290 + v9fs_set_create_acl(dentry, &dacl, &pacl); 291 291 292 292 v9inode = V9FS_I(inode); 293 293 mutex_lock(&v9inode->v_mutex); ··· 328 328 err_clunk_old_fid: 329 329 if (ofid) 330 330 p9_client_clunk(ofid); 331 + v9fs_set_create_acl(NULL, &dacl, &pacl); 331 332 return err; 332 333 } 333 334 ··· 422 421 d_instantiate(dentry, inode); 423 422 } 424 423 /* Now set the ACL based on the default value */ 425 - v9fs_set_create_acl(dentry, dacl, pacl); 424 + v9fs_set_create_acl(dentry, &dacl, &pacl); 426 425 inc_nlink(dir); 427 426 v9fs_invalidate_inode_attr(dir); 428 427 error: 429 428 if (fid) 430 429 p9_client_clunk(fid); 430 + v9fs_set_create_acl(NULL, &dacl, &pacl); 431 431 return err; 432 432 } 433 433 ··· 828 826 d_instantiate(dentry, inode); 829 827 } 830 828 /* Now set the ACL based on the default value */ 831 - v9fs_set_create_acl(dentry, dacl, pacl); 829 + v9fs_set_create_acl(dentry, &dacl, &pacl); 832 830 error: 833 831 if (fid) 834 832 p9_client_clunk(fid); 833 + v9fs_set_create_acl(NULL, &dacl, &pacl); 835 834 return err; 836 835 } 837 836 ··· 917 914 .getxattr = generic_getxattr, 918 915 .removexattr = generic_removexattr, 919 916 .listxattr = v9fs_listxattr, 920 - .check_acl = v9fs_check_acl, 917 + .get_acl = v9fs_iop_get_acl, 921 918 }; 922 919 923 920 const struct inode_operations v9fs_file_inode_operations_dotl = { ··· 927 924 .getxattr = generic_getxattr, 928 925 .removexattr = generic_removexattr, 929 926 .listxattr = v9fs_listxattr, 930 - .check_acl = v9fs_check_acl, 927 + .get_acl = v9fs_iop_get_acl, 931 928 }; 932 929 933 930 const struct inode_operations v9fs_symlink_inode_operations_dotl = {
+1 -1
fs/anon_inodes.c
··· 233 233 return 0; 234 234 235 235 err_mntput: 236 - mntput(anon_inode_mnt); 236 + kern_unmount(anon_inode_mnt); 237 237 err_unregister_filesystem: 238 238 unregister_filesystem(&anon_inode_fs_type); 239 239 err_exit:
+14 -49
fs/btrfs/acl.c
··· 30 30 31 31 #ifdef CONFIG_BTRFS_FS_POSIX_ACL 32 32 33 - static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) 33 + struct posix_acl *btrfs_get_acl(struct inode *inode, int type) 34 34 { 35 35 int size; 36 36 const char *name; ··· 195 195 return ret; 196 196 } 197 197 198 - int btrfs_check_acl(struct inode *inode, int mask) 199 - { 200 - int error = -EAGAIN; 201 - 202 - if (mask & MAY_NOT_BLOCK) { 203 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 204 - error = -ECHILD; 205 - } else { 206 - struct posix_acl *acl; 207 - acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); 208 - if (IS_ERR(acl)) 209 - return PTR_ERR(acl); 210 - if (acl) { 211 - error = posix_acl_permission(inode, acl, mask); 212 - posix_acl_release(acl); 213 - } 214 - } 215 - 216 - return error; 217 - } 218 - 219 198 /* 220 199 * btrfs_init_acl is already generally called under fs_mutex, so the locking 221 200 * stuff has been fixed to work with that. If the locking stuff changes, we ··· 222 243 } 223 244 224 245 if (IS_POSIXACL(dir) && acl) { 225 - struct posix_acl *clone; 226 - mode_t mode; 246 + mode_t mode = inode->i_mode; 227 247 228 248 if (S_ISDIR(inode->i_mode)) { 229 249 ret = btrfs_set_acl(trans, inode, acl, ··· 230 252 if (ret) 231 253 goto failed; 232 254 } 233 - clone = posix_acl_clone(acl, GFP_NOFS); 234 - ret = -ENOMEM; 235 - if (!clone) 236 - goto failed; 255 + ret = posix_acl_create(&acl, GFP_NOFS, &mode); 256 + if (ret < 0) 257 + return ret; 237 258 238 - mode = inode->i_mode; 239 - ret = posix_acl_create_masq(clone, &mode); 240 - if (ret >= 0) { 241 - inode->i_mode = mode; 242 - if (ret > 0) { 243 - /* we need an acl */ 244 - ret = btrfs_set_acl(trans, inode, clone, 245 - ACL_TYPE_ACCESS); 246 - } 259 + inode->i_mode = mode; 260 + if (ret > 0) { 261 + /* we need an acl */ 262 + ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); 247 263 } 248 - posix_acl_release(clone); 249 264 } 250 265 failed: 251 266 posix_acl_release(acl); ··· 248 277 249 278 int btrfs_acl_chmod(struct inode *inode) 250 279 { 251 - struct posix_acl *acl, *clone; 280 + struct posix_acl *acl; 252 281 int ret = 0; 253 282 254 283 if (S_ISLNK(inode->i_mode)) ··· 261 290 if (IS_ERR_OR_NULL(acl)) 262 291 return PTR_ERR(acl); 263 292 264 - clone = posix_acl_clone(acl, GFP_KERNEL); 293 + ret = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 294 + if (ret) 295 + return ret; 296 + ret = btrfs_set_acl(NULL, inode, acl, ACL_TYPE_ACCESS); 265 297 posix_acl_release(acl); 266 - if (!clone) 267 - return -ENOMEM; 268 - 269 - ret = posix_acl_chmod_masq(clone, inode->i_mode); 270 - if (!ret) 271 - ret = btrfs_set_acl(NULL, inode, clone, ACL_TYPE_ACCESS); 272 - 273 - posix_acl_release(clone); 274 - 275 298 return ret; 276 299 } 277 300
+2 -2
fs/btrfs/ctree.h
··· 2645 2645 2646 2646 /* acl.c */ 2647 2647 #ifdef CONFIG_BTRFS_FS_POSIX_ACL 2648 - int btrfs_check_acl(struct inode *inode, int mask); 2648 + struct posix_acl *btrfs_get_acl(struct inode *inode, int type); 2649 2649 #else 2650 - #define btrfs_check_acl NULL 2650 + #define btrfs_get_acl NULL 2651 2651 #endif 2652 2652 int btrfs_init_acl(struct btrfs_trans_handle *trans, 2653 2653 struct inode *inode, struct inode *dir);
+5 -5
fs/btrfs/inode.c
··· 7351 7351 .listxattr = btrfs_listxattr, 7352 7352 .removexattr = btrfs_removexattr, 7353 7353 .permission = btrfs_permission, 7354 - .check_acl = btrfs_check_acl, 7354 + .get_acl = btrfs_get_acl, 7355 7355 }; 7356 7356 static const struct inode_operations btrfs_dir_ro_inode_operations = { 7357 7357 .lookup = btrfs_lookup, 7358 7358 .permission = btrfs_permission, 7359 - .check_acl = btrfs_check_acl, 7359 + .get_acl = btrfs_get_acl, 7360 7360 }; 7361 7361 7362 7362 static const struct file_operations btrfs_dir_file_operations = { ··· 7425 7425 .removexattr = btrfs_removexattr, 7426 7426 .permission = btrfs_permission, 7427 7427 .fiemap = btrfs_fiemap, 7428 - .check_acl = btrfs_check_acl, 7428 + .get_acl = btrfs_get_acl, 7429 7429 }; 7430 7430 static const struct inode_operations btrfs_special_inode_operations = { 7431 7431 .getattr = btrfs_getattr, ··· 7435 7435 .getxattr = btrfs_getxattr, 7436 7436 .listxattr = btrfs_listxattr, 7437 7437 .removexattr = btrfs_removexattr, 7438 - .check_acl = btrfs_check_acl, 7438 + .get_acl = btrfs_get_acl, 7439 7439 }; 7440 7440 static const struct inode_operations btrfs_symlink_inode_operations = { 7441 7441 .readlink = generic_readlink, ··· 7447 7447 .getxattr = btrfs_getxattr, 7448 7448 .listxattr = btrfs_listxattr, 7449 7449 .removexattr = btrfs_removexattr, 7450 - .check_acl = btrfs_check_acl, 7450 + .get_acl = btrfs_get_acl, 7451 7451 }; 7452 7452 7453 7453 const struct dentry_operations btrfs_dentry_operations = {
+1 -1
fs/cifs/dir.c
··· 641 641 static int 642 642 cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) 643 643 { 644 - if (nd->flags & LOOKUP_RCU) 644 + if (nd && (nd->flags & LOOKUP_RCU)) 645 645 return -ECHILD; 646 646 647 647 if (direntry->d_inode) {
+14 -49
fs/ext2/acl.c
··· 128 128 /* 129 129 * inode->i_mutex: don't care 130 130 */ 131 - static struct posix_acl * 131 + struct posix_acl * 132 132 ext2_get_acl(struct inode *inode, int type) 133 133 { 134 134 int name_index; ··· 231 231 return error; 232 232 } 233 233 234 - int 235 - ext2_check_acl(struct inode *inode, int mask) 236 - { 237 - struct posix_acl *acl; 238 - 239 - if (mask & MAY_NOT_BLOCK) { 240 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 241 - return -ECHILD; 242 - return -EAGAIN; 243 - } 244 - 245 - acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); 246 - if (IS_ERR(acl)) 247 - return PTR_ERR(acl); 248 - if (acl) { 249 - int error = posix_acl_permission(inode, acl, mask); 250 - posix_acl_release(acl); 251 - return error; 252 - } 253 - 254 - return -EAGAIN; 255 - } 256 - 257 234 /* 258 235 * Initialize the ACLs of a new inode. Called from ext2_new_inode. 259 236 * ··· 253 276 inode->i_mode &= ~current_umask(); 254 277 } 255 278 if (test_opt(inode->i_sb, POSIX_ACL) && acl) { 256 - struct posix_acl *clone; 257 - mode_t mode; 258 - 279 + mode_t mode = inode->i_mode; 259 280 if (S_ISDIR(inode->i_mode)) { 260 281 error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl); 261 282 if (error) 262 283 goto cleanup; 263 284 } 264 - clone = posix_acl_clone(acl, GFP_KERNEL); 265 - error = -ENOMEM; 266 - if (!clone) 267 - goto cleanup; 268 - mode = inode->i_mode; 269 - error = posix_acl_create_masq(clone, &mode); 270 - if (error >= 0) { 271 - inode->i_mode = mode; 272 - if (error > 0) { 273 - /* This is an extended ACL */ 274 - error = ext2_set_acl(inode, 275 - ACL_TYPE_ACCESS, clone); 276 - } 285 + error = posix_acl_create(&acl, GFP_KERNEL, &mode); 286 + if (error < 0) 287 + return error; 288 + inode->i_mode = mode; 289 + if (error > 0) { 290 + /* This is an extended ACL */ 291 + error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); 277 292 } 278 - posix_acl_release(clone); 279 293 } 280 294 cleanup: 281 295 posix_acl_release(acl); ··· 290 322 int 291 323 ext2_acl_chmod(struct inode *inode) 292 324 { 293 - struct posix_acl *acl, *clone; 325 + struct posix_acl *acl; 294 326 int error; 295 327 296 328 if (!test_opt(inode->i_sb, POSIX_ACL)) ··· 300 332 acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); 301 333 if (IS_ERR(acl) || !acl) 302 334 return PTR_ERR(acl); 303 - clone = posix_acl_clone(acl, GFP_KERNEL); 335 + error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 336 + if (error) 337 + return error; 338 + error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); 304 339 posix_acl_release(acl); 305 - if (!clone) 306 - return -ENOMEM; 307 - error = posix_acl_chmod_masq(clone, inode->i_mode); 308 - if (!error) 309 - error = ext2_set_acl(inode, ACL_TYPE_ACCESS, clone); 310 - posix_acl_release(clone); 311 340 return error; 312 341 } 313 342
+2 -2
fs/ext2/acl.h
··· 54 54 #ifdef CONFIG_EXT2_FS_POSIX_ACL 55 55 56 56 /* acl.c */ 57 - extern int ext2_check_acl (struct inode *, int); 57 + extern struct posix_acl *ext2_get_acl(struct inode *inode, int type); 58 58 extern int ext2_acl_chmod (struct inode *); 59 59 extern int ext2_init_acl (struct inode *, struct inode *); 60 60 61 61 #else 62 62 #include <linux/sched.h> 63 - #define ext2_check_acl NULL 63 + #define ext2_get_acl NULL 64 64 #define ext2_get_acl NULL 65 65 #define ext2_set_acl NULL 66 66
+1 -1
fs/ext2/file.c
··· 102 102 .removexattr = generic_removexattr, 103 103 #endif 104 104 .setattr = ext2_setattr, 105 - .check_acl = ext2_check_acl, 105 + .get_acl = ext2_get_acl, 106 106 .fiemap = ext2_fiemap, 107 107 };
+2 -2
fs/ext2/namei.c
··· 408 408 .removexattr = generic_removexattr, 409 409 #endif 410 410 .setattr = ext2_setattr, 411 - .check_acl = ext2_check_acl, 411 + .get_acl = ext2_get_acl, 412 412 }; 413 413 414 414 const struct inode_operations ext2_special_inode_operations = { ··· 419 419 .removexattr = generic_removexattr, 420 420 #endif 421 421 .setattr = ext2_setattr, 422 - .check_acl = ext2_check_acl, 422 + .get_acl = ext2_get_acl, 423 423 };
+28 -64
fs/ext3/acl.c
··· 131 131 * 132 132 * inode->i_mutex: don't care 133 133 */ 134 - static struct posix_acl * 134 + struct posix_acl * 135 135 ext3_get_acl(struct inode *inode, int type) 136 136 { 137 137 int name_index; ··· 239 239 return error; 240 240 } 241 241 242 - int 243 - ext3_check_acl(struct inode *inode, int mask) 244 - { 245 - struct posix_acl *acl; 246 - 247 - if (mask & MAY_NOT_BLOCK) { 248 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 249 - return -ECHILD; 250 - return -EAGAIN; 251 - } 252 - 253 - acl = ext3_get_acl(inode, ACL_TYPE_ACCESS); 254 - if (IS_ERR(acl)) 255 - return PTR_ERR(acl); 256 - if (acl) { 257 - int error = posix_acl_permission(inode, acl, mask); 258 - posix_acl_release(acl); 259 - return error; 260 - } 261 - 262 - return -EAGAIN; 263 - } 264 - 265 242 /* 266 243 * Initialize the ACLs of a new inode. Called from ext3_new_inode. 267 244 * ··· 261 284 inode->i_mode &= ~current_umask(); 262 285 } 263 286 if (test_opt(inode->i_sb, POSIX_ACL) && acl) { 264 - struct posix_acl *clone; 265 - mode_t mode; 287 + mode_t mode = inode->i_mode; 266 288 267 289 if (S_ISDIR(inode->i_mode)) { 268 290 error = ext3_set_acl(handle, inode, ··· 269 293 if (error) 270 294 goto cleanup; 271 295 } 272 - clone = posix_acl_clone(acl, GFP_NOFS); 273 - error = -ENOMEM; 274 - if (!clone) 275 - goto cleanup; 296 + error = posix_acl_create(&acl, GFP_NOFS, &mode); 297 + if (error < 0) 298 + return error; 276 299 277 - mode = inode->i_mode; 278 - error = posix_acl_create_masq(clone, &mode); 279 - if (error >= 0) { 280 - inode->i_mode = mode; 281 - if (error > 0) { 282 - /* This is an extended ACL */ 283 - error = ext3_set_acl(handle, inode, 284 - ACL_TYPE_ACCESS, clone); 285 - } 300 + inode->i_mode = mode; 301 + if (error > 0) { 302 + /* This is an extended ACL */ 303 + error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); 286 304 } 287 - posix_acl_release(clone); 288 305 } 289 306 cleanup: 290 307 posix_acl_release(acl); ··· 301 332 int 302 333 ext3_acl_chmod(struct inode *inode) 303 334 { 304 - struct posix_acl *acl, *clone; 335 + struct posix_acl *acl; 336 + handle_t *handle; 337 + int retries = 0; 305 338 int error; 306 339 307 340 if (S_ISLNK(inode->i_mode)) ··· 313 342 acl = ext3_get_acl(inode, ACL_TYPE_ACCESS); 314 343 if (IS_ERR(acl) || !acl) 315 344 return PTR_ERR(acl); 316 - clone = posix_acl_clone(acl, GFP_KERNEL); 317 - posix_acl_release(acl); 318 - if (!clone) 319 - return -ENOMEM; 320 - error = posix_acl_chmod_masq(clone, inode->i_mode); 321 - if (!error) { 322 - handle_t *handle; 323 - int retries = 0; 324 - 325 - retry: 326 - handle = ext3_journal_start(inode, 327 - EXT3_DATA_TRANS_BLOCKS(inode->i_sb)); 328 - if (IS_ERR(handle)) { 329 - error = PTR_ERR(handle); 330 - ext3_std_error(inode->i_sb, error); 331 - goto out; 332 - } 333 - error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone); 334 - ext3_journal_stop(handle); 335 - if (error == -ENOSPC && 336 - ext3_should_retry_alloc(inode->i_sb, &retries)) 337 - goto retry; 345 + error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 346 + if (error) 347 + return error; 348 + retry: 349 + handle = ext3_journal_start(inode, 350 + EXT3_DATA_TRANS_BLOCKS(inode->i_sb)); 351 + if (IS_ERR(handle)) { 352 + error = PTR_ERR(handle); 353 + ext3_std_error(inode->i_sb, error); 354 + goto out; 338 355 } 356 + error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); 357 + ext3_journal_stop(handle); 358 + if (error == -ENOSPC && 359 + ext3_should_retry_alloc(inode->i_sb, &retries)) 360 + goto retry; 339 361 out: 340 - posix_acl_release(clone); 362 + posix_acl_release(acl); 341 363 return error; 342 364 } 343 365
+2 -2
fs/ext3/acl.h
··· 54 54 #ifdef CONFIG_EXT3_FS_POSIX_ACL 55 55 56 56 /* acl.c */ 57 - extern int ext3_check_acl (struct inode *, int); 57 + extern struct posix_acl *ext3_get_acl(struct inode *inode, int type); 58 58 extern int ext3_acl_chmod (struct inode *); 59 59 extern int ext3_init_acl (handle_t *, struct inode *, struct inode *); 60 60 61 61 #else /* CONFIG_EXT3_FS_POSIX_ACL */ 62 62 #include <linux/sched.h> 63 - #define ext3_check_acl NULL 63 + #define ext3_get_acl NULL 64 64 65 65 static inline int 66 66 ext3_acl_chmod(struct inode *inode)
+1 -1
fs/ext3/file.c
··· 79 79 .listxattr = ext3_listxattr, 80 80 .removexattr = generic_removexattr, 81 81 #endif 82 - .check_acl = ext3_check_acl, 82 + .get_acl = ext3_get_acl, 83 83 .fiemap = ext3_fiemap, 84 84 }; 85 85
+2 -2
fs/ext3/namei.c
··· 2529 2529 .listxattr = ext3_listxattr, 2530 2530 .removexattr = generic_removexattr, 2531 2531 #endif 2532 - .check_acl = ext3_check_acl, 2532 + .get_acl = ext3_get_acl, 2533 2533 }; 2534 2534 2535 2535 const struct inode_operations ext3_special_inode_operations = { ··· 2540 2540 .listxattr = ext3_listxattr, 2541 2541 .removexattr = generic_removexattr, 2542 2542 #endif 2543 - .check_acl = ext3_check_acl, 2543 + .get_acl = ext3_get_acl, 2544 2544 };
+29 -64
fs/ext4/acl.c
··· 131 131 * 132 132 * inode->i_mutex: don't care 133 133 */ 134 - static struct posix_acl * 134 + struct posix_acl * 135 135 ext4_get_acl(struct inode *inode, int type) 136 136 { 137 137 int name_index; ··· 237 237 return error; 238 238 } 239 239 240 - int 241 - ext4_check_acl(struct inode *inode, int mask) 242 - { 243 - struct posix_acl *acl; 244 - 245 - if (mask & MAY_NOT_BLOCK) { 246 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 247 - return -ECHILD; 248 - return -EAGAIN; 249 - } 250 - 251 - acl = ext4_get_acl(inode, ACL_TYPE_ACCESS); 252 - if (IS_ERR(acl)) 253 - return PTR_ERR(acl); 254 - if (acl) { 255 - int error = posix_acl_permission(inode, acl, mask); 256 - posix_acl_release(acl); 257 - return error; 258 - } 259 - 260 - return -EAGAIN; 261 - } 262 - 263 240 /* 264 241 * Initialize the ACLs of a new inode. Called from ext4_new_inode. 265 242 * ··· 259 282 inode->i_mode &= ~current_umask(); 260 283 } 261 284 if (test_opt(inode->i_sb, POSIX_ACL) && acl) { 262 - struct posix_acl *clone; 263 - mode_t mode; 285 + mode_t mode = inode->i_mode; 264 286 265 287 if (S_ISDIR(inode->i_mode)) { 266 288 error = ext4_set_acl(handle, inode, ··· 267 291 if (error) 268 292 goto cleanup; 269 293 } 270 - clone = posix_acl_clone(acl, GFP_NOFS); 271 - error = -ENOMEM; 272 - if (!clone) 273 - goto cleanup; 294 + error = posix_acl_create(&acl, GFP_NOFS, &mode); 295 + if (error < 0) 296 + return error; 274 297 275 - mode = inode->i_mode; 276 - error = posix_acl_create_masq(clone, &mode); 277 - if (error >= 0) { 278 - inode->i_mode = mode; 279 - if (error > 0) { 280 - /* This is an extended ACL */ 281 - error = ext4_set_acl(handle, inode, 282 - ACL_TYPE_ACCESS, clone); 283 - } 298 + inode->i_mode = mode; 299 + if (error > 0) { 300 + /* This is an extended ACL */ 301 + error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); 284 302 } 285 - posix_acl_release(clone); 286 303 } 287 304 cleanup: 288 305 posix_acl_release(acl); ··· 299 330 int 300 331 ext4_acl_chmod(struct inode *inode) 301 332 { 302 - struct posix_acl *acl, *clone; 333 + struct posix_acl *acl; 334 + handle_t *handle; 335 + int retries = 0; 303 336 int error; 337 + 304 338 305 339 if (S_ISLNK(inode->i_mode)) 306 340 return -EOPNOTSUPP; ··· 312 340 acl = ext4_get_acl(inode, ACL_TYPE_ACCESS); 313 341 if (IS_ERR(acl) || !acl) 314 342 return PTR_ERR(acl); 315 - clone = posix_acl_clone(acl, GFP_KERNEL); 316 - posix_acl_release(acl); 317 - if (!clone) 318 - return -ENOMEM; 319 - error = posix_acl_chmod_masq(clone, inode->i_mode); 320 - if (!error) { 321 - handle_t *handle; 322 - int retries = 0; 323 - 324 - retry: 325 - handle = ext4_journal_start(inode, 326 - EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); 327 - if (IS_ERR(handle)) { 328 - error = PTR_ERR(handle); 329 - ext4_std_error(inode->i_sb, error); 330 - goto out; 331 - } 332 - error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, clone); 333 - ext4_journal_stop(handle); 334 - if (error == -ENOSPC && 335 - ext4_should_retry_alloc(inode->i_sb, &retries)) 336 - goto retry; 343 + error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 344 + if (error) 345 + return error; 346 + retry: 347 + handle = ext4_journal_start(inode, 348 + EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); 349 + if (IS_ERR(handle)) { 350 + error = PTR_ERR(handle); 351 + ext4_std_error(inode->i_sb, error); 352 + goto out; 337 353 } 354 + error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); 355 + ext4_journal_stop(handle); 356 + if (error == -ENOSPC && 357 + ext4_should_retry_alloc(inode->i_sb, &retries)) 358 + goto retry; 338 359 out: 339 - posix_acl_release(clone); 360 + posix_acl_release(acl); 340 361 return error; 341 362 } 342 363
+2 -2
fs/ext4/acl.h
··· 54 54 #ifdef CONFIG_EXT4_FS_POSIX_ACL 55 55 56 56 /* acl.c */ 57 - extern int ext4_check_acl(struct inode *, int); 57 + struct posix_acl *ext4_get_acl(struct inode *inode, int type); 58 58 extern int ext4_acl_chmod(struct inode *); 59 59 extern int ext4_init_acl(handle_t *, struct inode *, struct inode *); 60 60 61 61 #else /* CONFIG_EXT4_FS_POSIX_ACL */ 62 62 #include <linux/sched.h> 63 - #define ext4_check_acl NULL 63 + #define ext4_get_acl NULL 64 64 65 65 static inline int 66 66 ext4_acl_chmod(struct inode *inode)
+1 -1
fs/ext4/file.c
··· 301 301 .listxattr = ext4_listxattr, 302 302 .removexattr = generic_removexattr, 303 303 #endif 304 - .check_acl = ext4_check_acl, 304 + .get_acl = ext4_get_acl, 305 305 .fiemap = ext4_fiemap, 306 306 }; 307 307
+2 -2
fs/ext4/namei.c
··· 2590 2590 .listxattr = ext4_listxattr, 2591 2591 .removexattr = generic_removexattr, 2592 2592 #endif 2593 - .check_acl = ext4_check_acl, 2593 + .get_acl = ext4_get_acl, 2594 2594 .fiemap = ext4_fiemap, 2595 2595 }; 2596 2596 ··· 2602 2602 .listxattr = ext4_listxattr, 2603 2603 .removexattr = generic_removexattr, 2604 2604 #endif 2605 - .check_acl = ext4_check_acl, 2605 + .get_acl = ext4_get_acl, 2606 2606 };
+13 -49
fs/generic_acl.c
··· 132 132 if (!S_ISLNK(inode->i_mode)) 133 133 acl = get_cached_acl(dir, ACL_TYPE_DEFAULT); 134 134 if (acl) { 135 - struct posix_acl *clone; 136 - 137 - if (S_ISDIR(inode->i_mode)) { 138 - clone = posix_acl_clone(acl, GFP_KERNEL); 139 - error = -ENOMEM; 140 - if (!clone) 141 - goto cleanup; 142 - set_cached_acl(inode, ACL_TYPE_DEFAULT, clone); 143 - posix_acl_release(clone); 144 - } 145 - clone = posix_acl_clone(acl, GFP_KERNEL); 146 - error = -ENOMEM; 147 - if (!clone) 148 - goto cleanup; 149 - error = posix_acl_create_masq(clone, &mode); 150 - if (error >= 0) { 151 - inode->i_mode = mode; 152 - if (error > 0) 153 - set_cached_acl(inode, ACL_TYPE_ACCESS, clone); 154 - } 155 - posix_acl_release(clone); 135 + if (S_ISDIR(inode->i_mode)) 136 + set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); 137 + error = posix_acl_create(&acl, GFP_KERNEL, &mode); 138 + if (error < 0) 139 + return error; 140 + inode->i_mode = mode; 141 + if (error > 0) 142 + set_cached_acl(inode, ACL_TYPE_ACCESS, acl); 156 143 } 157 144 error = 0; 158 145 159 - cleanup: 160 146 posix_acl_release(acl); 161 147 return error; 162 148 } ··· 156 170 int 157 171 generic_acl_chmod(struct inode *inode) 158 172 { 159 - struct posix_acl *acl, *clone; 173 + struct posix_acl *acl; 160 174 int error = 0; 161 175 162 176 if (S_ISLNK(inode->i_mode)) 163 177 return -EOPNOTSUPP; 164 178 acl = get_cached_acl(inode, ACL_TYPE_ACCESS); 165 179 if (acl) { 166 - clone = posix_acl_clone(acl, GFP_KERNEL); 180 + error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 181 + if (error) 182 + return error; 183 + set_cached_acl(inode, ACL_TYPE_ACCESS, acl); 167 184 posix_acl_release(acl); 168 - if (!clone) 169 - return -ENOMEM; 170 - error = posix_acl_chmod_masq(clone, inode->i_mode); 171 - if (!error) 172 - set_cached_acl(inode, ACL_TYPE_ACCESS, clone); 173 - posix_acl_release(clone); 174 185 } 175 186 return error; 176 - } 177 - 178 - int 179 - generic_check_acl(struct inode *inode, int mask) 180 - { 181 - if (mask & MAY_NOT_BLOCK) { 182 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 183 - return -ECHILD; 184 - } else { 185 - struct posix_acl *acl; 186 - 187 - acl = get_cached_acl(inode, ACL_TYPE_ACCESS); 188 - if (acl) { 189 - int error = posix_acl_permission(inode, acl, mask); 190 - posix_acl_release(acl); 191 - return error; 192 - } 193 - } 194 - return -EAGAIN; 195 187 } 196 188 197 189 const struct xattr_handler generic_acl_access_handler = {
+19 -58
fs/gfs2/acl.c
··· 67 67 return acl; 68 68 } 69 69 70 - /** 71 - * gfs2_check_acl - Check an ACL to see if we're allowed to do something 72 - * @inode: the file we want to do something to 73 - * @mask: what we want to do 74 - * 75 - * Returns: errno 76 - */ 77 - 78 - int gfs2_check_acl(struct inode *inode, int mask) 70 + struct posix_acl *gfs2_get_acl(struct inode *inode, int type) 79 71 { 80 - struct posix_acl *acl; 81 - int error; 82 - 83 - if (mask & MAY_NOT_BLOCK) { 84 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 85 - return -ECHILD; 86 - return -EAGAIN; 87 - } 88 - 89 - acl = gfs2_acl_get(GFS2_I(inode), ACL_TYPE_ACCESS); 90 - if (IS_ERR(acl)) 91 - return PTR_ERR(acl); 92 - 93 - if (acl) { 94 - error = posix_acl_permission(inode, acl, mask); 95 - posix_acl_release(acl); 96 - return error; 97 - } 98 - 99 - return -EAGAIN; 72 + return gfs2_acl_get(GFS2_I(inode), type); 100 73 } 101 74 102 75 static int gfs2_set_mode(struct inode *inode, mode_t mode) ··· 116 143 int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode) 117 144 { 118 145 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 119 - struct posix_acl *acl, *clone; 146 + struct posix_acl *acl; 120 147 mode_t mode = inode->i_mode; 121 148 int error = 0; 122 149 ··· 141 168 goto out; 142 169 } 143 170 144 - clone = posix_acl_clone(acl, GFP_NOFS); 145 - error = -ENOMEM; 146 - if (!clone) 147 - goto out; 148 - posix_acl_release(acl); 149 - acl = clone; 150 - 151 - error = posix_acl_create_masq(acl, &mode); 171 + error = posix_acl_create(&acl, GFP_NOFS, &mode); 152 172 if (error < 0) 153 - goto out; 173 + return error; 174 + 154 175 if (error == 0) 155 176 goto munge; 156 177 ··· 160 193 161 194 int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr) 162 195 { 163 - struct posix_acl *acl, *clone; 196 + struct posix_acl *acl; 164 197 char *data; 165 198 unsigned int len; 166 199 int error; ··· 171 204 if (!acl) 172 205 return gfs2_setattr_simple(ip, attr); 173 206 174 - clone = posix_acl_clone(acl, GFP_NOFS); 175 - error = -ENOMEM; 176 - if (!clone) 177 - goto out; 178 - posix_acl_release(acl); 179 - acl = clone; 207 + error = posix_acl_chmod(&acl, GFP_NOFS, attr->ia_mode); 208 + if (error) 209 + return error; 180 210 181 - error = posix_acl_chmod_masq(acl, attr->ia_mode); 182 - if (!error) { 183 - len = posix_acl_to_xattr(acl, NULL, 0); 184 - data = kmalloc(len, GFP_NOFS); 185 - error = -ENOMEM; 186 - if (data == NULL) 187 - goto out; 188 - posix_acl_to_xattr(acl, data, len); 189 - error = gfs2_xattr_acl_chmod(ip, attr, data); 190 - kfree(data); 191 - set_cached_acl(&ip->i_inode, ACL_TYPE_ACCESS, acl); 192 - } 211 + len = posix_acl_to_xattr(acl, NULL, 0); 212 + data = kmalloc(len, GFP_NOFS); 213 + error = -ENOMEM; 214 + if (data == NULL) 215 + goto out; 216 + posix_acl_to_xattr(acl, data, len); 217 + error = gfs2_xattr_acl_chmod(ip, attr, data); 218 + kfree(data); 219 + set_cached_acl(&ip->i_inode, ACL_TYPE_ACCESS, acl); 193 220 194 221 out: 195 222 posix_acl_release(acl);
+1 -1
fs/gfs2/acl.h
··· 16 16 #define GFS2_POSIX_ACL_DEFAULT "posix_acl_default" 17 17 #define GFS2_ACL_MAX_ENTRIES 25 18 18 19 - extern int gfs2_check_acl(struct inode *inode, int mask); 19 + extern struct posix_acl *gfs2_get_acl(struct inode *inode, int type); 20 20 extern int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode); 21 21 extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr); 22 22 extern const struct xattr_handler gfs2_xattr_system_handler;
+3 -3
fs/gfs2/inode.c
··· 1846 1846 .listxattr = gfs2_listxattr, 1847 1847 .removexattr = gfs2_removexattr, 1848 1848 .fiemap = gfs2_fiemap, 1849 - .check_acl = gfs2_check_acl, 1849 + .get_acl = gfs2_get_acl, 1850 1850 }; 1851 1851 1852 1852 const struct inode_operations gfs2_dir_iops = { ··· 1867 1867 .listxattr = gfs2_listxattr, 1868 1868 .removexattr = gfs2_removexattr, 1869 1869 .fiemap = gfs2_fiemap, 1870 - .check_acl = gfs2_check_acl, 1870 + .get_acl = gfs2_get_acl, 1871 1871 }; 1872 1872 1873 1873 const struct inode_operations gfs2_symlink_iops = { ··· 1882 1882 .listxattr = gfs2_listxattr, 1883 1883 .removexattr = gfs2_removexattr, 1884 1884 .fiemap = gfs2_fiemap, 1885 - .check_acl = gfs2_check_acl, 1885 + .get_acl = gfs2_get_acl, 1886 1886 }; 1887 1887
+1
fs/hugetlbfs/inode.c
··· 1030 1030 static void __exit exit_hugetlbfs_fs(void) 1031 1031 { 1032 1032 kmem_cache_destroy(hugetlbfs_inode_cachep); 1033 + kern_unmount(hugetlbfs_vfsmount); 1033 1034 unregister_filesystem(&hugetlbfs_fs_type); 1034 1035 bdi_destroy(&hugetlbfs_backing_dev_info); 1035 1036 }
+11 -38
fs/jffs2/acl.c
··· 156 156 return ERR_PTR(-EINVAL); 157 157 } 158 158 159 - static struct posix_acl *jffs2_get_acl(struct inode *inode, int type) 159 + struct posix_acl *jffs2_get_acl(struct inode *inode, int type) 160 160 { 161 161 struct posix_acl *acl; 162 162 char *value = NULL; ··· 259 259 return rc; 260 260 } 261 261 262 - int jffs2_check_acl(struct inode *inode, int mask) 262 + int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode) 263 263 { 264 264 struct posix_acl *acl; 265 - int rc; 266 - 267 - if (mask & MAY_NOT_BLOCK) 268 - return -ECHILD; 269 - 270 - acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS); 271 - if (IS_ERR(acl)) 272 - return PTR_ERR(acl); 273 - if (acl) { 274 - rc = posix_acl_permission(inode, acl, mask); 275 - posix_acl_release(acl); 276 - return rc; 277 - } 278 - return -EAGAIN; 279 - } 280 - 281 - int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode) 282 - { 283 - struct posix_acl *acl, *clone; 284 265 int rc; 285 266 286 267 cache_no_acl(inode); ··· 279 298 if (S_ISDIR(*i_mode)) 280 299 set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); 281 300 282 - clone = posix_acl_clone(acl, GFP_KERNEL); 283 - if (!clone) 284 - return -ENOMEM; 285 - rc = posix_acl_create_masq(clone, (mode_t *)i_mode); 286 - if (rc < 0) { 287 - posix_acl_release(clone); 301 + rc = posix_acl_create(&acl, GFP_KERNEL, i_mode); 302 + if (rc < 0) 288 303 return rc; 289 - } 290 304 if (rc > 0) 291 - set_cached_acl(inode, ACL_TYPE_ACCESS, clone); 305 + set_cached_acl(inode, ACL_TYPE_ACCESS, acl); 292 306 293 - posix_acl_release(clone); 307 + posix_acl_release(acl); 294 308 } 295 309 return 0; 296 310 } ··· 311 335 312 336 int jffs2_acl_chmod(struct inode *inode) 313 337 { 314 - struct posix_acl *acl, *clone; 338 + struct posix_acl *acl; 315 339 int rc; 316 340 317 341 if (S_ISLNK(inode->i_mode)) ··· 319 343 acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS); 320 344 if (IS_ERR(acl) || !acl) 321 345 return PTR_ERR(acl); 322 - clone = posix_acl_clone(acl, GFP_KERNEL); 346 + rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 347 + if (rc) 348 + return rc; 349 + rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, acl); 323 350 posix_acl_release(acl); 324 - if (!clone) 325 - return -ENOMEM; 326 - rc = posix_acl_chmod_masq(clone, inode->i_mode); 327 - if (!rc) 328 - rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, clone); 329 - posix_acl_release(clone); 330 351 return rc; 331 352 } 332 353
+3 -3
fs/jffs2/acl.h
··· 26 26 27 27 #ifdef CONFIG_JFFS2_FS_POSIX_ACL 28 28 29 - extern int jffs2_check_acl(struct inode *, int); 29 + struct posix_acl *jffs2_get_acl(struct inode *inode, int type); 30 30 extern int jffs2_acl_chmod(struct inode *); 31 - extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *); 31 + extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *); 32 32 extern int jffs2_init_acl_post(struct inode *); 33 33 34 34 extern const struct xattr_handler jffs2_acl_access_xattr_handler; ··· 36 36 37 37 #else 38 38 39 - #define jffs2_check_acl (NULL) 39 + #define jffs2_get_acl (NULL) 40 40 #define jffs2_acl_chmod(inode) (0) 41 41 #define jffs2_init_acl_pre(dir_i,inode,mode) (0) 42 42 #define jffs2_init_acl_post(inode) (0)
+1 -1
fs/jffs2/dir.c
··· 56 56 .rmdir = jffs2_rmdir, 57 57 .mknod = jffs2_mknod, 58 58 .rename = jffs2_rename, 59 - .check_acl = jffs2_check_acl, 59 + .get_acl = jffs2_get_acl, 60 60 .setattr = jffs2_setattr, 61 61 .setxattr = jffs2_setxattr, 62 62 .getxattr = jffs2_getxattr,
+1 -1
fs/jffs2/file.c
··· 63 63 64 64 const struct inode_operations jffs2_file_inode_operations = 65 65 { 66 - .check_acl = jffs2_check_acl, 66 + .get_acl = jffs2_get_acl, 67 67 .setattr = jffs2_setattr, 68 68 .setxattr = jffs2_setxattr, 69 69 .getxattr = jffs2_getxattr,
+1 -1
fs/jffs2/fs.c
··· 406 406 407 407 /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, 408 408 fill in the raw_inode while you're at it. */ 409 - struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri) 409 + struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri) 410 410 { 411 411 struct inode *inode; 412 412 struct super_block *sb = dir_i->i_sb;
+1 -1
fs/jffs2/os-linux.h
··· 173 173 struct inode *jffs2_iget(struct super_block *, unsigned long); 174 174 void jffs2_evict_inode (struct inode *); 175 175 void jffs2_dirty_inode(struct inode *inode, int flags); 176 - struct inode *jffs2_new_inode (struct inode *dir_i, int mode, 176 + struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, 177 177 struct jffs2_raw_inode *ri); 178 178 int jffs2_statfs (struct dentry *, struct kstatfs *); 179 179 int jffs2_remount_fs (struct super_block *, int *, char *);
+1 -1
fs/jffs2/symlink.c
··· 20 20 { 21 21 .readlink = generic_readlink, 22 22 .follow_link = jffs2_follow_link, 23 - .check_acl = jffs2_check_acl, 23 + .get_acl = jffs2_get_acl, 24 24 .setattr = jffs2_setattr, 25 25 .setxattr = jffs2_setxattr, 26 26 .getxattr = jffs2_getxattr,
+22 -53
fs/jfs/acl.c
··· 27 27 #include "jfs_xattr.h" 28 28 #include "jfs_acl.h" 29 29 30 - static struct posix_acl *jfs_get_acl(struct inode *inode, int type) 30 + struct posix_acl *jfs_get_acl(struct inode *inode, int type) 31 31 { 32 32 struct posix_acl *acl; 33 33 char *ea_name; ··· 114 114 return rc; 115 115 } 116 116 117 - int jfs_check_acl(struct inode *inode, int mask) 118 - { 119 - struct posix_acl *acl; 120 - 121 - if (mask & MAY_NOT_BLOCK) 122 - return -ECHILD; 123 - 124 - acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); 125 - if (IS_ERR(acl)) 126 - return PTR_ERR(acl); 127 - if (acl) { 128 - int error = posix_acl_permission(inode, acl, mask); 129 - posix_acl_release(acl); 130 - return error; 131 - } 132 - 133 - return -EAGAIN; 134 - } 135 - 136 117 int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) 137 118 { 138 119 struct posix_acl *acl = NULL; 139 - struct posix_acl *clone; 140 - mode_t mode; 141 120 int rc = 0; 142 121 143 122 if (S_ISLNK(inode->i_mode)) ··· 127 148 return PTR_ERR(acl); 128 149 129 150 if (acl) { 151 + mode_t mode = inode->i_mode; 130 152 if (S_ISDIR(inode->i_mode)) { 131 153 rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); 132 154 if (rc) 133 155 goto cleanup; 134 156 } 135 - clone = posix_acl_clone(acl, GFP_KERNEL); 136 - if (!clone) { 137 - rc = -ENOMEM; 138 - goto cleanup; 139 - } 140 - mode = inode->i_mode; 141 - rc = posix_acl_create_masq(clone, &mode); 142 - if (rc >= 0) { 143 - inode->i_mode = mode; 144 - if (rc > 0) 145 - rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, 146 - clone); 147 - } 148 - posix_acl_release(clone); 157 + rc = posix_acl_create(&acl, GFP_KERNEL, &mode); 158 + if (rc < 0) 159 + goto cleanup; /* posix_acl_release(NULL) is no-op */ 160 + inode->i_mode = mode; 161 + if (rc > 0) 162 + rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); 149 163 cleanup: 150 164 posix_acl_release(acl); 151 165 } else ··· 152 180 153 181 int jfs_acl_chmod(struct inode *inode) 154 182 { 155 - struct posix_acl *acl, *clone; 183 + struct posix_acl *acl; 156 184 int rc; 185 + tid_t tid; 157 186 158 187 if (S_ISLNK(inode->i_mode)) 159 188 return -EOPNOTSUPP; ··· 163 190 if (IS_ERR(acl) || !acl) 164 191 return PTR_ERR(acl); 165 192 166 - clone = posix_acl_clone(acl, GFP_KERNEL); 193 + rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 194 + if (rc) 195 + return rc; 196 + 197 + tid = txBegin(inode->i_sb, 0); 198 + mutex_lock(&JFS_IP(inode)->commit_mutex); 199 + rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); 200 + if (!rc) 201 + rc = txCommit(tid, 1, &inode, 0); 202 + txEnd(tid); 203 + mutex_unlock(&JFS_IP(inode)->commit_mutex); 204 + 167 205 posix_acl_release(acl); 168 - if (!clone) 169 - return -ENOMEM; 170 - 171 - rc = posix_acl_chmod_masq(clone, inode->i_mode); 172 - if (!rc) { 173 - tid_t tid = txBegin(inode->i_sb, 0); 174 - mutex_lock(&JFS_IP(inode)->commit_mutex); 175 - rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, clone); 176 - if (!rc) 177 - rc = txCommit(tid, 1, &inode, 0); 178 - txEnd(tid); 179 - mutex_unlock(&JFS_IP(inode)->commit_mutex); 180 - } 181 - 182 - posix_acl_release(clone); 183 206 return rc; 184 207 }
+1 -1
fs/jfs/file.c
··· 140 140 .removexattr = jfs_removexattr, 141 141 .setattr = jfs_setattr, 142 142 #ifdef CONFIG_JFS_POSIX_ACL 143 - .check_acl = jfs_check_acl, 143 + .get_acl = jfs_get_acl, 144 144 #endif 145 145 }; 146 146
+1 -1
fs/jfs/jfs_acl.h
··· 20 20 21 21 #ifdef CONFIG_JFS_POSIX_ACL 22 22 23 - int jfs_check_acl(struct inode *, int); 23 + struct posix_acl *jfs_get_acl(struct inode *inode, int type); 24 24 int jfs_init_acl(tid_t, struct inode *, struct inode *); 25 25 int jfs_acl_chmod(struct inode *inode); 26 26
+1 -1
fs/jfs/namei.c
··· 1537 1537 .removexattr = jfs_removexattr, 1538 1538 .setattr = jfs_setattr, 1539 1539 #ifdef CONFIG_JFS_POSIX_ACL 1540 - .check_acl = jfs_check_acl, 1540 + .get_acl = jfs_get_acl, 1541 1541 #endif 1542 1542 }; 1543 1543
+51 -3
fs/namei.c
··· 32 32 #include <linux/fcntl.h> 33 33 #include <linux/device_cgroup.h> 34 34 #include <linux/fs_struct.h> 35 + #include <linux/posix_acl.h> 35 36 #include <asm/uaccess.h> 36 37 37 38 #include "internal.h" ··· 174 173 EXPORT_SYMBOL(putname); 175 174 #endif 176 175 176 + static int check_acl(struct inode *inode, int mask) 177 + { 178 + struct posix_acl *acl; 179 + 180 + /* 181 + * Under RCU walk, we cannot even do a "get_cached_acl()", 182 + * because that involves locking and getting a refcount on 183 + * a cached ACL. 184 + * 185 + * So the only case we handle during RCU walking is the 186 + * case of a cached "no ACL at all", which needs no locks 187 + * or refcounts. 188 + */ 189 + if (mask & MAY_NOT_BLOCK) { 190 + if (negative_cached_acl(inode, ACL_TYPE_ACCESS)) 191 + return -EAGAIN; 192 + return -ECHILD; 193 + } 194 + 195 + acl = get_cached_acl(inode, ACL_TYPE_ACCESS); 196 + 197 + /* 198 + * A filesystem can force a ACL callback by just never filling the 199 + * ACL cache. But normally you'd fill the cache either at inode 200 + * instantiation time, or on the first ->get_acl call. 201 + * 202 + * If the filesystem doesn't have a get_acl() function at all, we'll 203 + * just create the negative cache entry. 204 + */ 205 + if (acl == ACL_NOT_CACHED) { 206 + if (inode->i_op->get_acl) { 207 + acl = inode->i_op->get_acl(inode, ACL_TYPE_ACCESS); 208 + if (IS_ERR(acl)) 209 + return PTR_ERR(acl); 210 + } else { 211 + set_cached_acl(inode, ACL_TYPE_ACCESS, NULL); 212 + return -EAGAIN; 213 + } 214 + } 215 + 216 + if (acl) { 217 + int error = posix_acl_permission(inode, acl, mask); 218 + posix_acl_release(acl); 219 + return error; 220 + } 221 + 222 + return -EAGAIN; 223 + } 224 + 177 225 /* 178 226 * This does basic POSIX ACL permission checking 179 227 */ 180 228 static int acl_permission_check(struct inode *inode, int mask) 181 229 { 182 - int (*check_acl)(struct inode *inode, int mask); 183 230 unsigned int mode = inode->i_mode; 184 231 185 232 mask &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_NOT_BLOCK; ··· 238 189 if (current_fsuid() == inode->i_uid) 239 190 mode >>= 6; 240 191 else { 241 - check_acl = inode->i_op->check_acl; 242 - if (IS_POSIXACL(inode) && (mode & S_IRWXG) && check_acl) { 192 + if (IS_POSIXACL(inode) && (mode & S_IRWXG)) { 243 193 int error = check_acl(inode, mask); 244 194 if (error != -EAGAIN) 245 195 return error;
+20 -1
fs/namespace.c
··· 2721 2721 2722 2722 struct vfsmount *kern_mount_data(struct file_system_type *type, void *data) 2723 2723 { 2724 - return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data); 2724 + struct vfsmount *mnt; 2725 + mnt = vfs_kern_mount(type, MS_KERNMOUNT, type->name, data); 2726 + if (!IS_ERR(mnt)) { 2727 + /* 2728 + * it is a longterm mount, don't release mnt until 2729 + * we unmount before file sys is unregistered 2730 + */ 2731 + mnt_make_longterm(mnt); 2732 + } 2733 + return mnt; 2725 2734 } 2726 2735 EXPORT_SYMBOL_GPL(kern_mount_data); 2736 + 2737 + void kern_unmount(struct vfsmount *mnt) 2738 + { 2739 + /* release long term mount so mount point can be released */ 2740 + if (!IS_ERR_OR_NULL(mnt)) { 2741 + mnt_make_shortterm(mnt); 2742 + mntput(mnt); 2743 + } 2744 + } 2745 + EXPORT_SYMBOL(kern_unmount);
+3 -7
fs/nfs/nfs3acl.c
··· 427 427 } 428 428 if (!dfacl) 429 429 return 0; 430 - acl = posix_acl_clone(dfacl, GFP_KERNEL); 431 - error = -ENOMEM; 432 - if (!acl) 433 - goto out_release_dfacl; 434 - error = posix_acl_create_masq(acl, &mode); 430 + acl = posix_acl_dup(dfacl); 431 + error = posix_acl_create(&acl, GFP_KERNEL, &mode); 435 432 if (error < 0) 436 - goto out_release_acl; 433 + goto out_release_dfacl; 437 434 error = nfs3_proc_setacls(inode, acl, S_ISDIR(inode->i_mode) ? 438 435 dfacl : NULL); 439 - out_release_acl: 440 436 posix_acl_release(acl); 441 437 out_release_dfacl: 442 438 posix_acl_release(dfacl);
+26 -51
fs/ocfs2/acl.c
··· 290 290 return ret; 291 291 } 292 292 293 - int ocfs2_check_acl(struct inode *inode, int mask) 293 + struct posix_acl *ocfs2_iop_get_acl(struct inode *inode, int type) 294 294 { 295 295 struct ocfs2_super *osb; 296 296 struct buffer_head *di_bh = NULL; 297 297 struct posix_acl *acl; 298 298 int ret = -EAGAIN; 299 299 300 - if (mask & MAY_NOT_BLOCK) 301 - return -ECHILD; 302 - 303 300 osb = OCFS2_SB(inode->i_sb); 304 301 if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL)) 305 - return ret; 302 + return NULL; 306 303 307 304 ret = ocfs2_read_inode_block(inode, &di_bh); 308 - if (ret < 0) { 309 - mlog_errno(ret); 310 - return ret; 311 - } 305 + if (ret < 0) 306 + return ERR_PTR(ret); 312 307 313 - acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, di_bh); 308 + acl = ocfs2_get_acl_nolock(inode, type, di_bh); 314 309 315 310 brelse(di_bh); 316 311 317 - if (IS_ERR(acl)) { 318 - mlog_errno(PTR_ERR(acl)); 319 - return PTR_ERR(acl); 320 - } 321 - if (acl) { 322 - ret = posix_acl_permission(inode, acl, mask); 323 - posix_acl_release(acl); 324 - return ret; 325 - } 326 - 327 - return -EAGAIN; 312 + return acl; 328 313 } 329 314 330 315 int ocfs2_acl_chmod(struct inode *inode) 331 316 { 332 317 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 333 - struct posix_acl *acl, *clone; 318 + struct posix_acl *acl; 334 319 int ret; 335 320 336 321 if (S_ISLNK(inode->i_mode)) ··· 327 342 acl = ocfs2_get_acl(inode, ACL_TYPE_ACCESS); 328 343 if (IS_ERR(acl) || !acl) 329 344 return PTR_ERR(acl); 330 - clone = posix_acl_clone(acl, GFP_KERNEL); 345 + ret = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 346 + if (ret) 347 + return ret; 348 + ret = ocfs2_set_acl(NULL, inode, NULL, ACL_TYPE_ACCESS, 349 + acl, NULL, NULL); 331 350 posix_acl_release(acl); 332 - if (!clone) 333 - return -ENOMEM; 334 - ret = posix_acl_chmod_masq(clone, inode->i_mode); 335 - if (!ret) 336 - ret = ocfs2_set_acl(NULL, inode, NULL, ACL_TYPE_ACCESS, 337 - clone, NULL, NULL); 338 - posix_acl_release(clone); 339 351 return ret; 340 352 } 341 353 ··· 370 388 } 371 389 } 372 390 if ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) && acl) { 373 - struct posix_acl *clone; 374 - 375 391 if (S_ISDIR(inode->i_mode)) { 376 392 ret = ocfs2_set_acl(handle, inode, di_bh, 377 393 ACL_TYPE_DEFAULT, acl, ··· 377 397 if (ret) 378 398 goto cleanup; 379 399 } 380 - clone = posix_acl_clone(acl, GFP_NOFS); 381 - ret = -ENOMEM; 382 - if (!clone) 383 - goto cleanup; 384 - 385 400 mode = inode->i_mode; 386 - ret = posix_acl_create_masq(clone, &mode); 387 - if (ret >= 0) { 388 - ret2 = ocfs2_acl_set_mode(inode, di_bh, handle, mode); 389 - if (ret2) { 390 - mlog_errno(ret2); 391 - ret = ret2; 392 - goto cleanup; 393 - } 394 - if (ret > 0) { 395 - ret = ocfs2_set_acl(handle, inode, 396 - di_bh, ACL_TYPE_ACCESS, 397 - clone, meta_ac, data_ac); 398 - } 401 + ret = posix_acl_create(&acl, GFP_NOFS, &mode); 402 + if (ret < 0) 403 + return ret; 404 + 405 + ret2 = ocfs2_acl_set_mode(inode, di_bh, handle, mode); 406 + if (ret2) { 407 + mlog_errno(ret2); 408 + ret = ret2; 409 + goto cleanup; 399 410 } 400 - posix_acl_release(clone); 411 + if (ret > 0) { 412 + ret = ocfs2_set_acl(handle, inode, 413 + di_bh, ACL_TYPE_ACCESS, 414 + acl, meta_ac, data_ac); 415 + } 401 416 } 402 417 cleanup: 403 418 posix_acl_release(acl);
+1 -1
fs/ocfs2/acl.h
··· 26 26 __le32 e_id; 27 27 }; 28 28 29 - extern int ocfs2_check_acl(struct inode *, int); 29 + struct posix_acl *ocfs2_iop_get_acl(struct inode *inode, int type); 30 30 extern int ocfs2_acl_chmod(struct inode *); 31 31 extern int ocfs2_init_acl(handle_t *, struct inode *, struct inode *, 32 32 struct buffer_head *, struct buffer_head *,
+2 -2
fs/ocfs2/file.c
··· 2600 2600 .listxattr = ocfs2_listxattr, 2601 2601 .removexattr = generic_removexattr, 2602 2602 .fiemap = ocfs2_fiemap, 2603 - .check_acl = ocfs2_check_acl, 2603 + .get_acl = ocfs2_iop_get_acl, 2604 2604 }; 2605 2605 2606 2606 const struct inode_operations ocfs2_special_file_iops = { 2607 2607 .setattr = ocfs2_setattr, 2608 2608 .getattr = ocfs2_getattr, 2609 2609 .permission = ocfs2_permission, 2610 - .check_acl = ocfs2_check_acl, 2610 + .get_acl = ocfs2_iop_get_acl, 2611 2611 }; 2612 2612 2613 2613 /*
+1 -1
fs/ocfs2/namei.c
··· 2498 2498 .listxattr = ocfs2_listxattr, 2499 2499 .removexattr = generic_removexattr, 2500 2500 .fiemap = ocfs2_fiemap, 2501 - .check_acl = ocfs2_check_acl, 2501 + .get_acl = ocfs2_iop_get_acl, 2502 2502 };
+1 -1
fs/pipe.c
··· 1291 1291 1292 1292 static void __exit exit_pipe_fs(void) 1293 1293 { 1294 + kern_unmount(pipe_mnt); 1294 1295 unregister_filesystem(&pipe_fs_type); 1295 - mntput(pipe_mnt); 1296 1296 } 1297 1297 1298 1298 fs_initcall(init_pipe_fs);
+39 -9
fs/posix_acl.c
··· 24 24 25 25 EXPORT_SYMBOL(posix_acl_init); 26 26 EXPORT_SYMBOL(posix_acl_alloc); 27 - EXPORT_SYMBOL(posix_acl_clone); 28 27 EXPORT_SYMBOL(posix_acl_valid); 29 28 EXPORT_SYMBOL(posix_acl_equiv_mode); 30 29 EXPORT_SYMBOL(posix_acl_from_mode); 31 - EXPORT_SYMBOL(posix_acl_create_masq); 32 - EXPORT_SYMBOL(posix_acl_chmod_masq); 33 - EXPORT_SYMBOL(posix_acl_permission); 34 30 35 31 /* 36 32 * Init a fresh posix_acl ··· 55 59 /* 56 60 * Clone an ACL. 57 61 */ 58 - struct posix_acl * 62 + static struct posix_acl * 59 63 posix_acl_clone(const struct posix_acl *acl, gfp_t flags) 60 64 { 61 65 struct posix_acl *clone = NULL; ··· 279 283 * system calls. All permissions that are not granted by the acl are removed. 280 284 * The permissions in the acl are changed to reflect the mode_p parameter. 281 285 */ 282 - int 283 - posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p) 286 + static int posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p) 284 287 { 285 288 struct posix_acl_entry *pa, *pe; 286 289 struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; ··· 336 341 /* 337 342 * Modify the ACL for the chmod syscall. 338 343 */ 339 - int 340 - posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) 344 + static int posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) 341 345 { 342 346 struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; 343 347 struct posix_acl_entry *pa, *pe; ··· 380 386 381 387 return 0; 382 388 } 389 + 390 + int 391 + posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p) 392 + { 393 + struct posix_acl *clone = posix_acl_clone(*acl, gfp); 394 + int err = -ENOMEM; 395 + if (clone) { 396 + err = posix_acl_create_masq(clone, mode_p); 397 + if (err < 0) { 398 + posix_acl_release(clone); 399 + clone = NULL; 400 + } 401 + } 402 + posix_acl_release(*acl); 403 + *acl = clone; 404 + return err; 405 + } 406 + EXPORT_SYMBOL(posix_acl_create); 407 + 408 + int 409 + posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode) 410 + { 411 + struct posix_acl *clone = posix_acl_clone(*acl, gfp); 412 + int err = -ENOMEM; 413 + if (clone) { 414 + err = posix_acl_chmod_masq(clone, mode); 415 + if (err) { 416 + posix_acl_release(clone); 417 + clone = NULL; 418 + } 419 + } 420 + posix_acl_release(*acl); 421 + *acl = clone; 422 + return err; 423 + } 424 + EXPORT_SYMBOL(posix_acl_chmod);
+1 -1
fs/reiserfs/file.c
··· 319 319 .listxattr = reiserfs_listxattr, 320 320 .removexattr = reiserfs_removexattr, 321 321 .permission = reiserfs_permission, 322 - .check_acl = reiserfs_check_acl, 322 + .get_acl = reiserfs_get_acl, 323 323 };
+5
fs/reiserfs/inode.c
··· 1475 1475 1476 1476 reiserfs_check_path(&path_to_sd); /* init inode should be relsing */ 1477 1477 1478 + /* 1479 + * Stat data v1 doesn't support ACLs. 1480 + */ 1481 + if (get_inode_sd_version(inode) == STAT_DATA_V1) 1482 + cache_no_acl(inode); 1478 1483 } 1479 1484 1480 1485 /**
+3 -3
fs/reiserfs/namei.c
··· 1529 1529 .listxattr = reiserfs_listxattr, 1530 1530 .removexattr = reiserfs_removexattr, 1531 1531 .permission = reiserfs_permission, 1532 - .check_acl = reiserfs_check_acl, 1532 + .get_acl = reiserfs_get_acl, 1533 1533 }; 1534 1534 1535 1535 /* ··· 1546 1546 .listxattr = reiserfs_listxattr, 1547 1547 .removexattr = reiserfs_removexattr, 1548 1548 .permission = reiserfs_permission, 1549 - .check_acl = reiserfs_check_acl, 1549 + .get_acl = reiserfs_get_acl, 1550 1550 1551 1551 }; 1552 1552 ··· 1560 1560 .listxattr = reiserfs_listxattr, 1561 1561 .removexattr = reiserfs_removexattr, 1562 1562 .permission = reiserfs_permission, 1563 - .check_acl = reiserfs_check_acl, 1563 + .get_acl = reiserfs_get_acl, 1564 1564 };
-27
fs/reiserfs/xattr.c
··· 867 867 return err; 868 868 } 869 869 870 - int reiserfs_check_acl(struct inode *inode, int mask) 871 - { 872 - struct posix_acl *acl; 873 - int error = -EAGAIN; /* do regular unix permission checks by default */ 874 - 875 - /* 876 - * Stat data v1 doesn't support ACLs. 877 - */ 878 - if (get_inode_sd_version(inode) == STAT_DATA_V1) 879 - return -EAGAIN; 880 - 881 - if (mask & MAY_NOT_BLOCK) 882 - return -ECHILD; 883 - 884 - acl = reiserfs_get_acl(inode, ACL_TYPE_ACCESS); 885 - 886 - if (acl) { 887 - if (!IS_ERR(acl)) { 888 - error = posix_acl_permission(inode, acl, mask); 889 - posix_acl_release(acl); 890 - } else if (PTR_ERR(acl) != -ENODATA) 891 - error = PTR_ERR(acl); 892 - } 893 - 894 - return error; 895 - } 896 - 897 870 static int create_privroot(struct dentry *dentry) 898 871 { 899 872 int err;
+25 -46
fs/reiserfs/xattr_acl.c
··· 354 354 return PTR_ERR(acl); 355 355 356 356 if (acl) { 357 - struct posix_acl *acl_copy; 358 357 mode_t mode = inode->i_mode; 359 - int need_acl; 360 358 361 359 /* Copy the default ACL to the default ACL of a new directory */ 362 360 if (S_ISDIR(inode->i_mode)) { ··· 366 368 367 369 /* Now we reconcile the new ACL and the mode, 368 370 potentially modifying both */ 369 - acl_copy = posix_acl_clone(acl, GFP_NOFS); 370 - if (!acl_copy) { 371 - err = -ENOMEM; 372 - goto cleanup; 373 - } 371 + err = posix_acl_create(&acl, GFP_NOFS, &mode); 372 + if (err < 0) 373 + return err; 374 374 375 - need_acl = posix_acl_create_masq(acl_copy, &mode); 376 - if (need_acl >= 0) { 377 - if (mode != inode->i_mode) { 378 - inode->i_mode = mode; 379 - } 375 + inode->i_mode = mode; 380 376 381 - /* If we need an ACL.. */ 382 - if (need_acl > 0) { 383 - err = reiserfs_set_acl(th, inode, 384 - ACL_TYPE_ACCESS, 385 - acl_copy); 386 - if (err) 387 - goto cleanup_copy; 388 - } 389 - } 390 - cleanup_copy: 391 - posix_acl_release(acl_copy); 377 + /* If we need an ACL.. */ 378 + if (err > 0) 379 + err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl); 392 380 cleanup: 393 381 posix_acl_release(acl); 394 382 } else { ··· 429 445 430 446 int reiserfs_acl_chmod(struct inode *inode) 431 447 { 432 - struct posix_acl *acl, *clone; 448 + struct reiserfs_transaction_handle th; 449 + struct posix_acl *acl; 450 + size_t size; 451 + int depth; 433 452 int error; 434 453 435 454 if (S_ISLNK(inode->i_mode)) ··· 450 463 return 0; 451 464 if (IS_ERR(acl)) 452 465 return PTR_ERR(acl); 453 - clone = posix_acl_clone(acl, GFP_NOFS); 454 - posix_acl_release(acl); 455 - if (!clone) 456 - return -ENOMEM; 457 - error = posix_acl_chmod_masq(clone, inode->i_mode); 458 - if (!error) { 459 - struct reiserfs_transaction_handle th; 460 - size_t size = reiserfs_xattr_nblocks(inode, 461 - reiserfs_acl_size(clone->a_count)); 462 - int depth; 466 + error = posix_acl_chmod(&acl, GFP_NOFS, inode->i_mode); 467 + if (error) 468 + return error; 463 469 464 - depth = reiserfs_write_lock_once(inode->i_sb); 465 - error = journal_begin(&th, inode->i_sb, size * 2); 466 - if (!error) { 467 - int error2; 468 - error = reiserfs_set_acl(&th, inode, ACL_TYPE_ACCESS, 469 - clone); 470 - error2 = journal_end(&th, inode->i_sb, size * 2); 471 - if (error2) 472 - error = error2; 473 - } 474 - reiserfs_write_unlock_once(inode->i_sb, depth); 470 + size = reiserfs_xattr_nblocks(inode, reiserfs_acl_size(acl->a_count)); 471 + depth = reiserfs_write_lock_once(inode->i_sb); 472 + error = journal_begin(&th, inode->i_sb, size * 2); 473 + if (!error) { 474 + int error2; 475 + error = reiserfs_set_acl(&th, inode, ACL_TYPE_ACCESS, acl); 476 + error2 = journal_end(&th, inode->i_sb, size * 2); 477 + if (error2) 478 + error = error2; 475 479 } 476 - posix_acl_release(clone); 480 + reiserfs_write_unlock_once(inode->i_sb, depth); 481 + posix_acl_release(acl); 477 482 return error; 478 483 } 479 484
+19 -61
fs/xfs/linux-2.6/xfs_acl.c
··· 114 114 if (acl != ACL_NOT_CACHED) 115 115 return acl; 116 116 117 + trace_xfs_get_acl(ip); 118 + 117 119 switch (type) { 118 120 case ACL_TYPE_ACCESS: 119 121 ea_name = SGI_ACL_FILE; ··· 220 218 return error; 221 219 } 222 220 223 - int 224 - xfs_check_acl(struct inode *inode, int mask) 225 - { 226 - struct xfs_inode *ip; 227 - struct posix_acl *acl; 228 - int error = -EAGAIN; 229 - 230 - ip = XFS_I(inode); 231 - trace_xfs_check_acl(ip); 232 - 233 - /* 234 - * If there is no attribute fork no ACL exists on this inode and 235 - * we can skip the whole exercise. 236 - */ 237 - if (!XFS_IFORK_Q(ip)) 238 - return -EAGAIN; 239 - 240 - if (mask & MAY_NOT_BLOCK) { 241 - if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) 242 - return -ECHILD; 243 - return -EAGAIN; 244 - } 245 - 246 - acl = xfs_get_acl(inode, ACL_TYPE_ACCESS); 247 - if (IS_ERR(acl)) 248 - return PTR_ERR(acl); 249 - if (acl) { 250 - error = posix_acl_permission(inode, acl, mask); 251 - posix_acl_release(acl); 252 - } 253 - 254 - return error; 255 - } 256 - 257 221 static int 258 222 xfs_set_mode(struct inode *inode, mode_t mode) 259 223 { ··· 265 297 * No need for i_mutex because the inode is not yet exposed to the VFS. 266 298 */ 267 299 int 268 - xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl) 300 + xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) 269 301 { 270 - struct posix_acl *clone; 271 - mode_t mode; 302 + mode_t mode = inode->i_mode; 272 303 int error = 0, inherit = 0; 273 304 274 305 if (S_ISDIR(inode->i_mode)) { 275 - error = xfs_set_acl(inode, ACL_TYPE_DEFAULT, default_acl); 306 + error = xfs_set_acl(inode, ACL_TYPE_DEFAULT, acl); 276 307 if (error) 277 - return error; 308 + goto out; 278 309 } 279 310 280 - clone = posix_acl_clone(default_acl, GFP_KERNEL); 281 - if (!clone) 282 - return -ENOMEM; 283 - 284 - mode = inode->i_mode; 285 - error = posix_acl_create_masq(clone, &mode); 311 + error = posix_acl_create(&acl, GFP_KERNEL, &mode); 286 312 if (error < 0) 287 - goto out_release_clone; 313 + return error; 288 314 289 315 /* 290 - * If posix_acl_create_masq returns a positive value we need to 316 + * If posix_acl_create returns a positive value we need to 291 317 * inherit a permission that can't be represented using the Unix 292 318 * mode bits and we actually need to set an ACL. 293 319 */ ··· 290 328 291 329 error = xfs_set_mode(inode, mode); 292 330 if (error) 293 - goto out_release_clone; 331 + goto out; 294 332 295 333 if (inherit) 296 - error = xfs_set_acl(inode, ACL_TYPE_ACCESS, clone); 334 + error = xfs_set_acl(inode, ACL_TYPE_ACCESS, acl); 297 335 298 - out_release_clone: 299 - posix_acl_release(clone); 336 + out: 337 + posix_acl_release(acl); 300 338 return error; 301 339 } 302 340 303 341 int 304 342 xfs_acl_chmod(struct inode *inode) 305 343 { 306 - struct posix_acl *acl, *clone; 344 + struct posix_acl *acl; 307 345 int error; 308 346 309 347 if (S_ISLNK(inode->i_mode)) ··· 313 351 if (IS_ERR(acl) || !acl) 314 352 return PTR_ERR(acl); 315 353 316 - clone = posix_acl_clone(acl, GFP_KERNEL); 354 + error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 355 + if (error) 356 + return error; 357 + 358 + error = xfs_set_acl(inode, ACL_TYPE_ACCESS, acl); 317 359 posix_acl_release(acl); 318 - if (!clone) 319 - return -ENOMEM; 320 - 321 - error = posix_acl_chmod_masq(clone, inode->i_mode); 322 - if (!error) 323 - error = xfs_set_acl(inode, ACL_TYPE_ACCESS, clone); 324 - 325 - posix_acl_release(clone); 326 360 return error; 327 361 } 328 362
+4 -1
fs/xfs/linux-2.6/xfs_file.c
··· 881 881 /* Handle various SYNC-type writes */ 882 882 if ((file->f_flags & O_DSYNC) || IS_SYNC(inode)) { 883 883 loff_t end = pos + ret - 1; 884 + int error; 884 885 885 886 xfs_rw_iunlock(ip, iolock); 886 - ret = -xfs_file_fsync(file, pos, end, 887 + error = xfs_file_fsync(file, pos, end, 887 888 (file->f_flags & __O_SYNC) ? 0 : 1); 888 889 xfs_rw_ilock(ip, iolock); 890 + if (error) 891 + ret = error; 889 892 } 890 893 891 894 out_unlock:
+9 -5
fs/xfs/linux-2.6/xfs_iops.c
··· 202 202 203 203 if (default_acl) { 204 204 error = -xfs_inherit_acl(inode, default_acl); 205 + default_acl = NULL; 205 206 if (unlikely(error)) 206 207 goto out_cleanup_inode; 207 - posix_acl_release(default_acl); 208 208 } 209 209 210 210 ··· 1022 1022 } 1023 1023 1024 1024 static const struct inode_operations xfs_inode_operations = { 1025 - .check_acl = xfs_check_acl, 1025 + .get_acl = xfs_get_acl, 1026 1026 .getattr = xfs_vn_getattr, 1027 1027 .setattr = xfs_vn_setattr, 1028 1028 .setxattr = generic_setxattr, ··· 1048 1048 .rmdir = xfs_vn_unlink, 1049 1049 .mknod = xfs_vn_mknod, 1050 1050 .rename = xfs_vn_rename, 1051 - .check_acl = xfs_check_acl, 1051 + .get_acl = xfs_get_acl, 1052 1052 .getattr = xfs_vn_getattr, 1053 1053 .setattr = xfs_vn_setattr, 1054 1054 .setxattr = generic_setxattr, ··· 1073 1073 .rmdir = xfs_vn_unlink, 1074 1074 .mknod = xfs_vn_mknod, 1075 1075 .rename = xfs_vn_rename, 1076 - .check_acl = xfs_check_acl, 1076 + .get_acl = xfs_get_acl, 1077 1077 .getattr = xfs_vn_getattr, 1078 1078 .setattr = xfs_vn_setattr, 1079 1079 .setxattr = generic_setxattr, ··· 1086 1086 .readlink = generic_readlink, 1087 1087 .follow_link = xfs_vn_follow_link, 1088 1088 .put_link = xfs_vn_put_link, 1089 - .check_acl = xfs_check_acl, 1089 + .get_acl = xfs_get_acl, 1090 1090 .getattr = xfs_vn_getattr, 1091 1091 .setattr = xfs_vn_setattr, 1092 1092 .setxattr = generic_setxattr, ··· 1193 1193 init_special_inode(inode, inode->i_mode, inode->i_rdev); 1194 1194 break; 1195 1195 } 1196 + 1197 + /* if there is no attribute fork no ACL can exist on this inode */ 1198 + if (!XFS_IFORK_Q(ip)) 1199 + cache_no_acl(inode); 1196 1200 1197 1201 xfs_iflags_clear(ip, XFS_INEW); 1198 1202 barrier();
+1 -1
fs/xfs/linux-2.6/xfs_trace.h
··· 571 571 DEFINE_INODE_EVENT(xfs_free_file_space); 572 572 DEFINE_INODE_EVENT(xfs_readdir); 573 573 #ifdef CONFIG_XFS_POSIX_ACL 574 - DEFINE_INODE_EVENT(xfs_check_acl); 574 + DEFINE_INODE_EVENT(xfs_get_acl); 575 575 #endif 576 576 DEFINE_INODE_EVENT(xfs_vm_bmap); 577 577 DEFINE_INODE_EVENT(xfs_file_ioctl);
-2
fs/xfs/xfs_acl.h
··· 42 42 #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) 43 43 44 44 #ifdef CONFIG_XFS_POSIX_ACL 45 - extern int xfs_check_acl(struct inode *inode, int mask); 46 45 extern struct posix_acl *xfs_get_acl(struct inode *inode, int type); 47 46 extern int xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl); 48 47 extern int xfs_acl_chmod(struct inode *inode); ··· 51 52 extern const struct xattr_handler xfs_xattr_acl_access_handler; 52 53 extern const struct xattr_handler xfs_xattr_acl_default_handler; 53 54 #else 54 - # define xfs_check_acl NULL 55 55 # define xfs_get_acl(inode, type) NULL 56 56 # define xfs_inherit_acl(inode, default_acl) 0 57 57 # define xfs_acl_chmod(inode) 0
+2 -1
include/linux/fs.h
··· 1582 1582 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1583 1583 void * (*follow_link) (struct dentry *, struct nameidata *); 1584 1584 int (*permission) (struct inode *, int); 1585 - int (*check_acl)(struct inode *, int); 1585 + struct posix_acl * (*get_acl)(struct inode *, int); 1586 1586 1587 1587 int (*readlink) (struct dentry *, char __user *,int); 1588 1588 void (*put_link) (struct dentry *, struct nameidata *, void *); ··· 1881 1881 extern int unregister_filesystem(struct file_system_type *); 1882 1882 extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); 1883 1883 #define kern_mount(type) kern_mount_data(type, NULL) 1884 + extern void kern_unmount(struct vfsmount *mnt); 1884 1885 extern int may_umount_tree(struct vfsmount *); 1885 1886 extern int may_umount(struct vfsmount *); 1886 1887 extern long do_mount(char *, char *, char *, unsigned long, void *);
-1
include/linux/generic_acl.h
··· 10 10 11 11 int generic_acl_init(struct inode *, struct inode *); 12 12 int generic_acl_chmod(struct inode *); 13 - int generic_check_acl(struct inode *inode, int mask); 14 13 15 14 #endif /* LINUX_GENERIC_ACL_H */
+2 -3
include/linux/posix_acl.h
··· 73 73 74 74 extern void posix_acl_init(struct posix_acl *, int); 75 75 extern struct posix_acl *posix_acl_alloc(int, gfp_t); 76 - extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); 77 76 extern int posix_acl_valid(const struct posix_acl *); 78 77 extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 79 78 extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); 80 79 extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 81 - extern int posix_acl_create_masq(struct posix_acl *, mode_t *); 82 - extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); 80 + extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *); 81 + extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); 83 82 84 83 extern struct posix_acl *get_posix_acl(struct inode *, int); 85 84 extern int set_posix_acl(struct inode *, int, struct posix_acl *);
+1 -5
include/linux/reiserfs_acl.h
··· 59 59 #else 60 60 61 61 #define reiserfs_cache_default_acl(inode) 0 62 - 63 - static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) 64 - { 65 - return NULL; 66 - } 62 + #define reiserfs_get_acl NULL 67 63 68 64 static inline int reiserfs_acl_chmod(struct inode *inode) 69 65 {
-2
include/linux/reiserfs_xattr.h
··· 45 45 46 46 #ifdef CONFIG_REISERFS_FS_XATTR 47 47 #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 48 - int reiserfs_check_acl(struct inode *inode, int mask); 49 48 ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, 50 49 void *buffer, size_t size); 51 50 int reiserfs_setxattr(struct dentry *dentry, const char *name, ··· 122 123 #define reiserfs_setxattr NULL 123 124 #define reiserfs_listxattr NULL 124 125 #define reiserfs_removexattr NULL 125 - #define reiserfs_check_acl NULL 126 126 127 127 static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 128 128 {
-6
mm/shmem.c
··· 2715 2715 .listxattr = shmem_listxattr, 2716 2716 .removexattr = shmem_removexattr, 2717 2717 #endif 2718 - #ifdef CONFIG_TMPFS_POSIX_ACL 2719 - .check_acl = generic_check_acl, 2720 - #endif 2721 - 2722 2718 }; 2723 2719 2724 2720 static const struct inode_operations shmem_dir_inode_operations = { ··· 2737 2741 #endif 2738 2742 #ifdef CONFIG_TMPFS_POSIX_ACL 2739 2743 .setattr = shmem_setattr, 2740 - .check_acl = generic_check_acl, 2741 2744 #endif 2742 2745 }; 2743 2746 ··· 2749 2754 #endif 2750 2755 #ifdef CONFIG_TMPFS_POSIX_ACL 2751 2756 .setattr = shmem_setattr, 2752 - .check_acl = generic_check_acl, 2753 2757 #endif 2754 2758 }; 2755 2759
+1
security/selinux/selinuxfs.c
··· 1984 1984 void exit_sel_fs(void) 1985 1985 { 1986 1986 kobject_put(selinuxfs_kobj); 1987 + kern_unmount(selinuxfs_mount); 1987 1988 unregister_filesystem(&sel_fs_type); 1988 1989 } 1989 1990 #endif
+1 -1
sound/core/info.c
··· 531 531 { 532 532 struct proc_dir_entry *p; 533 533 534 - p = create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL); 534 + p = proc_mkdir("asound", NULL); 535 535 if (p == NULL) 536 536 return -ENOMEM; 537 537 snd_proc_root = p;