diff mbox

ext3: fix incorrect block reservation on quota transfer.

Message ID 1260254781-18041-2-git-send-email-dmonakhov@openvz.org
State Not Applicable, archived
Headers show

Commit Message

Dmitry Monakhov Dec. 8, 2009, 6:46 a.m. UTC
Inside ->setattr() call  both ATTR_UID and ATTR_GID may be valid
This means that we end-up with transering all quotas. Add we have
to reserve QUOTA_DEL_BLOCKS for all quotas, as we do in case of
QUOTA_INIT_BLOCKS.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext3/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jan Kara Dec. 10, 2009, 3:52 p.m. UTC | #1
> Inside ->setattr() call  both ATTR_UID and ATTR_GID may be valid
> This means that we end-up with transering all quotas. Add we have
> to reserve QUOTA_DEL_BLOCKS for all quotas, as we do in case of
> QUOTA_INIT_BLOCKS.
  Actually, this is a bug introduced by your previous patch (there used
to be a brace after 2*) ;). I've merged this change into your previous
patch.
								Honza
diff mbox

Patch

diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 1c99eba..477927b 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -3137,7 +3137,7 @@  int ext3_setattr(struct dentry *dentry, struct iattr *attr)
 		/* (user+group)*(old+new) structure, inode write (sb,
 		 * inode block, ? - but truncate inode update has it) */
 		handle = ext3_journal_start(inode, EXT3_ALL_QUOTAS_INIT_BLOCKS(inode->i_sb)+
-					EXT3_QUOTA_DEL_BLOCKS(inode->i_sb)+3);
+					EXT3_ALL_QUOTAS_DEL_BLOCKS(inode->i_sb)+3);
 		if (IS_ERR(handle)) {
 			error = PTR_ERR(handle);
 			goto err_out;