diff options
Diffstat (limited to 'fs/ext3/acl.c')
-rw-r--r-- | fs/ext3/acl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index 6c29bf0df04a..74a3c6486f8f 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c | |||
@@ -261,19 +261,16 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
261 | inode->i_mode &= ~current_umask(); | 261 | inode->i_mode &= ~current_umask(); |
262 | } | 262 | } |
263 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 263 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
264 | mode_t mode = inode->i_mode; | ||
265 | |||
266 | if (S_ISDIR(inode->i_mode)) { | 264 | if (S_ISDIR(inode->i_mode)) { |
267 | error = ext3_set_acl(handle, inode, | 265 | error = ext3_set_acl(handle, inode, |
268 | ACL_TYPE_DEFAULT, acl); | 266 | ACL_TYPE_DEFAULT, acl); |
269 | if (error) | 267 | if (error) |
270 | goto cleanup; | 268 | goto cleanup; |
271 | } | 269 | } |
272 | error = posix_acl_create(&acl, GFP_NOFS, &mode); | 270 | error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
273 | if (error < 0) | 271 | if (error < 0) |
274 | return error; | 272 | return error; |
275 | 273 | ||
276 | inode->i_mode = mode; | ||
277 | if (error > 0) { | 274 | if (error > 0) { |
278 | /* This is an extended ACL */ | 275 | /* This is an extended ACL */ |
279 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); | 276 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); |