Commit eda597e2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Ext3 xattr credits fix for quotas

From: Andreas Gruenbacher <agruen@suse.de>

The xattr and acl code are not properly reserving credits for quotas.
EXT3_DATA_TRANS_BLOCKS is an overestimate of the credits required including
quotas.  Make it a little more tight, and use it in the xattr and acl code
to be quota safe.
parent 2e1972fa
......@@ -425,7 +425,7 @@ ext3_acl_chmod(struct inode *inode)
if (!error) {
handle_t *handle;
handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
if (IS_ERR(handle)) {
error = PTR_ERR(handle);
ext3_std_error(inode->i_sb, error);
......@@ -531,7 +531,7 @@ ext3_xattr_set_acl(struct inode *inode, int type, const void *value,
} else
acl = NULL;
handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
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);
......
......@@ -875,7 +875,7 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
handle_t *handle;
int error, error2;
handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
if (IS_ERR(handle))
error = PTR_ERR(handle);
else
......
......@@ -30,10 +30,11 @@
#define EXT3_SINGLEDATA_TRANS_BLOCKS 8U
/* Extended attributes may touch two data buffers, two bitmap buffers,
* and two group and summaries. */
/* Extended attribute operations touch at most two data buffers,
* two bitmap buffers, and two group summaries, in addition to the inode
* and the superblock, which are already accounted for. */
#define EXT3_XATTR_TRANS_BLOCKS 8
#define EXT3_XATTR_TRANS_BLOCKS 6U
/* Define the minimum size for a transaction which modifies data. This
* needs to take into account the fact that we may end up modifying two
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment