VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / ext3 / acl.c
index 7fd70c8..a3cf77d 100644 (file)
@@ -164,7 +164,7 @@ ext3_get_acl(struct inode *inode, int type)
        int retval;
 
        if (!test_opt(inode->i_sb, POSIX_ACL))
-               return 0;
+               return NULL;
 
        switch(type) {
                case ACL_TYPE_ACCESS:
@@ -428,7 +428,9 @@ ext3_acl_chmod(struct inode *inode)
        error = posix_acl_chmod_masq(clone, inode->i_mode);
        if (!error) {
                handle_t *handle;
+               int retries = 0;
 
+       retry:
                handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
                if (IS_ERR(handle)) {
                        error = PTR_ERR(handle);
@@ -437,6 +439,9 @@ ext3_acl_chmod(struct inode *inode)
                }
                error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
                ext3_journal_stop(handle);
+               if (error == -ENOSPC &&
+                   ext3_should_retry_alloc(inode->i_sb, &retries))
+                       goto retry;
        }
 out:
        posix_acl_release(clone);
@@ -516,7 +521,7 @@ ext3_xattr_set_acl(struct inode *inode, int type, const void *value,
 {
        handle_t *handle;
        struct posix_acl *acl;
-       int error;
+       int error, retries = 0;
 
        if (!test_opt(inode->i_sb, POSIX_ACL))
                return -EOPNOTSUPP;
@@ -535,11 +540,14 @@ ext3_xattr_set_acl(struct inode *inode, int type, const void *value,
        } else
                acl = NULL;
 
+retry:
        handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
        if (IS_ERR(handle))
                return PTR_ERR(handle);
        error = ext3_set_acl(handle, inode, type, acl);
        ext3_journal_stop(handle);
+       if (error == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
+               goto retry;
 
 release_and_out:
        posix_acl_release(acl);