summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-09 12:50:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-09 12:50:27 -0500
commit4b217630d0ec277c961e57f6d2985433b352c2ce (patch)
treef3c5b921d2dd825677b73ee4d4fb97c586d7661a /fs
parent8dcfaad244cdfa245cc2b4ddf42cea5fd8b80ece (diff)
downloadop-kernel-dev-4b217630d0ec277c961e57f6d2985433b352c2ce.zip
op-kernel-dev-4b217630d0ec277c961e57f6d2985433b352c2ce.tar.gz
ext4: fix the number of credits needed for ext4_ext_migrate()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/migrate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 4e4fcfd..480acf4 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -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;
OpenPOWER on IntegriCloud