From: Dmitry Monakhov Date: Wed, 26 Sep 2012 16:32:54 +0000 (-0400) Subject: ext4: online defrag is not supported for journaled files X-Git-Tag: next-20120928~104^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=feafdc0049a15308053e514a55ddfdfca10347fd;p=karo-tx-linux.git ext4: online defrag is not supported for journaled files Proper block swap for inodes with full journaling enabled is truly non obvious task. In order to be on a safe side let's explicitly disable it for now. Signed-off-by: Dmitry Monakhov Signed-off-by: "Theodore Ts'o" Cc: stable@vger.kernel.org --- diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index df5cde5130c5..e2016f34b58f 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -1142,7 +1142,12 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, orig_inode->i_ino, donor_inode->i_ino); return -EINVAL; } - + /* TODO: This is non obvious task to swap blocks for inodes with full + jornaling enabled */ + if (ext4_should_journal_data(orig_inode) || + ext4_should_journal_data(donor_inode)) { + return -EINVAL; + } /* Protect orig and donor inodes against a truncate */ mext_inode_double_lock(orig_inode, donor_inode);