Skip to content

Commit 194074a

Browse files
Dmitry Monakhovtytso
Dmitry Monakhov
authored andcommitted
ext4: fix incorrect block reservation on quota transfer.
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 <[email protected]> Reviewed-by: Mingming Cao <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
1 parent 5aca07e commit 194074a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/inode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5176,7 +5176,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
51765176
/* (user+group)*(old+new) structure, inode write (sb,
51775177
* inode block, ? - but truncate inode update has it) */
51785178
handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+
5179-
EXT4_QUOTA_DEL_BLOCKS(inode->i_sb))+3);
5179+
EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3);
51805180
if (IS_ERR(handle)) {
51815181
error = PTR_ERR(handle);
51825182
goto err_out;

0 commit comments

Comments
 (0)