Skip to content

Commit

Permalink
ext4: fix the number of credits needed for ext4_ext_migrate()
Browse files Browse the repository at this point in the history
The migration ioctl creates a temporary inode.  Since this inode is
never linked to a directory, we don't need to reserve journal credits
required for modifying the directory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Theodore Ts'o committed Feb 9, 2013
1 parent 8dcfaad commit 4b21763
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fs/ext4/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,14 @@ int ext4_ext_migrate(struct inode *inode)
*/
return retval;

/*
* Worst case we can touch the allocation bitmaps, a bgd
* block, and a block to link in the orphan list. We do need
* need to worry about credits for modifying the quota inode.
*/
handle = ext4_journal_start(inode, EXT4_HT_MIGRATE,
EXT4_DATA_TRANS_BLOCKS(inode->i_sb) +
EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 +
EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)
+ 1);
4 + EXT4_MAXQUOTAS_TRANS_BLOCKS(inode->i_sb));

if (IS_ERR(handle)) {
retval = PTR_ERR(handle);
return retval;
Expand Down

0 comments on commit 4b21763

Please sign in to comment.