aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Whitney <enwlinux@gmail.com>2015-06-21 21:38:03 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-06-21 21:38:03 -0400
commit04e22412f420ade46dbf792a10e7f0d26ae55359 (patch)
tree57d9c884fba210c7c71e48580ce58bbe3e052b31
parentc27e43a10c9755231f8a1c618efc1ac299dd5007 (diff)
ext4: make online defrag error reporting consistent
Make the error reporting behavior resulting from the unsupported use of online defrag on files with data journaling enabled consistent with that implemented for bigalloc file systems. Difference found with ext4/308. Signed-off-by: Eric Whitney <enwlinux@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/ext4/move_extent.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 8c04afb90b1b..fb6f11709ae6 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -571,12 +571,16 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
571 orig_inode->i_ino, donor_inode->i_ino); 571 orig_inode->i_ino, donor_inode->i_ino);
572 return -EINVAL; 572 return -EINVAL;
573 } 573 }
574 /* TODO: This is non obvious task to swap blocks for inodes with full 574
575 jornaling enabled */ 575 /* TODO: it's not obvious how to swap blocks for inodes with full
576 journaling enabled */
576 if (ext4_should_journal_data(orig_inode) || 577 if (ext4_should_journal_data(orig_inode) ||
577 ext4_should_journal_data(donor_inode)) { 578 ext4_should_journal_data(donor_inode)) {
578 return -EINVAL; 579 ext4_msg(orig_inode->i_sb, KERN_ERR,
580 "Online defrag not supported with data journaling");
581 return -EOPNOTSUPP;
579 } 582 }
583
580 /* Protect orig and donor inodes against a truncate */ 584 /* Protect orig and donor inodes against a truncate */
581 lock_two_nondirectories(orig_inode, donor_inode); 585 lock_two_nondirectories(orig_inode, donor_inode);
582 586