public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-ext4@vger.kernel.org
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH] ext3: fix incorrect block reservation on quota transfer.
Date: Tue, 08 Dec 2009 09:46:21 +0300	[thread overview]
Message-ID: <1260254781-18041-2-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1260254781-18041-1-git-send-email-dmonakhov@openvz.org>

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(-)

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;
-- 
1.6.0.4


  reply	other threads:[~2009-12-08  6:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08  6:46 [PATCH] ext3: quota macros cleanup Dmitry Monakhov
2009-12-08  6:46 ` Dmitry Monakhov [this message]
2009-12-10 15:52   ` [PATCH] ext3: fix incorrect block reservation on quota transfer Jan Kara
2009-12-08 23:32 ` [PATCH] ext3: quota macros cleanup Mingming
2009-12-08 23:45   ` Dmitry Monakhov
2009-12-10 15:48 ` Jan Kara
2009-12-10 15:54   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1260254781-18041-2-git-send-email-dmonakhov@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox