diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_flat.c | 2 | ||||
-rw-r--r-- | fs/ceph/dir.c | 5 | ||||
-rw-r--r-- | fs/ext2/acl.c | 43 | ||||
-rw-r--r-- | fs/f2fs/acl.c | 2 | ||||
-rw-r--r-- | fs/f2fs/checkpoint.c | 10 | ||||
-rw-r--r-- | fs/f2fs/file.c | 5 | ||||
-rw-r--r-- | fs/f2fs/sysfs.c | 1 | ||||
-rw-r--r-- | fs/hfsplus/posix_acl.c | 30 | ||||
-rw-r--r-- | fs/isofs/inode.c | 8 | ||||
-rw-r--r-- | fs/mount.h | 4 | ||||
-rw-r--r-- | fs/namei.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4callback.c | 6 | ||||
-rw-r--r-- | fs/proc/internal.h | 6 | ||||
-rw-r--r-- | fs/reiserfs/xattr_acl.c | 17 |
14 files changed, 92 insertions, 49 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 69ec23daa25e..a1e6860b6f46 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm *bprm, | |||
574 | MAX_SHARED_LIBS * sizeof(unsigned long), | 574 | MAX_SHARED_LIBS * sizeof(unsigned long), |
575 | FLAT_DATA_ALIGN); | 575 | FLAT_DATA_ALIGN); |
576 | 576 | ||
577 | pr_debug("Allocated data+bss+stack (%ld bytes): %lx\n", | 577 | pr_debug("Allocated data+bss+stack (%u bytes): %lx\n", |
578 | data_len + bss_len + stack_len, datapos); | 578 | data_len + bss_len + stack_len, datapos); |
579 | 579 | ||
580 | fpos = ntohl(hdr->data_start); | 580 | fpos = ntohl(hdr->data_start); |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index e071d23f6148..ef7240ace576 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -271,6 +271,11 @@ out: | |||
271 | if (ret < 0) | 271 | if (ret < 0) |
272 | err = ret; | 272 | err = ret; |
273 | dput(last); | 273 | dput(last); |
274 | /* last_name no longer match cache index */ | ||
275 | if (fi->readdir_cache_idx >= 0) { | ||
276 | fi->readdir_cache_idx = -1; | ||
277 | fi->dir_release_count = 0; | ||
278 | } | ||
274 | } | 279 | } |
275 | return err; | 280 | return err; |
276 | } | 281 | } |
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 79dafa71effd..51f0aea70cb4 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -175,11 +175,8 @@ ext2_get_acl(struct inode *inode, int type) | |||
175 | return acl; | 175 | return acl; |
176 | } | 176 | } |
177 | 177 | ||
178 | /* | 178 | static int |
179 | * inode->i_mutex: down | 179 | __ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) |
180 | */ | ||
181 | int | ||
182 | ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) | ||
183 | { | 180 | { |
184 | int name_index; | 181 | int name_index; |
185 | void *value = NULL; | 182 | void *value = NULL; |
@@ -189,13 +186,6 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
189 | switch(type) { | 186 | switch(type) { |
190 | case ACL_TYPE_ACCESS: | 187 | case ACL_TYPE_ACCESS: |
191 | name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; | 188 | name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; |
192 | if (acl) { | ||
193 | error = posix_acl_update_mode(inode, &inode->i_mode, &acl); | ||
194 | if (error) | ||
195 | return error; | ||
196 | inode->i_ctime = current_time(inode); | ||
197 | mark_inode_dirty(inode); | ||
198 | } | ||
199 | break; | 189 | break; |
200 | 190 | ||
201 | case ACL_TYPE_DEFAULT: | 191 | case ACL_TYPE_DEFAULT: |
@@ -222,6 +212,31 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
222 | } | 212 | } |
223 | 213 | ||
224 | /* | 214 | /* |
215 | * inode->i_mutex: down | ||
216 | */ | ||
217 | int | ||
218 | ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) | ||
219 | { | ||
220 | int error; | ||
221 | int update_mode = 0; | ||
222 | umode_t mode = inode->i_mode; | ||
223 | |||
224 | if (type == ACL_TYPE_ACCESS && acl) { | ||
225 | error = posix_acl_update_mode(inode, &mode, &acl); | ||
226 | if (error) | ||
227 | return error; | ||
228 | update_mode = 1; | ||
229 | } | ||
230 | error = __ext2_set_acl(inode, acl, type); | ||
231 | if (!error && update_mode) { | ||
232 | inode->i_mode = mode; | ||
233 | inode->i_ctime = current_time(inode); | ||
234 | mark_inode_dirty(inode); | ||
235 | } | ||
236 | return error; | ||
237 | } | ||
238 | |||
239 | /* | ||
225 | * Initialize the ACLs of a new inode. Called from ext2_new_inode. | 240 | * Initialize the ACLs of a new inode. Called from ext2_new_inode. |
226 | * | 241 | * |
227 | * dir->i_mutex: down | 242 | * dir->i_mutex: down |
@@ -238,12 +253,12 @@ ext2_init_acl(struct inode *inode, struct inode *dir) | |||
238 | return error; | 253 | return error; |
239 | 254 | ||
240 | if (default_acl) { | 255 | if (default_acl) { |
241 | error = ext2_set_acl(inode, default_acl, ACL_TYPE_DEFAULT); | 256 | error = __ext2_set_acl(inode, default_acl, ACL_TYPE_DEFAULT); |
242 | posix_acl_release(default_acl); | 257 | posix_acl_release(default_acl); |
243 | } | 258 | } |
244 | if (acl) { | 259 | if (acl) { |
245 | if (!error) | 260 | if (!error) |
246 | error = ext2_set_acl(inode, acl, ACL_TYPE_ACCESS); | 261 | error = __ext2_set_acl(inode, acl, ACL_TYPE_ACCESS); |
247 | posix_acl_release(acl); | 262 | posix_acl_release(acl); |
248 | } | 263 | } |
249 | return error; | 264 | return error; |
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index a140c5e3dc54..b4b8438c42ef 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c | |||
@@ -211,7 +211,7 @@ static int __f2fs_set_acl(struct inode *inode, int type, | |||
211 | switch (type) { | 211 | switch (type) { |
212 | case ACL_TYPE_ACCESS: | 212 | case ACL_TYPE_ACCESS: |
213 | name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; | 213 | name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; |
214 | if (acl) { | 214 | if (acl && !ipage) { |
215 | error = posix_acl_update_mode(inode, &inode->i_mode, &acl); | 215 | error = posix_acl_update_mode(inode, &inode->i_mode, &acl); |
216 | if (error) | 216 | if (error) |
217 | return error; | 217 | return error; |
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 56bbf592e487..5b876f6d3f6b 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c | |||
@@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type) | |||
879 | struct inode *inode; | 879 | struct inode *inode; |
880 | struct f2fs_inode_info *fi; | 880 | struct f2fs_inode_info *fi; |
881 | bool is_dir = (type == DIR_INODE); | 881 | bool is_dir = (type == DIR_INODE); |
882 | unsigned long ino = 0; | ||
882 | 883 | ||
883 | trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, | 884 | trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, |
884 | get_pages(sbi, is_dir ? | 885 | get_pages(sbi, is_dir ? |
@@ -901,8 +902,17 @@ retry: | |||
901 | inode = igrab(&fi->vfs_inode); | 902 | inode = igrab(&fi->vfs_inode); |
902 | spin_unlock(&sbi->inode_lock[type]); | 903 | spin_unlock(&sbi->inode_lock[type]); |
903 | if (inode) { | 904 | if (inode) { |
905 | unsigned long cur_ino = inode->i_ino; | ||
906 | |||
904 | filemap_fdatawrite(inode->i_mapping); | 907 | filemap_fdatawrite(inode->i_mapping); |
905 | iput(inode); | 908 | iput(inode); |
909 | /* We need to give cpu to another writers. */ | ||
910 | if (ino == cur_ino) { | ||
911 | congestion_wait(BLK_RW_ASYNC, HZ/50); | ||
912 | cond_resched(); | ||
913 | } else { | ||
914 | ino = cur_ino; | ||
915 | } | ||
906 | } else { | 916 | } else { |
907 | /* | 917 | /* |
908 | * We should submit bio, since it exists several | 918 | * We should submit bio, since it exists several |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index a0e6d2c65a9e..2706130c261b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -1538,7 +1538,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) | |||
1538 | 1538 | ||
1539 | /* Is it quota file? Do not allow user to mess with it */ | 1539 | /* Is it quota file? Do not allow user to mess with it */ |
1540 | if (IS_NOQUOTA(inode)) { | 1540 | if (IS_NOQUOTA(inode)) { |
1541 | inode_unlock(inode); | ||
1542 | ret = -EPERM; | 1541 | ret = -EPERM; |
1543 | goto unlock_out; | 1542 | goto unlock_out; |
1544 | } | 1543 | } |
@@ -1549,9 +1548,8 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) | |||
1549 | 1548 | ||
1550 | if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) { | 1549 | if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) { |
1551 | if (!capable(CAP_LINUX_IMMUTABLE)) { | 1550 | if (!capable(CAP_LINUX_IMMUTABLE)) { |
1552 | inode_unlock(inode); | ||
1553 | ret = -EPERM; | 1551 | ret = -EPERM; |
1554 | goto out; | 1552 | goto unlock_out; |
1555 | } | 1553 | } |
1556 | } | 1554 | } |
1557 | 1555 | ||
@@ -1564,7 +1562,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) | |||
1564 | f2fs_mark_inode_dirty_sync(inode, false); | 1562 | f2fs_mark_inode_dirty_sync(inode, false); |
1565 | unlock_out: | 1563 | unlock_out: |
1566 | inode_unlock(inode); | 1564 | inode_unlock(inode); |
1567 | out: | ||
1568 | mnt_drop_write_file(filp); | 1565 | mnt_drop_write_file(filp); |
1569 | return ret; | 1566 | return ret; |
1570 | } | 1567 | } |
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9adc202fcd6f..71191d89917d 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
13 | #include <linux/f2fs_fs.h> | 13 | #include <linux/f2fs_fs.h> |
14 | #include <linux/seq_file.h> | ||
14 | 15 | ||
15 | #include "f2fs.h" | 16 | #include "f2fs.h" |
16 | #include "segment.h" | 17 | #include "segment.h" |
diff --git a/fs/hfsplus/posix_acl.c b/fs/hfsplus/posix_acl.c index 9b92058a1240..6bb5d7c42888 100644 --- a/fs/hfsplus/posix_acl.c +++ b/fs/hfsplus/posix_acl.c | |||
@@ -51,8 +51,8 @@ struct posix_acl *hfsplus_get_posix_acl(struct inode *inode, int type) | |||
51 | return acl; | 51 | return acl; |
52 | } | 52 | } |
53 | 53 | ||
54 | int hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl, | 54 | static int __hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl, |
55 | int type) | 55 | int type) |
56 | { | 56 | { |
57 | int err; | 57 | int err; |
58 | char *xattr_name; | 58 | char *xattr_name; |
@@ -64,12 +64,6 @@ int hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl, | |||
64 | switch (type) { | 64 | switch (type) { |
65 | case ACL_TYPE_ACCESS: | 65 | case ACL_TYPE_ACCESS: |
66 | xattr_name = XATTR_NAME_POSIX_ACL_ACCESS; | 66 | xattr_name = XATTR_NAME_POSIX_ACL_ACCESS; |
67 | if (acl) { | ||
68 | err = posix_acl_update_mode(inode, &inode->i_mode, &acl); | ||
69 | if (err) | ||
70 | return err; | ||
71 | } | ||
72 | err = 0; | ||
73 | break; | 67 | break; |
74 | 68 | ||
75 | case ACL_TYPE_DEFAULT: | 69 | case ACL_TYPE_DEFAULT: |
@@ -105,6 +99,18 @@ end_set_acl: | |||
105 | return err; | 99 | return err; |
106 | } | 100 | } |
107 | 101 | ||
102 | int hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl, int type) | ||
103 | { | ||
104 | int err; | ||
105 | |||
106 | if (type == ACL_TYPE_ACCESS && acl) { | ||
107 | err = posix_acl_update_mode(inode, &inode->i_mode, &acl); | ||
108 | if (err) | ||
109 | return err; | ||
110 | } | ||
111 | return __hfsplus_set_posix_acl(inode, acl, type); | ||
112 | } | ||
113 | |||
108 | int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) | 114 | int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) |
109 | { | 115 | { |
110 | int err = 0; | 116 | int err = 0; |
@@ -122,15 +128,15 @@ int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) | |||
122 | return err; | 128 | return err; |
123 | 129 | ||
124 | if (default_acl) { | 130 | if (default_acl) { |
125 | err = hfsplus_set_posix_acl(inode, default_acl, | 131 | err = __hfsplus_set_posix_acl(inode, default_acl, |
126 | ACL_TYPE_DEFAULT); | 132 | ACL_TYPE_DEFAULT); |
127 | posix_acl_release(default_acl); | 133 | posix_acl_release(default_acl); |
128 | } | 134 | } |
129 | 135 | ||
130 | if (acl) { | 136 | if (acl) { |
131 | if (!err) | 137 | if (!err) |
132 | err = hfsplus_set_posix_acl(inode, acl, | 138 | err = __hfsplus_set_posix_acl(inode, acl, |
133 | ACL_TYPE_ACCESS); | 139 | ACL_TYPE_ACCESS); |
134 | posix_acl_release(acl); | 140 | posix_acl_release(acl); |
135 | } | 141 | } |
136 | return err; | 142 | return err; |
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 8cf898a59730..217a5e7815da 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -410,7 +410,11 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
410 | if (match_int(&args[0], &option)) | 410 | if (match_int(&args[0], &option)) |
411 | return 0; | 411 | return 0; |
412 | n = option; | 412 | n = option; |
413 | if (n > 99) | 413 | /* |
414 | * Track numbers are supposed to be in range 1-99, the | ||
415 | * mount option starts indexing at 0. | ||
416 | */ | ||
417 | if (n >= 99) | ||
414 | return 0; | 418 | return 0; |
415 | popt->session = n + 1; | 419 | popt->session = n + 1; |
416 | break; | 420 | break; |
@@ -543,7 +547,7 @@ static unsigned int isofs_get_last_session(struct super_block *sb, s32 session) | |||
543 | 547 | ||
544 | vol_desc_start=0; | 548 | vol_desc_start=0; |
545 | ms_info.addr_format=CDROM_LBA; | 549 | ms_info.addr_format=CDROM_LBA; |
546 | if(session >= 0 && session <= 99) { | 550 | if (session > 0) { |
547 | struct cdrom_tocentry Te; | 551 | struct cdrom_tocentry Te; |
548 | Te.cdte_track=session; | 552 | Te.cdte_track=session; |
549 | Te.cdte_format=CDROM_LBA; | 553 | Te.cdte_format=CDROM_LBA; |
diff --git a/fs/mount.h b/fs/mount.h index de45d9e76748..6790767d1883 100644 --- a/fs/mount.h +++ b/fs/mount.h | |||
@@ -16,7 +16,7 @@ struct mnt_namespace { | |||
16 | u64 event; | 16 | u64 event; |
17 | unsigned int mounts; /* # of mounts in the namespace */ | 17 | unsigned int mounts; /* # of mounts in the namespace */ |
18 | unsigned int pending_mounts; | 18 | unsigned int pending_mounts; |
19 | }; | 19 | } __randomize_layout; |
20 | 20 | ||
21 | struct mnt_pcp { | 21 | struct mnt_pcp { |
22 | int mnt_count; | 22 | int mnt_count; |
@@ -69,7 +69,7 @@ struct mount { | |||
69 | struct hlist_head mnt_pins; | 69 | struct hlist_head mnt_pins; |
70 | struct fs_pin mnt_umount; | 70 | struct fs_pin mnt_umount; |
71 | struct dentry *mnt_ex_mountpoint; | 71 | struct dentry *mnt_ex_mountpoint; |
72 | }; | 72 | } __randomize_layout; |
73 | 73 | ||
74 | #define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */ | 74 | #define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */ |
75 | 75 | ||
diff --git a/fs/namei.c b/fs/namei.c index 88fd38d1e3e7..ddb6a7c2b3d4 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -524,7 +524,7 @@ struct nameidata { | |||
524 | struct inode *link_inode; | 524 | struct inode *link_inode; |
525 | unsigned root_seq; | 525 | unsigned root_seq; |
526 | int dfd; | 526 | int dfd; |
527 | }; | 527 | } __randomize_layout; |
528 | 528 | ||
529 | static void set_nameidata(struct nameidata *p, int dfd, struct filename *name) | 529 | static void set_nameidata(struct nameidata *p, int dfd, struct filename *name) |
530 | { | 530 | { |
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index b45083c0f9ae..49b0a9e7ff18 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -720,8 +720,8 @@ static const struct rpc_version nfs_cb_version4 = { | |||
720 | .counts = nfs4_cb_counts, | 720 | .counts = nfs4_cb_counts, |
721 | }; | 721 | }; |
722 | 722 | ||
723 | static const struct rpc_version *nfs_cb_version[] = { | 723 | static const struct rpc_version *nfs_cb_version[2] = { |
724 | &nfs_cb_version4, | 724 | [1] = &nfs_cb_version4, |
725 | }; | 725 | }; |
726 | 726 | ||
727 | static const struct rpc_program cb_program; | 727 | static const struct rpc_program cb_program; |
@@ -795,7 +795,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c | |||
795 | .saddress = (struct sockaddr *) &conn->cb_saddr, | 795 | .saddress = (struct sockaddr *) &conn->cb_saddr, |
796 | .timeout = &timeparms, | 796 | .timeout = &timeparms, |
797 | .program = &cb_program, | 797 | .program = &cb_program, |
798 | .version = 0, | 798 | .version = 1, |
799 | .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), | 799 | .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), |
800 | }; | 800 | }; |
801 | struct rpc_clnt *client; | 801 | struct rpc_clnt *client; |
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 18694598bebf..aa2b89071630 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -51,7 +51,7 @@ struct proc_dir_entry { | |||
51 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | 51 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ |
52 | u8 namelen; | 52 | u8 namelen; |
53 | char name[]; | 53 | char name[]; |
54 | }; | 54 | } __randomize_layout; |
55 | 55 | ||
56 | union proc_op { | 56 | union proc_op { |
57 | int (*proc_get_link)(struct dentry *, struct path *); | 57 | int (*proc_get_link)(struct dentry *, struct path *); |
@@ -70,7 +70,7 @@ struct proc_inode { | |||
70 | struct hlist_node sysctl_inodes; | 70 | struct hlist_node sysctl_inodes; |
71 | const struct proc_ns_operations *ns_ops; | 71 | const struct proc_ns_operations *ns_ops; |
72 | struct inode vfs_inode; | 72 | struct inode vfs_inode; |
73 | }; | 73 | } __randomize_layout; |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * General functions | 76 | * General functions |
@@ -279,7 +279,7 @@ struct proc_maps_private { | |||
279 | #ifdef CONFIG_NUMA | 279 | #ifdef CONFIG_NUMA |
280 | struct mempolicy *task_mempolicy; | 280 | struct mempolicy *task_mempolicy; |
281 | #endif | 281 | #endif |
282 | }; | 282 | } __randomize_layout; |
283 | 283 | ||
284 | struct mm_struct *proc_mem_open(struct inode *inode, unsigned int mode); | 284 | struct mm_struct *proc_mem_open(struct inode *inode, unsigned int mode); |
285 | 285 | ||
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 3d2256a425ee..54415f0e3d18 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -23,7 +23,8 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
23 | struct reiserfs_transaction_handle th; | 23 | struct reiserfs_transaction_handle th; |
24 | size_t jcreate_blocks; | 24 | size_t jcreate_blocks; |
25 | int size = acl ? posix_acl_xattr_size(acl->a_count) : 0; | 25 | int size = acl ? posix_acl_xattr_size(acl->a_count) : 0; |
26 | 26 | int update_mode = 0; | |
27 | umode_t mode = inode->i_mode; | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * Pessimism: We can't assume that anything from the xattr root up | 30 | * Pessimism: We can't assume that anything from the xattr root up |
@@ -37,7 +38,16 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
37 | error = journal_begin(&th, inode->i_sb, jcreate_blocks); | 38 | error = journal_begin(&th, inode->i_sb, jcreate_blocks); |
38 | reiserfs_write_unlock(inode->i_sb); | 39 | reiserfs_write_unlock(inode->i_sb); |
39 | if (error == 0) { | 40 | if (error == 0) { |
41 | if (type == ACL_TYPE_ACCESS && acl) { | ||
42 | error = posix_acl_update_mode(inode, &mode, &acl); | ||
43 | if (error) | ||
44 | goto unlock; | ||
45 | update_mode = 1; | ||
46 | } | ||
40 | error = __reiserfs_set_acl(&th, inode, type, acl); | 47 | error = __reiserfs_set_acl(&th, inode, type, acl); |
48 | if (!error && update_mode) | ||
49 | inode->i_mode = mode; | ||
50 | unlock: | ||
41 | reiserfs_write_lock(inode->i_sb); | 51 | reiserfs_write_lock(inode->i_sb); |
42 | error2 = journal_end(&th); | 52 | error2 = journal_end(&th); |
43 | reiserfs_write_unlock(inode->i_sb); | 53 | reiserfs_write_unlock(inode->i_sb); |
@@ -241,11 +251,6 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, | |||
241 | switch (type) { | 251 | switch (type) { |
242 | case ACL_TYPE_ACCESS: | 252 | case ACL_TYPE_ACCESS: |
243 | name = XATTR_NAME_POSIX_ACL_ACCESS; | 253 | name = XATTR_NAME_POSIX_ACL_ACCESS; |
244 | if (acl) { | ||
245 | error = posix_acl_update_mode(inode, &inode->i_mode, &acl); | ||
246 | if (error) | ||
247 | return error; | ||
248 | } | ||
249 | break; | 254 | break; |
250 | case ACL_TYPE_DEFAULT: | 255 | case ACL_TYPE_DEFAULT: |
251 | name = XATTR_NAME_POSIX_ACL_DEFAULT; | 256 | name = XATTR_NAME_POSIX_ACL_DEFAULT; |