Message ID | 1259132261-16785-4-git-send-email-dmonakhov@openvz.org |
---|---|
State | Accepted, archived |
Headers | show |
On Wed, 2009-11-25 at 09:57 +0300, Dmitry Monakhov wrote: > Inside ->setattr() call both ATTR_UID and ATTR_GID may be valid > This means that we may end-up with transferring 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> Seems correct to me. It looks like ext3 need similar fix, mind to send a ext3 patch as well? Reviewed-by: Mingming Cao <cmm@us.ibm.com> > --- > fs/ext4/inode.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 211722b..d42e954 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -5439,7 +5439,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) > /* (user+group)*(old+new) structure, inode write (sb, > * inode block, ? - but truncate inode update has it) */ > handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ > - EXT4_QUOTA_DEL_BLOCKS(inode->i_sb))+3); > + EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); > if (IS_ERR(handle)) { > error = PTR_ERR(handle); > goto err_out; -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Mingming <cmm@us.ibm.com> writes: > On Wed, 2009-11-25 at 09:57 +0300, Dmitry Monakhov wrote: >> Inside ->setattr() call both ATTR_UID and ATTR_GID may be valid >> This means that we may end-up with transferring 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> > > Seems correct to me. It looks like ext3 need similar fix, mind to send a > ext3 patch as well? Done. > > Reviewed-by: Mingming Cao <cmm@us.ibm.com> >> --- >> fs/ext4/inode.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c >> index 211722b..d42e954 100644 >> --- a/fs/ext4/inode.c >> +++ b/fs/ext4/inode.c >> @@ -5439,7 +5439,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) >> /* (user+group)*(old+new) structure, inode write (sb, >> * inode block, ? - but truncate inode update has it) */ >> handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ >> - EXT4_QUOTA_DEL_BLOCKS(inode->i_sb))+3); >> + EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); >> if (IS_ERR(handle)) { >> error = PTR_ERR(handle); >> goto err_out; > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 211722b..d42e954 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5439,7 +5439,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) /* (user+group)*(old+new) structure, inode write (sb, * inode block, ? - but truncate inode update has it) */ handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ - EXT4_QUOTA_DEL_BLOCKS(inode->i_sb))+3); + EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); if (IS_ERR(handle)) { error = PTR_ERR(handle); goto err_out;
Inside ->setattr() call both ATTR_UID and ATTR_GID may be valid This means that we may end-up with transferring 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/ext4/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)