aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/acl.c')
-rw-r--r--fs/ext3/acl.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 5326038e8536..7ea638acaecf 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -326,7 +326,9 @@ cleanup:
326int 326int
327ext3_acl_chmod(struct inode *inode) 327ext3_acl_chmod(struct inode *inode)
328{ 328{
329 struct posix_acl *acl, *clone; 329 struct posix_acl *acl;
330 handle_t *handle;
331 int retries = 0;
330 int error; 332 int error;
331 333
332 if (S_ISLNK(inode->i_mode)) 334 if (S_ISLNK(inode->i_mode))
@@ -336,31 +338,24 @@ ext3_acl_chmod(struct inode *inode)
336 acl = ext3_get_acl(inode, ACL_TYPE_ACCESS); 338 acl = ext3_get_acl(inode, ACL_TYPE_ACCESS);
337 if (IS_ERR(acl) || !acl) 339 if (IS_ERR(acl) || !acl)
338 return PTR_ERR(acl); 340 return PTR_ERR(acl);
339 clone = posix_acl_clone(acl, GFP_KERNEL); 341 error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
340 posix_acl_release(acl); 342 if (error)
341 if (!clone) 343 return error;
342 return -ENOMEM; 344retry:
343 error = posix_acl_chmod_masq(clone, inode->i_mode); 345 handle = ext3_journal_start(inode,
344 if (!error) { 346 EXT3_DATA_TRANS_BLOCKS(inode->i_sb));
345 handle_t *handle; 347 if (IS_ERR(handle)) {
346 int retries = 0; 348 error = PTR_ERR(handle);
347 349 ext3_std_error(inode->i_sb, error);
348 retry: 350 goto out;
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;
355 }
356 error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
357 ext3_journal_stop(handle);
358 if (error == -ENOSPC &&
359 ext3_should_retry_alloc(inode->i_sb, &retries))
360 goto retry;
361 } 351 }
352 error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl);
353 ext3_journal_stop(handle);
354 if (error == -ENOSPC &&
355 ext3_should_retry_alloc(inode->i_sb, &retries))
356 goto retry;
362out: 357out:
363 posix_acl_release(clone); 358 posix_acl_release(acl);
364 return error; 359 return error;
365} 360}
366 361