summaryrefslogtreecommitdiff
path: root/fs/ext4/acl.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-09 15:23:03 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-09 15:23:03 -0500
commit95eaefbdececae5e781d76d03fe7472a857c8c7a (patch)
treeabe337e1490ded4166cf4d26f97cd1fe856a84ab /fs/ext4/acl.c
parent64044abf05d0842a7fed30e102fa411a744c7d9f (diff)
ext4: fix the number of credits needed for acl ops with inline data
Operations which modify extended attributes may need extra journal credits if inline data is used, since there is a chance that some extended attributes may need to get pushed to an external attribute block. Changes to reflect this was made in xattr.c, but they were missed in fs/ext4/acl.c. To fix this, abstract the calculation of the number of credits needed for xattr operations to an inline function defined in ext4_jbd2.h, and use it in acl.c and xattr.c. Also move the function declarations used in inline.c from xattr.h (where they are non-obviously hidden, and caused problems since ext4_jbd2.h needs to use the function ext4_has_inline_data), and move them to ext4.h. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Tao Ma <boyu.mt@taobao.com> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/acl.c')
-rw-r--r--fs/ext4/acl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 406cf8bb12d5..39a54a0e9fe4 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -325,7 +325,7 @@ ext4_acl_chmod(struct inode *inode)
return error;
retry:
handle = ext4_journal_start(inode, EXT4_HT_XATTR,
- EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
+ ext4_jbd2_credits_xattr(inode));
if (IS_ERR(handle)) {
error = PTR_ERR(handle);
ext4_std_error(inode->i_sb, error);
@@ -423,7 +423,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value,
retry:
handle = ext4_journal_start(inode, EXT4_HT_XATTR,
- EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
+ ext4_jbd2_credits_xattr(inode));
if (IS_ERR(handle)) {
error = PTR_ERR(handle);
goto release_and_out;