diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-01 19:48:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-01 19:48:31 -0400 |
commit | 1b8e94993c4752d98c33903aa836acc15f7e6d5c (patch) | |
tree | b78cba208f0a193ce6ceebbc146021af4425b4e1 /fs | |
parent | 12ff47e7f5fb64c566f62e6cf6a3b291c51bd337 (diff) | |
parent | 206d440f64030b6425841bf7cb38e26a5ea0c382 (diff) |
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:
xfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set
VFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock
VFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()
VFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()
switch posix_acl_chmod() to umode_t
switch posix_acl_from_mode() to umode_t
switch posix_acl_equiv_mode() to umode_t *
switch posix_acl_create() to umode_t *
block: initialise bd_super in bdget()
vfs: avoid call to inode_lru_list_del() if possible
vfs: avoid taking inode_hash_lock on pipes and sockets
vfs: conditionally call inode_wb_list_del()
VFS: Fix automount for negative autofs dentries
Btrfs: load the key from the dir item in readdir into a fake dentry
devtmpfs: missing initialialization in never-hit case
hppfs: missing include
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/acl.c | 6 | ||||
-rw-r--r-- | fs/9p/acl.h | 4 | ||||
-rw-r--r-- | fs/9p/vfs_inode_dotl.c | 6 | ||||
-rw-r--r-- | fs/block_dev.c | 1 | ||||
-rw-r--r-- | fs/btrfs/acl.c | 10 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 47 | ||||
-rw-r--r-- | fs/dcache.c | 69 | ||||
-rw-r--r-- | fs/ext2/acl.c | 8 | ||||
-rw-r--r-- | fs/ext3/acl.c | 9 | ||||
-rw-r--r-- | fs/ext4/acl.c | 9 | ||||
-rw-r--r-- | fs/generic_acl.c | 13 | ||||
-rw-r--r-- | fs/gfs2/acl.c | 6 | ||||
-rw-r--r-- | fs/hppfs/hppfs.c | 1 | ||||
-rw-r--r-- | fs/inode.c | 13 | ||||
-rw-r--r-- | fs/jffs2/acl.c | 4 | ||||
-rw-r--r-- | fs/jffs2/acl.h | 2 | ||||
-rw-r--r-- | fs/jffs2/fs.c | 2 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 2 | ||||
-rw-r--r-- | fs/jfs/acl.c | 4 | ||||
-rw-r--r-- | fs/jfs/xattr.c | 4 | ||||
-rw-r--r-- | fs/namei.c | 24 | ||||
-rw-r--r-- | fs/nfs/nfs3acl.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/acl.c | 4 | ||||
-rw-r--r-- | fs/posix_acl.c | 16 | ||||
-rw-r--r-- | fs/reiserfs/xattr_acl.c | 10 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_acl.c | 6 |
27 files changed, 146 insertions, 142 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index e9cb57f07546..9a1d42630751 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -182,11 +182,11 @@ int v9fs_set_create_acl(struct dentry *dentry, | |||
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
184 | 184 | ||
185 | int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 185 | int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
186 | struct posix_acl **dpacl, struct posix_acl **pacl) | 186 | struct posix_acl **dpacl, struct posix_acl **pacl) |
187 | { | 187 | { |
188 | int retval = 0; | 188 | int retval = 0; |
189 | mode_t mode = *modep; | 189 | umode_t mode = *modep; |
190 | struct posix_acl *acl = NULL; | 190 | struct posix_acl *acl = NULL; |
191 | 191 | ||
192 | if (!S_ISLNK(mode)) { | 192 | if (!S_ISLNK(mode)) { |
@@ -319,7 +319,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name, | |||
319 | case ACL_TYPE_ACCESS: | 319 | case ACL_TYPE_ACCESS: |
320 | name = POSIX_ACL_XATTR_ACCESS; | 320 | name = POSIX_ACL_XATTR_ACCESS; |
321 | if (acl) { | 321 | if (acl) { |
322 | mode_t mode = inode->i_mode; | 322 | umode_t mode = inode->i_mode; |
323 | retval = posix_acl_equiv_mode(acl, &mode); | 323 | retval = posix_acl_equiv_mode(acl, &mode); |
324 | if (retval < 0) | 324 | if (retval < 0) |
325 | goto err_out; | 325 | goto err_out; |
diff --git a/fs/9p/acl.h b/fs/9p/acl.h index ddb7ae19d971..559556411965 100644 --- a/fs/9p/acl.h +++ b/fs/9p/acl.h | |||
@@ -20,7 +20,7 @@ extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type); | |||
20 | extern int v9fs_acl_chmod(struct dentry *); | 20 | extern int v9fs_acl_chmod(struct dentry *); |
21 | extern int v9fs_set_create_acl(struct dentry *, | 21 | extern int v9fs_set_create_acl(struct dentry *, |
22 | struct posix_acl **, struct posix_acl **); | 22 | struct posix_acl **, struct posix_acl **); |
23 | extern int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 23 | extern int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
24 | struct posix_acl **dpacl, struct posix_acl **pacl); | 24 | struct posix_acl **dpacl, struct posix_acl **pacl); |
25 | #else | 25 | #else |
26 | #define v9fs_iop_get_acl NULL | 26 | #define v9fs_iop_get_acl NULL |
@@ -38,7 +38,7 @@ static inline int v9fs_set_create_acl(struct dentry *dentry, | |||
38 | { | 38 | { |
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | static inline int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 41 | static inline int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
42 | struct posix_acl **dpacl, | 42 | struct posix_acl **dpacl, |
43 | struct posix_acl **pacl) | 43 | struct posix_acl **pacl) |
44 | { | 44 | { |
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 9a26dce5a99f..b6c8ed205192 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c | |||
@@ -206,7 +206,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, | |||
206 | int err = 0; | 206 | int err = 0; |
207 | gid_t gid; | 207 | gid_t gid; |
208 | int flags; | 208 | int flags; |
209 | mode_t mode; | 209 | umode_t mode; |
210 | char *name = NULL; | 210 | char *name = NULL; |
211 | struct file *filp; | 211 | struct file *filp; |
212 | struct p9_qid qid; | 212 | struct p9_qid qid; |
@@ -348,7 +348,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, | |||
348 | struct p9_fid *fid = NULL, *dfid = NULL; | 348 | struct p9_fid *fid = NULL, *dfid = NULL; |
349 | gid_t gid; | 349 | gid_t gid; |
350 | char *name; | 350 | char *name; |
351 | mode_t mode; | 351 | umode_t mode; |
352 | struct inode *inode; | 352 | struct inode *inode; |
353 | struct p9_qid qid; | 353 | struct p9_qid qid; |
354 | struct dentry *dir_dentry; | 354 | struct dentry *dir_dentry; |
@@ -751,7 +751,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, | |||
751 | int err; | 751 | int err; |
752 | gid_t gid; | 752 | gid_t gid; |
753 | char *name; | 753 | char *name; |
754 | mode_t mode; | 754 | umode_t mode; |
755 | struct v9fs_session_info *v9ses; | 755 | struct v9fs_session_info *v9ses; |
756 | struct p9_fid *fid = NULL, *dfid = NULL; | 756 | struct p9_fid *fid = NULL, *dfid = NULL; |
757 | struct inode *inode; | 757 | struct inode *inode; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index f55aad4d1611..f28680553288 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev) | |||
552 | 552 | ||
553 | if (inode->i_state & I_NEW) { | 553 | if (inode->i_state & I_NEW) { |
554 | bdev->bd_contains = NULL; | 554 | bdev->bd_contains = NULL; |
555 | bdev->bd_super = NULL; | ||
555 | bdev->bd_inode = inode; | 556 | bdev->bd_inode = inode; |
556 | bdev->bd_block_size = (1 << inode->i_blkbits); | 557 | bdev->bd_block_size = (1 << inode->i_blkbits); |
557 | bdev->bd_part_count = 0; | 558 | bdev->bd_part_count = 0; |
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 65a735d8f6e4..4cc5c0164ed6 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -111,7 +111,6 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans, | |||
111 | int ret, size = 0; | 111 | int ret, size = 0; |
112 | const char *name; | 112 | const char *name; |
113 | char *value = NULL; | 113 | char *value = NULL; |
114 | mode_t mode; | ||
115 | 114 | ||
116 | if (acl) { | 115 | if (acl) { |
117 | ret = posix_acl_valid(acl); | 116 | ret = posix_acl_valid(acl); |
@@ -122,13 +121,11 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans, | |||
122 | 121 | ||
123 | switch (type) { | 122 | switch (type) { |
124 | case ACL_TYPE_ACCESS: | 123 | case ACL_TYPE_ACCESS: |
125 | mode = inode->i_mode; | ||
126 | name = POSIX_ACL_XATTR_ACCESS; | 124 | name = POSIX_ACL_XATTR_ACCESS; |
127 | if (acl) { | 125 | if (acl) { |
128 | ret = posix_acl_equiv_mode(acl, &mode); | 126 | ret = posix_acl_equiv_mode(acl, &inode->i_mode); |
129 | if (ret < 0) | 127 | if (ret < 0) |
130 | return ret; | 128 | return ret; |
131 | inode->i_mode = mode; | ||
132 | } | 129 | } |
133 | ret = 0; | 130 | ret = 0; |
134 | break; | 131 | break; |
@@ -222,19 +219,16 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans, | |||
222 | } | 219 | } |
223 | 220 | ||
224 | if (IS_POSIXACL(dir) && acl) { | 221 | if (IS_POSIXACL(dir) && acl) { |
225 | mode_t mode = inode->i_mode; | ||
226 | |||
227 | if (S_ISDIR(inode->i_mode)) { | 222 | if (S_ISDIR(inode->i_mode)) { |
228 | ret = btrfs_set_acl(trans, inode, acl, | 223 | ret = btrfs_set_acl(trans, inode, acl, |
229 | ACL_TYPE_DEFAULT); | 224 | ACL_TYPE_DEFAULT); |
230 | if (ret) | 225 | if (ret) |
231 | goto failed; | 226 | goto failed; |
232 | } | 227 | } |
233 | ret = posix_acl_create(&acl, GFP_NOFS, &mode); | 228 | ret = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
234 | if (ret < 0) | 229 | if (ret < 0) |
235 | return ret; | 230 | return ret; |
236 | 231 | ||
237 | inode->i_mode = mode; | ||
238 | if (ret > 0) { | 232 | if (ret > 0) { |
239 | /* we need an acl */ | 233 | /* we need an acl */ |
240 | ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); | 234 | ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 13e6255182e3..ae762dab37f8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3993,12 +3993,19 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) | |||
3993 | struct btrfs_root *sub_root = root; | 3993 | struct btrfs_root *sub_root = root; |
3994 | struct btrfs_key location; | 3994 | struct btrfs_key location; |
3995 | int index; | 3995 | int index; |
3996 | int ret; | 3996 | int ret = 0; |
3997 | 3997 | ||
3998 | if (dentry->d_name.len > BTRFS_NAME_LEN) | 3998 | if (dentry->d_name.len > BTRFS_NAME_LEN) |
3999 | return ERR_PTR(-ENAMETOOLONG); | 3999 | return ERR_PTR(-ENAMETOOLONG); |
4000 | 4000 | ||
4001 | ret = btrfs_inode_by_name(dir, dentry, &location); | 4001 | if (unlikely(d_need_lookup(dentry))) { |
4002 | memcpy(&location, dentry->d_fsdata, sizeof(struct btrfs_key)); | ||
4003 | kfree(dentry->d_fsdata); | ||
4004 | dentry->d_fsdata = NULL; | ||
4005 | d_clear_need_lookup(dentry); | ||
4006 | } else { | ||
4007 | ret = btrfs_inode_by_name(dir, dentry, &location); | ||
4008 | } | ||
4002 | 4009 | ||
4003 | if (ret < 0) | 4010 | if (ret < 0) |
4004 | return ERR_PTR(ret); | 4011 | return ERR_PTR(ret); |
@@ -4053,6 +4060,12 @@ static int btrfs_dentry_delete(const struct dentry *dentry) | |||
4053 | return 0; | 4060 | return 0; |
4054 | } | 4061 | } |
4055 | 4062 | ||
4063 | static void btrfs_dentry_release(struct dentry *dentry) | ||
4064 | { | ||
4065 | if (dentry->d_fsdata) | ||
4066 | kfree(dentry->d_fsdata); | ||
4067 | } | ||
4068 | |||
4056 | static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, | 4069 | static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, |
4057 | struct nameidata *nd) | 4070 | struct nameidata *nd) |
4058 | { | 4071 | { |
@@ -4075,6 +4088,7 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, | |||
4075 | struct btrfs_path *path; | 4088 | struct btrfs_path *path; |
4076 | struct list_head ins_list; | 4089 | struct list_head ins_list; |
4077 | struct list_head del_list; | 4090 | struct list_head del_list; |
4091 | struct qstr q; | ||
4078 | int ret; | 4092 | int ret; |
4079 | struct extent_buffer *leaf; | 4093 | struct extent_buffer *leaf; |
4080 | int slot; | 4094 | int slot; |
@@ -4164,6 +4178,7 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, | |||
4164 | 4178 | ||
4165 | while (di_cur < di_total) { | 4179 | while (di_cur < di_total) { |
4166 | struct btrfs_key location; | 4180 | struct btrfs_key location; |
4181 | struct dentry *tmp; | ||
4167 | 4182 | ||
4168 | if (verify_dir_item(root, leaf, di)) | 4183 | if (verify_dir_item(root, leaf, di)) |
4169 | break; | 4184 | break; |
@@ -4184,6 +4199,33 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, | |||
4184 | d_type = btrfs_filetype_table[btrfs_dir_type(leaf, di)]; | 4199 | d_type = btrfs_filetype_table[btrfs_dir_type(leaf, di)]; |
4185 | btrfs_dir_item_key_to_cpu(leaf, di, &location); | 4200 | btrfs_dir_item_key_to_cpu(leaf, di, &location); |
4186 | 4201 | ||
4202 | q.name = name_ptr; | ||
4203 | q.len = name_len; | ||
4204 | q.hash = full_name_hash(q.name, q.len); | ||
4205 | tmp = d_lookup(filp->f_dentry, &q); | ||
4206 | if (!tmp) { | ||
4207 | struct btrfs_key *newkey; | ||
4208 | |||
4209 | newkey = kzalloc(sizeof(struct btrfs_key), | ||
4210 | GFP_NOFS); | ||
4211 | if (!newkey) | ||
4212 | goto no_dentry; | ||
4213 | tmp = d_alloc(filp->f_dentry, &q); | ||
4214 | if (!tmp) { | ||
4215 | kfree(newkey); | ||
4216 | dput(tmp); | ||
4217 | goto no_dentry; | ||
4218 | } | ||
4219 | memcpy(newkey, &location, | ||
4220 | sizeof(struct btrfs_key)); | ||
4221 | tmp->d_fsdata = newkey; | ||
4222 | tmp->d_flags |= DCACHE_NEED_LOOKUP; | ||
4223 | d_rehash(tmp); | ||
4224 | dput(tmp); | ||
4225 | } else { | ||
4226 | dput(tmp); | ||
4227 | } | ||
4228 | no_dentry: | ||
4187 | /* is this a reference to our own snapshot? If so | 4229 | /* is this a reference to our own snapshot? If so |
4188 | * skip it | 4230 | * skip it |
4189 | */ | 4231 | */ |
@@ -7430,4 +7472,5 @@ static const struct inode_operations btrfs_symlink_inode_operations = { | |||
7430 | 7472 | ||
7431 | const struct dentry_operations btrfs_dentry_operations = { | 7473 | const struct dentry_operations btrfs_dentry_operations = { |
7432 | .d_delete = btrfs_dentry_delete, | 7474 | .d_delete = btrfs_dentry_delete, |
7475 | .d_release = btrfs_dentry_release, | ||
7433 | }; | 7476 | }; |
diff --git a/fs/dcache.c b/fs/dcache.c index b05aac3a8cfc..2347cdb15abb 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -301,6 +301,27 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) | |||
301 | return parent; | 301 | return parent; |
302 | } | 302 | } |
303 | 303 | ||
304 | /* | ||
305 | * Unhash a dentry without inserting an RCU walk barrier or checking that | ||
306 | * dentry->d_lock is locked. The caller must take care of that, if | ||
307 | * appropriate. | ||
308 | */ | ||
309 | static void __d_shrink(struct dentry *dentry) | ||
310 | { | ||
311 | if (!d_unhashed(dentry)) { | ||
312 | struct hlist_bl_head *b; | ||
313 | if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) | ||
314 | b = &dentry->d_sb->s_anon; | ||
315 | else | ||
316 | b = d_hash(dentry->d_parent, dentry->d_name.hash); | ||
317 | |||
318 | hlist_bl_lock(b); | ||
319 | __hlist_bl_del(&dentry->d_hash); | ||
320 | dentry->d_hash.pprev = NULL; | ||
321 | hlist_bl_unlock(b); | ||
322 | } | ||
323 | } | ||
324 | |||
304 | /** | 325 | /** |
305 | * d_drop - drop a dentry | 326 | * d_drop - drop a dentry |
306 | * @dentry: dentry to drop | 327 | * @dentry: dentry to drop |
@@ -319,17 +340,7 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) | |||
319 | void __d_drop(struct dentry *dentry) | 340 | void __d_drop(struct dentry *dentry) |
320 | { | 341 | { |
321 | if (!d_unhashed(dentry)) { | 342 | if (!d_unhashed(dentry)) { |
322 | struct hlist_bl_head *b; | 343 | __d_shrink(dentry); |
323 | if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) | ||
324 | b = &dentry->d_sb->s_anon; | ||
325 | else | ||
326 | b = d_hash(dentry->d_parent, dentry->d_name.hash); | ||
327 | |||
328 | hlist_bl_lock(b); | ||
329 | __hlist_bl_del(&dentry->d_hash); | ||
330 | dentry->d_hash.pprev = NULL; | ||
331 | hlist_bl_unlock(b); | ||
332 | |||
333 | dentry_rcuwalk_barrier(dentry); | 344 | dentry_rcuwalk_barrier(dentry); |
334 | } | 345 | } |
335 | } | 346 | } |
@@ -828,44 +839,24 @@ EXPORT_SYMBOL(shrink_dcache_sb); | |||
828 | static void shrink_dcache_for_umount_subtree(struct dentry *dentry) | 839 | static void shrink_dcache_for_umount_subtree(struct dentry *dentry) |
829 | { | 840 | { |
830 | struct dentry *parent; | 841 | struct dentry *parent; |
831 | unsigned detached = 0; | ||
832 | 842 | ||
833 | BUG_ON(!IS_ROOT(dentry)); | 843 | BUG_ON(!IS_ROOT(dentry)); |
834 | 844 | ||
835 | /* detach this root from the system */ | ||
836 | spin_lock(&dentry->d_lock); | ||
837 | dentry_lru_del(dentry); | ||
838 | __d_drop(dentry); | ||
839 | spin_unlock(&dentry->d_lock); | ||
840 | |||
841 | for (;;) { | 845 | for (;;) { |
842 | /* descend to the first leaf in the current subtree */ | 846 | /* descend to the first leaf in the current subtree */ |
843 | while (!list_empty(&dentry->d_subdirs)) { | 847 | while (!list_empty(&dentry->d_subdirs)) |
844 | struct dentry *loop; | ||
845 | |||
846 | /* this is a branch with children - detach all of them | ||
847 | * from the system in one go */ | ||
848 | spin_lock(&dentry->d_lock); | ||
849 | list_for_each_entry(loop, &dentry->d_subdirs, | ||
850 | d_u.d_child) { | ||
851 | spin_lock_nested(&loop->d_lock, | ||
852 | DENTRY_D_LOCK_NESTED); | ||
853 | dentry_lru_del(loop); | ||
854 | __d_drop(loop); | ||
855 | spin_unlock(&loop->d_lock); | ||
856 | } | ||
857 | spin_unlock(&dentry->d_lock); | ||
858 | |||
859 | /* move to the first child */ | ||
860 | dentry = list_entry(dentry->d_subdirs.next, | 848 | dentry = list_entry(dentry->d_subdirs.next, |
861 | struct dentry, d_u.d_child); | 849 | struct dentry, d_u.d_child); |
862 | } | ||
863 | 850 | ||
864 | /* consume the dentries from this leaf up through its parents | 851 | /* consume the dentries from this leaf up through its parents |
865 | * until we find one with children or run out altogether */ | 852 | * until we find one with children or run out altogether */ |
866 | do { | 853 | do { |
867 | struct inode *inode; | 854 | struct inode *inode; |
868 | 855 | ||
856 | /* detach from the system */ | ||
857 | dentry_lru_del(dentry); | ||
858 | __d_shrink(dentry); | ||
859 | |||
869 | if (dentry->d_count != 0) { | 860 | if (dentry->d_count != 0) { |
870 | printk(KERN_ERR | 861 | printk(KERN_ERR |
871 | "BUG: Dentry %p{i=%lx,n=%s}" | 862 | "BUG: Dentry %p{i=%lx,n=%s}" |
@@ -886,14 +877,10 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) | |||
886 | list_del(&dentry->d_u.d_child); | 877 | list_del(&dentry->d_u.d_child); |
887 | } else { | 878 | } else { |
888 | parent = dentry->d_parent; | 879 | parent = dentry->d_parent; |
889 | spin_lock(&parent->d_lock); | ||
890 | parent->d_count--; | 880 | parent->d_count--; |
891 | list_del(&dentry->d_u.d_child); | 881 | list_del(&dentry->d_u.d_child); |
892 | spin_unlock(&parent->d_lock); | ||
893 | } | 882 | } |
894 | 883 | ||
895 | detached++; | ||
896 | |||
897 | inode = dentry->d_inode; | 884 | inode = dentry->d_inode; |
898 | if (inode) { | 885 | if (inode) { |
899 | dentry->d_inode = NULL; | 886 | dentry->d_inode = NULL; |
@@ -938,9 +925,7 @@ void shrink_dcache_for_umount(struct super_block *sb) | |||
938 | 925 | ||
939 | dentry = sb->s_root; | 926 | dentry = sb->s_root; |
940 | sb->s_root = NULL; | 927 | sb->s_root = NULL; |
941 | spin_lock(&dentry->d_lock); | ||
942 | dentry->d_count--; | 928 | dentry->d_count--; |
943 | spin_unlock(&dentry->d_lock); | ||
944 | shrink_dcache_for_umount_subtree(dentry); | 929 | shrink_dcache_for_umount_subtree(dentry); |
945 | 930 | ||
946 | while (!hlist_bl_empty(&sb->s_anon)) { | 931 | while (!hlist_bl_empty(&sb->s_anon)) { |
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 52c053763942..35d6a3cfd9ff 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -194,12 +194,10 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
194 | case ACL_TYPE_ACCESS: | 194 | case ACL_TYPE_ACCESS: |
195 | name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; | 195 | name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; |
196 | if (acl) { | 196 | if (acl) { |
197 | mode_t mode = inode->i_mode; | 197 | error = posix_acl_equiv_mode(acl, &inode->i_mode); |
198 | error = posix_acl_equiv_mode(acl, &mode); | ||
199 | if (error < 0) | 198 | if (error < 0) |
200 | return error; | 199 | return error; |
201 | else { | 200 | else { |
202 | inode->i_mode = mode; | ||
203 | inode->i_ctime = CURRENT_TIME_SEC; | 201 | inode->i_ctime = CURRENT_TIME_SEC; |
204 | mark_inode_dirty(inode); | 202 | mark_inode_dirty(inode); |
205 | if (error == 0) | 203 | if (error == 0) |
@@ -253,16 +251,14 @@ ext2_init_acl(struct inode *inode, struct inode *dir) | |||
253 | inode->i_mode &= ~current_umask(); | 251 | inode->i_mode &= ~current_umask(); |
254 | } | 252 | } |
255 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 253 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
256 | mode_t mode = inode->i_mode; | ||
257 | if (S_ISDIR(inode->i_mode)) { | 254 | if (S_ISDIR(inode->i_mode)) { |
258 | error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl); | 255 | error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl); |
259 | if (error) | 256 | if (error) |
260 | goto cleanup; | 257 | goto cleanup; |
261 | } | 258 | } |
262 | error = posix_acl_create(&acl, GFP_KERNEL, &mode); | 259 | error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
263 | if (error < 0) | 260 | if (error < 0) |
264 | return error; | 261 | return error; |
265 | inode->i_mode = mode; | ||
266 | if (error > 0) { | 262 | if (error > 0) { |
267 | /* This is an extended ACL */ | 263 | /* This is an extended ACL */ |
268 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); | 264 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index 6c29bf0df04a..3091f62e55b6 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c | |||
@@ -199,12 +199,10 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type, | |||
199 | case ACL_TYPE_ACCESS: | 199 | case ACL_TYPE_ACCESS: |
200 | name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS; | 200 | name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS; |
201 | if (acl) { | 201 | if (acl) { |
202 | mode_t mode = inode->i_mode; | 202 | error = posix_acl_equiv_mode(acl, &inode->i_mode); |
203 | error = posix_acl_equiv_mode(acl, &mode); | ||
204 | if (error < 0) | 203 | if (error < 0) |
205 | return error; | 204 | return error; |
206 | else { | 205 | else { |
207 | inode->i_mode = mode; | ||
208 | inode->i_ctime = CURRENT_TIME_SEC; | 206 | inode->i_ctime = CURRENT_TIME_SEC; |
209 | ext3_mark_inode_dirty(handle, inode); | 207 | ext3_mark_inode_dirty(handle, inode); |
210 | if (error == 0) | 208 | if (error == 0) |
@@ -261,19 +259,16 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
261 | inode->i_mode &= ~current_umask(); | 259 | inode->i_mode &= ~current_umask(); |
262 | } | 260 | } |
263 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 261 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
264 | mode_t mode = inode->i_mode; | ||
265 | |||
266 | if (S_ISDIR(inode->i_mode)) { | 262 | if (S_ISDIR(inode->i_mode)) { |
267 | error = ext3_set_acl(handle, inode, | 263 | error = ext3_set_acl(handle, inode, |
268 | ACL_TYPE_DEFAULT, acl); | 264 | ACL_TYPE_DEFAULT, acl); |
269 | if (error) | 265 | if (error) |
270 | goto cleanup; | 266 | goto cleanup; |
271 | } | 267 | } |
272 | error = posix_acl_create(&acl, GFP_NOFS, &mode); | 268 | error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
273 | if (error < 0) | 269 | if (error < 0) |
274 | return error; | 270 | return error; |
275 | 271 | ||
276 | inode->i_mode = mode; | ||
277 | if (error > 0) { | 272 | if (error > 0) { |
278 | /* This is an extended ACL */ | 273 | /* This is an extended ACL */ |
279 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); | 274 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index dca2d1ded931..a5c29bb3b835 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c | |||
@@ -198,12 +198,10 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type, | |||
198 | case ACL_TYPE_ACCESS: | 198 | case ACL_TYPE_ACCESS: |
199 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; | 199 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; |
200 | if (acl) { | 200 | if (acl) { |
201 | mode_t mode = inode->i_mode; | 201 | error = posix_acl_equiv_mode(acl, &inode->i_mode); |
202 | error = posix_acl_equiv_mode(acl, &mode); | ||
203 | if (error < 0) | 202 | if (error < 0) |
204 | return error; | 203 | return error; |
205 | else { | 204 | else { |
206 | inode->i_mode = mode; | ||
207 | inode->i_ctime = ext4_current_time(inode); | 205 | inode->i_ctime = ext4_current_time(inode); |
208 | ext4_mark_inode_dirty(handle, inode); | 206 | ext4_mark_inode_dirty(handle, inode); |
209 | if (error == 0) | 207 | if (error == 0) |
@@ -259,19 +257,16 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
259 | inode->i_mode &= ~current_umask(); | 257 | inode->i_mode &= ~current_umask(); |
260 | } | 258 | } |
261 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 259 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
262 | mode_t mode = inode->i_mode; | ||
263 | |||
264 | if (S_ISDIR(inode->i_mode)) { | 260 | if (S_ISDIR(inode->i_mode)) { |
265 | error = ext4_set_acl(handle, inode, | 261 | error = ext4_set_acl(handle, inode, |
266 | ACL_TYPE_DEFAULT, acl); | 262 | ACL_TYPE_DEFAULT, acl); |
267 | if (error) | 263 | if (error) |
268 | goto cleanup; | 264 | goto cleanup; |
269 | } | 265 | } |
270 | error = posix_acl_create(&acl, GFP_NOFS, &mode); | 266 | error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
271 | if (error < 0) | 267 | if (error < 0) |
272 | return error; | 268 | return error; |
273 | 269 | ||
274 | inode->i_mode = mode; | ||
275 | if (error > 0) { | 270 | if (error > 0) { |
276 | /* This is an extended ACL */ | 271 | /* This is an extended ACL */ |
277 | error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); | 272 | error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/generic_acl.c b/fs/generic_acl.c index d5e33a077a67..d0dddaceac59 100644 --- a/fs/generic_acl.c +++ b/fs/generic_acl.c | |||
@@ -82,18 +82,14 @@ generic_acl_set(struct dentry *dentry, const char *name, const void *value, | |||
82 | return PTR_ERR(acl); | 82 | return PTR_ERR(acl); |
83 | } | 83 | } |
84 | if (acl) { | 84 | if (acl) { |
85 | mode_t mode; | ||
86 | |||
87 | error = posix_acl_valid(acl); | 85 | error = posix_acl_valid(acl); |
88 | if (error) | 86 | if (error) |
89 | goto failed; | 87 | goto failed; |
90 | switch (type) { | 88 | switch (type) { |
91 | case ACL_TYPE_ACCESS: | 89 | case ACL_TYPE_ACCESS: |
92 | mode = inode->i_mode; | 90 | error = posix_acl_equiv_mode(acl, &inode->i_mode); |
93 | error = posix_acl_equiv_mode(acl, &mode); | ||
94 | if (error < 0) | 91 | if (error < 0) |
95 | goto failed; | 92 | goto failed; |
96 | inode->i_mode = mode; | ||
97 | inode->i_ctime = CURRENT_TIME; | 93 | inode->i_ctime = CURRENT_TIME; |
98 | if (error == 0) { | 94 | if (error == 0) { |
99 | posix_acl_release(acl); | 95 | posix_acl_release(acl); |
@@ -125,21 +121,20 @@ int | |||
125 | generic_acl_init(struct inode *inode, struct inode *dir) | 121 | generic_acl_init(struct inode *inode, struct inode *dir) |
126 | { | 122 | { |
127 | struct posix_acl *acl = NULL; | 123 | struct posix_acl *acl = NULL; |
128 | mode_t mode = inode->i_mode; | ||
129 | int error; | 124 | int error; |
130 | 125 | ||
131 | inode->i_mode = mode & ~current_umask(); | ||
132 | if (!S_ISLNK(inode->i_mode)) | 126 | if (!S_ISLNK(inode->i_mode)) |
133 | acl = get_cached_acl(dir, ACL_TYPE_DEFAULT); | 127 | acl = get_cached_acl(dir, ACL_TYPE_DEFAULT); |
134 | if (acl) { | 128 | if (acl) { |
135 | if (S_ISDIR(inode->i_mode)) | 129 | if (S_ISDIR(inode->i_mode)) |
136 | set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); | 130 | set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); |
137 | error = posix_acl_create(&acl, GFP_KERNEL, &mode); | 131 | error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
138 | if (error < 0) | 132 | if (error < 0) |
139 | return error; | 133 | return error; |
140 | inode->i_mode = mode; | ||
141 | if (error > 0) | 134 | if (error > 0) |
142 | set_cached_acl(inode, ACL_TYPE_ACCESS, acl); | 135 | set_cached_acl(inode, ACL_TYPE_ACCESS, acl); |
136 | } else { | ||
137 | inode->i_mode &= ~current_umask(); | ||
143 | } | 138 | } |
144 | error = 0; | 139 | error = 0; |
145 | 140 | ||
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index 884c9af0542f..34501b64bc47 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c | |||
@@ -72,7 +72,7 @@ struct posix_acl *gfs2_get_acl(struct inode *inode, int type) | |||
72 | return gfs2_acl_get(GFS2_I(inode), type); | 72 | return gfs2_acl_get(GFS2_I(inode), type); |
73 | } | 73 | } |
74 | 74 | ||
75 | static int gfs2_set_mode(struct inode *inode, mode_t mode) | 75 | static int gfs2_set_mode(struct inode *inode, umode_t mode) |
76 | { | 76 | { |
77 | int error = 0; | 77 | int error = 0; |
78 | 78 | ||
@@ -117,7 +117,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode) | |||
117 | { | 117 | { |
118 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); | 118 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); |
119 | struct posix_acl *acl; | 119 | struct posix_acl *acl; |
120 | mode_t mode = inode->i_mode; | 120 | umode_t mode = inode->i_mode; |
121 | int error = 0; | 121 | int error = 0; |
122 | 122 | ||
123 | if (!sdp->sd_args.ar_posix_acl) | 123 | if (!sdp->sd_args.ar_posix_acl) |
@@ -276,7 +276,7 @@ static int gfs2_xattr_system_set(struct dentry *dentry, const char *name, | |||
276 | goto out_release; | 276 | goto out_release; |
277 | 277 | ||
278 | if (type == ACL_TYPE_ACCESS) { | 278 | if (type == ACL_TYPE_ACCESS) { |
279 | mode_t mode = inode->i_mode; | 279 | umode_t mode = inode->i_mode; |
280 | error = posix_acl_equiv_mode(acl, &mode); | 280 | error = posix_acl_equiv_mode(acl, &mode); |
281 | 281 | ||
282 | if (error <= 0) { | 282 | if (error <= 0) { |
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 8635be5ffd97..970ea987b3f6 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/statfs.h> | 16 | #include <linux/statfs.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/pid_namespace.h> | 18 | #include <linux/pid_namespace.h> |
19 | #include <linux/namei.h> | ||
19 | #include <asm/uaccess.h> | 20 | #include <asm/uaccess.h> |
20 | #include "os.h" | 21 | #include "os.h" |
21 | 22 | ||
diff --git a/fs/inode.c b/fs/inode.c index d0c72ff6b30e..5aab80dc008c 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -399,12 +399,12 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval) | |||
399 | EXPORT_SYMBOL(__insert_inode_hash); | 399 | EXPORT_SYMBOL(__insert_inode_hash); |
400 | 400 | ||
401 | /** | 401 | /** |
402 | * remove_inode_hash - remove an inode from the hash | 402 | * __remove_inode_hash - remove an inode from the hash |
403 | * @inode: inode to unhash | 403 | * @inode: inode to unhash |
404 | * | 404 | * |
405 | * Remove an inode from the superblock. | 405 | * Remove an inode from the superblock. |
406 | */ | 406 | */ |
407 | void remove_inode_hash(struct inode *inode) | 407 | void __remove_inode_hash(struct inode *inode) |
408 | { | 408 | { |
409 | spin_lock(&inode_hash_lock); | 409 | spin_lock(&inode_hash_lock); |
410 | spin_lock(&inode->i_lock); | 410 | spin_lock(&inode->i_lock); |
@@ -412,7 +412,7 @@ void remove_inode_hash(struct inode *inode) | |||
412 | spin_unlock(&inode->i_lock); | 412 | spin_unlock(&inode->i_lock); |
413 | spin_unlock(&inode_hash_lock); | 413 | spin_unlock(&inode_hash_lock); |
414 | } | 414 | } |
415 | EXPORT_SYMBOL(remove_inode_hash); | 415 | EXPORT_SYMBOL(__remove_inode_hash); |
416 | 416 | ||
417 | void end_writeback(struct inode *inode) | 417 | void end_writeback(struct inode *inode) |
418 | { | 418 | { |
@@ -454,7 +454,9 @@ static void evict(struct inode *inode) | |||
454 | BUG_ON(!(inode->i_state & I_FREEING)); | 454 | BUG_ON(!(inode->i_state & I_FREEING)); |
455 | BUG_ON(!list_empty(&inode->i_lru)); | 455 | BUG_ON(!list_empty(&inode->i_lru)); |
456 | 456 | ||
457 | inode_wb_list_del(inode); | 457 | if (!list_empty(&inode->i_wb_list)) |
458 | inode_wb_list_del(inode); | ||
459 | |||
458 | inode_sb_list_del(inode); | 460 | inode_sb_list_del(inode); |
459 | 461 | ||
460 | if (op->evict_inode) { | 462 | if (op->evict_inode) { |
@@ -1328,7 +1330,8 @@ static void iput_final(struct inode *inode) | |||
1328 | } | 1330 | } |
1329 | 1331 | ||
1330 | inode->i_state |= I_FREEING; | 1332 | inode->i_state |= I_FREEING; |
1331 | inode_lru_list_del(inode); | 1333 | if (!list_empty(&inode->i_lru)) |
1334 | inode_lru_list_del(inode); | ||
1332 | spin_unlock(&inode->i_lock); | 1335 | spin_unlock(&inode->i_lock); |
1333 | 1336 | ||
1334 | evict(inode); | 1337 | evict(inode); |
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 27c511a1cf05..926d02068a14 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c | |||
@@ -227,7 +227,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
227 | case ACL_TYPE_ACCESS: | 227 | case ACL_TYPE_ACCESS: |
228 | xprefix = JFFS2_XPREFIX_ACL_ACCESS; | 228 | xprefix = JFFS2_XPREFIX_ACL_ACCESS; |
229 | if (acl) { | 229 | if (acl) { |
230 | mode_t mode = inode->i_mode; | 230 | umode_t mode = inode->i_mode; |
231 | rc = posix_acl_equiv_mode(acl, &mode); | 231 | rc = posix_acl_equiv_mode(acl, &mode); |
232 | if (rc < 0) | 232 | if (rc < 0) |
233 | return rc; | 233 | return rc; |
@@ -259,7 +259,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
259 | return rc; | 259 | return rc; |
260 | } | 260 | } |
261 | 261 | ||
262 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode) | 262 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, umode_t *i_mode) |
263 | { | 263 | { |
264 | struct posix_acl *acl; | 264 | struct posix_acl *acl; |
265 | int rc; | 265 | int rc; |
diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index b3421c78d9f8..9b477246f2a6 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h | |||
@@ -28,7 +28,7 @@ struct jffs2_acl_header { | |||
28 | 28 | ||
29 | struct posix_acl *jffs2_get_acl(struct inode *inode, int type); | 29 | struct posix_acl *jffs2_get_acl(struct inode *inode, int type); |
30 | extern int jffs2_acl_chmod(struct inode *); | 30 | extern int jffs2_acl_chmod(struct inode *); |
31 | extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *); | 31 | extern int jffs2_init_acl_pre(struct inode *, struct inode *, umode_t *); |
32 | extern int jffs2_init_acl_post(struct inode *); | 32 | extern int jffs2_init_acl_post(struct inode *); |
33 | 33 | ||
34 | extern const struct xattr_handler jffs2_acl_access_xattr_handler; | 34 | extern const struct xattr_handler jffs2_acl_access_xattr_handler; |
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index b81b35ddf4e4..bbcb9755dd2b 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) | |||
406 | 406 | ||
407 | /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, | 407 | /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, |
408 | fill in the raw_inode while you're at it. */ | 408 | fill in the raw_inode while you're at it. */ |
409 | struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri) | 409 | struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_raw_inode *ri) |
410 | { | 410 | { |
411 | struct inode *inode; | 411 | struct inode *inode; |
412 | struct super_block *sb = dir_i->i_sb; | 412 | struct super_block *sb = dir_i->i_sb; |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 526979c607b6..6c1755c59c0f 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *); | |||
173 | struct inode *jffs2_iget(struct super_block *, unsigned long); | 173 | struct inode *jffs2_iget(struct super_block *, unsigned long); |
174 | void jffs2_evict_inode (struct inode *); | 174 | void jffs2_evict_inode (struct inode *); |
175 | void jffs2_dirty_inode(struct inode *inode, int flags); | 175 | void jffs2_dirty_inode(struct inode *inode, int flags); |
176 | struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, | 176 | struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, |
177 | struct jffs2_raw_inode *ri); | 177 | struct jffs2_raw_inode *ri); |
178 | int jffs2_statfs (struct dentry *, struct kstatfs *); | 178 | int jffs2_statfs (struct dentry *, struct kstatfs *); |
179 | int jffs2_remount_fs (struct super_block *, int *, char *); | 179 | int jffs2_remount_fs (struct super_block *, int *, char *); |
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index b3a32caf2b45..45559dc3ea2f 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -127,16 +127,14 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) | |||
127 | return PTR_ERR(acl); | 127 | return PTR_ERR(acl); |
128 | 128 | ||
129 | if (acl) { | 129 | if (acl) { |
130 | mode_t mode = inode->i_mode; | ||
131 | if (S_ISDIR(inode->i_mode)) { | 130 | if (S_ISDIR(inode->i_mode)) { |
132 | rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); | 131 | rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); |
133 | if (rc) | 132 | if (rc) |
134 | goto cleanup; | 133 | goto cleanup; |
135 | } | 134 | } |
136 | rc = posix_acl_create(&acl, GFP_KERNEL, &mode); | 135 | rc = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
137 | if (rc < 0) | 136 | if (rc < 0) |
138 | goto cleanup; /* posix_acl_release(NULL) is no-op */ | 137 | goto cleanup; /* posix_acl_release(NULL) is no-op */ |
139 | inode->i_mode = mode; | ||
140 | if (rc > 0) | 138 | if (rc > 0) |
141 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); | 139 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); |
142 | cleanup: | 140 | cleanup: |
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 24838f1eeee5..e87fedef23db 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c | |||
@@ -693,8 +693,7 @@ static int can_set_system_xattr(struct inode *inode, const char *name, | |||
693 | return rc; | 693 | return rc; |
694 | } | 694 | } |
695 | if (acl) { | 695 | if (acl) { |
696 | mode_t mode = inode->i_mode; | 696 | rc = posix_acl_equiv_mode(acl, &inode->i_mode); |
697 | rc = posix_acl_equiv_mode(acl, &mode); | ||
698 | posix_acl_release(acl); | 697 | posix_acl_release(acl); |
699 | if (rc < 0) { | 698 | if (rc < 0) { |
700 | printk(KERN_ERR | 699 | printk(KERN_ERR |
@@ -702,7 +701,6 @@ static int can_set_system_xattr(struct inode *inode, const char *name, | |||
702 | rc); | 701 | rc); |
703 | return rc; | 702 | return rc; |
704 | } | 703 | } |
705 | inode->i_mode = mode; | ||
706 | mark_inode_dirty(inode); | 704 | mark_inode_dirty(inode); |
707 | } | 705 | } |
708 | /* | 706 | /* |
diff --git a/fs/namei.c b/fs/namei.c index f8c69d373793..445fd5da11fa 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -716,19 +716,25 @@ static int follow_automount(struct path *path, unsigned flags, | |||
716 | if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT)) | 716 | if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT)) |
717 | return -EISDIR; /* we actually want to stop here */ | 717 | return -EISDIR; /* we actually want to stop here */ |
718 | 718 | ||
719 | /* We want to mount if someone is trying to open/create a file of any | 719 | /* |
720 | * type under the mountpoint, wants to traverse through the mountpoint | ||
721 | * or wants to open the mounted directory. | ||
722 | * | ||
723 | * We don't want to mount if someone's just doing a stat and they've | 720 | * We don't want to mount if someone's just doing a stat and they've |
724 | * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and | 721 | * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and |
725 | * appended a '/' to the name. | 722 | * appended a '/' to the name. |
726 | */ | 723 | */ |
727 | if (!(flags & LOOKUP_FOLLOW) && | 724 | if (!(flags & LOOKUP_FOLLOW)) { |
728 | !(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | | 725 | /* We do, however, want to mount if someone wants to open or |
729 | LOOKUP_OPEN | LOOKUP_CREATE))) | 726 | * create a file of any type under the mountpoint, wants to |
730 | return -EISDIR; | 727 | * traverse through the mountpoint or wants to open the mounted |
731 | 728 | * directory. | |
729 | * Also, autofs may mark negative dentries as being automount | ||
730 | * points. These will need the attentions of the daemon to | ||
731 | * instantiate them before they can be used. | ||
732 | */ | ||
733 | if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | | ||
734 | LOOKUP_OPEN | LOOKUP_CREATE)) && | ||
735 | path->dentry->d_inode) | ||
736 | return -EISDIR; | ||
737 | } | ||
732 | current->total_link_count++; | 738 | current->total_link_count++; |
733 | if (current->total_link_count >= 40) | 739 | if (current->total_link_count >= 40) |
734 | return -ELOOP; | 740 | return -ELOOP; |
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index e49e73107e62..7ef23979896d 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -415,7 +415,7 @@ fail: | |||
415 | } | 415 | } |
416 | 416 | ||
417 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | 417 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, |
418 | mode_t mode) | 418 | umode_t mode) |
419 | { | 419 | { |
420 | struct posix_acl *dfacl, *acl; | 420 | struct posix_acl *dfacl, *acl; |
421 | int error = 0; | 421 | int error = 0; |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 38053d823eb0..85f1690ca08c 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -316,7 +316,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
316 | int flags, struct nfs_open_context *ctx) | 316 | int flags, struct nfs_open_context *ctx) |
317 | { | 317 | { |
318 | struct nfs3_createdata *data; | 318 | struct nfs3_createdata *data; |
319 | mode_t mode = sattr->ia_mode; | 319 | umode_t mode = sattr->ia_mode; |
320 | int status = -ENOMEM; | 320 | int status = -ENOMEM; |
321 | 321 | ||
322 | dprintk("NFS call create %s\n", dentry->d_name.name); | 322 | dprintk("NFS call create %s\n", dentry->d_name.name); |
@@ -562,7 +562,7 @@ static int | |||
562 | nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) | 562 | nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) |
563 | { | 563 | { |
564 | struct nfs3_createdata *data; | 564 | struct nfs3_createdata *data; |
565 | int mode = sattr->ia_mode; | 565 | umode_t mode = sattr->ia_mode; |
566 | int status = -ENOMEM; | 566 | int status = -ENOMEM; |
567 | 567 | ||
568 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); | 568 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); |
@@ -681,7 +681,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
681 | dev_t rdev) | 681 | dev_t rdev) |
682 | { | 682 | { |
683 | struct nfs3_createdata *data; | 683 | struct nfs3_createdata *data; |
684 | mode_t mode = sattr->ia_mode; | 684 | umode_t mode = sattr->ia_mode; |
685 | int status = -ENOMEM; | 685 | int status = -ENOMEM; |
686 | 686 | ||
687 | dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name, | 687 | dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name, |
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 783c58d9daf1..a7219075b4de 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c | |||
@@ -247,7 +247,7 @@ static int ocfs2_set_acl(handle_t *handle, | |||
247 | case ACL_TYPE_ACCESS: | 247 | case ACL_TYPE_ACCESS: |
248 | name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS; | 248 | name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS; |
249 | if (acl) { | 249 | if (acl) { |
250 | mode_t mode = inode->i_mode; | 250 | umode_t mode = inode->i_mode; |
251 | ret = posix_acl_equiv_mode(acl, &mode); | 251 | ret = posix_acl_equiv_mode(acl, &mode); |
252 | if (ret < 0) | 252 | if (ret < 0) |
253 | return ret; | 253 | return ret; |
@@ -351,7 +351,7 @@ int ocfs2_init_acl(handle_t *handle, | |||
351 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 351 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
352 | struct posix_acl *acl = NULL; | 352 | struct posix_acl *acl = NULL; |
353 | int ret = 0, ret2; | 353 | int ret = 0, ret2; |
354 | mode_t mode; | 354 | umode_t mode; |
355 | 355 | ||
356 | if (!S_ISLNK(inode->i_mode)) { | 356 | if (!S_ISLNK(inode->i_mode)) { |
357 | if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) { | 357 | if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) { |
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index d43729a760e2..10027b42b7e2 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -149,10 +149,10 @@ posix_acl_valid(const struct posix_acl *acl) | |||
149 | * file mode permission bits, or else 1. Returns -E... on error. | 149 | * file mode permission bits, or else 1. Returns -E... on error. |
150 | */ | 150 | */ |
151 | int | 151 | int |
152 | posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p) | 152 | posix_acl_equiv_mode(const struct posix_acl *acl, umode_t *mode_p) |
153 | { | 153 | { |
154 | const struct posix_acl_entry *pa, *pe; | 154 | const struct posix_acl_entry *pa, *pe; |
155 | mode_t mode = 0; | 155 | umode_t mode = 0; |
156 | int not_equiv = 0; | 156 | int not_equiv = 0; |
157 | 157 | ||
158 | FOREACH_ACL_ENTRY(pa, acl, pe) { | 158 | FOREACH_ACL_ENTRY(pa, acl, pe) { |
@@ -188,7 +188,7 @@ posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p) | |||
188 | * Create an ACL representing the file mode permission bits of an inode. | 188 | * Create an ACL representing the file mode permission bits of an inode. |
189 | */ | 189 | */ |
190 | struct posix_acl * | 190 | struct posix_acl * |
191 | posix_acl_from_mode(mode_t mode, gfp_t flags) | 191 | posix_acl_from_mode(umode_t mode, gfp_t flags) |
192 | { | 192 | { |
193 | struct posix_acl *acl = posix_acl_alloc(3, flags); | 193 | struct posix_acl *acl = posix_acl_alloc(3, flags); |
194 | if (!acl) | 194 | if (!acl) |
@@ -279,11 +279,11 @@ check_perm: | |||
279 | * system calls. All permissions that are not granted by the acl are removed. | 279 | * system calls. All permissions that are not granted by the acl are removed. |
280 | * The permissions in the acl are changed to reflect the mode_p parameter. | 280 | * The permissions in the acl are changed to reflect the mode_p parameter. |
281 | */ | 281 | */ |
282 | static int posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p) | 282 | static int posix_acl_create_masq(struct posix_acl *acl, umode_t *mode_p) |
283 | { | 283 | { |
284 | struct posix_acl_entry *pa, *pe; | 284 | struct posix_acl_entry *pa, *pe; |
285 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; | 285 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; |
286 | mode_t mode = *mode_p; | 286 | umode_t mode = *mode_p; |
287 | int not_equiv = 0; | 287 | int not_equiv = 0; |
288 | 288 | ||
289 | /* assert(atomic_read(acl->a_refcount) == 1); */ | 289 | /* assert(atomic_read(acl->a_refcount) == 1); */ |
@@ -336,7 +336,7 @@ static int posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p) | |||
336 | /* | 336 | /* |
337 | * Modify the ACL for the chmod syscall. | 337 | * Modify the ACL for the chmod syscall. |
338 | */ | 338 | */ |
339 | static int posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) | 339 | static int posix_acl_chmod_masq(struct posix_acl *acl, umode_t mode) |
340 | { | 340 | { |
341 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; | 341 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; |
342 | struct posix_acl_entry *pa, *pe; | 342 | struct posix_acl_entry *pa, *pe; |
@@ -382,7 +382,7 @@ static int posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) | |||
382 | } | 382 | } |
383 | 383 | ||
384 | int | 384 | int |
385 | posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p) | 385 | posix_acl_create(struct posix_acl **acl, gfp_t gfp, umode_t *mode_p) |
386 | { | 386 | { |
387 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | 387 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); |
388 | int err = -ENOMEM; | 388 | int err = -ENOMEM; |
@@ -400,7 +400,7 @@ posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p) | |||
400 | EXPORT_SYMBOL(posix_acl_create); | 400 | EXPORT_SYMBOL(posix_acl_create); |
401 | 401 | ||
402 | int | 402 | int |
403 | posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode) | 403 | posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, umode_t mode) |
404 | { | 404 | { |
405 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | 405 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); |
406 | int err = -ENOMEM; | 406 | int err = -ENOMEM; |
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 7362cf4c946a..6da0396e5052 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -272,12 +272,10 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, | |||
272 | case ACL_TYPE_ACCESS: | 272 | case ACL_TYPE_ACCESS: |
273 | name = POSIX_ACL_XATTR_ACCESS; | 273 | name = POSIX_ACL_XATTR_ACCESS; |
274 | if (acl) { | 274 | if (acl) { |
275 | mode_t mode = inode->i_mode; | 275 | error = posix_acl_equiv_mode(acl, &inode->i_mode); |
276 | error = posix_acl_equiv_mode(acl, &mode); | ||
277 | if (error < 0) | 276 | if (error < 0) |
278 | return error; | 277 | return error; |
279 | else { | 278 | else { |
280 | inode->i_mode = mode; | ||
281 | if (error == 0) | 279 | if (error == 0) |
282 | acl = NULL; | 280 | acl = NULL; |
283 | } | 281 | } |
@@ -354,8 +352,6 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
354 | return PTR_ERR(acl); | 352 | return PTR_ERR(acl); |
355 | 353 | ||
356 | if (acl) { | 354 | if (acl) { |
357 | mode_t mode = inode->i_mode; | ||
358 | |||
359 | /* Copy the default ACL to the default ACL of a new directory */ | 355 | /* Copy the default ACL to the default ACL of a new directory */ |
360 | if (S_ISDIR(inode->i_mode)) { | 356 | if (S_ISDIR(inode->i_mode)) { |
361 | err = reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT, | 357 | err = reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT, |
@@ -366,12 +362,10 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
366 | 362 | ||
367 | /* Now we reconcile the new ACL and the mode, | 363 | /* Now we reconcile the new ACL and the mode, |
368 | potentially modifying both */ | 364 | potentially modifying both */ |
369 | err = posix_acl_create(&acl, GFP_NOFS, &mode); | 365 | err = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
370 | if (err < 0) | 366 | if (err < 0) |
371 | return err; | 367 | return err; |
372 | 368 | ||
373 | inode->i_mode = mode; | ||
374 | |||
375 | /* If we need an ACL.. */ | 369 | /* If we need an ACL.. */ |
376 | if (err > 0) | 370 | if (err > 0) |
377 | err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl); | 371 | err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c index 44ce51656804..b6c4b3795c4a 100644 --- a/fs/xfs/linux-2.6/xfs_acl.c +++ b/fs/xfs/linux-2.6/xfs_acl.c | |||
@@ -221,7 +221,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
221 | } | 221 | } |
222 | 222 | ||
223 | static int | 223 | static int |
224 | xfs_set_mode(struct inode *inode, mode_t mode) | 224 | xfs_set_mode(struct inode *inode, umode_t mode) |
225 | { | 225 | { |
226 | int error = 0; | 226 | int error = 0; |
227 | 227 | ||
@@ -267,7 +267,7 @@ posix_acl_default_exists(struct inode *inode) | |||
267 | int | 267 | int |
268 | xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) | 268 | xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) |
269 | { | 269 | { |
270 | mode_t mode = inode->i_mode; | 270 | umode_t mode = inode->i_mode; |
271 | int error = 0, inherit = 0; | 271 | int error = 0, inherit = 0; |
272 | 272 | ||
273 | if (S_ISDIR(inode->i_mode)) { | 273 | if (S_ISDIR(inode->i_mode)) { |
@@ -381,7 +381,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
381 | goto out_release; | 381 | goto out_release; |
382 | 382 | ||
383 | if (type == ACL_TYPE_ACCESS) { | 383 | if (type == ACL_TYPE_ACCESS) { |
384 | mode_t mode = inode->i_mode; | 384 | umode_t mode = inode->i_mode; |
385 | error = posix_acl_equiv_mode(acl, &mode); | 385 | error = posix_acl_equiv_mode(acl, &mode); |
386 | 386 | ||
387 | if (error <= 0) { | 387 | if (error <= 0) { |