summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorEric Whitney <enwlinux@gmail.com>2015-06-22 01:38:03 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2015-06-22 01:38:03 (GMT)
commit04e22412f420ade46dbf792a10e7f0d26ae55359 (patch)
tree57d9c884fba210c7c71e48580ce58bbe3e052b31 /fs/ext4
parentc27e43a10c9755231f8a1c618efc1ac299dd5007 (diff)
downloadlinux-04e22412f420ade46dbf792a10e7f0d26ae55359.tar.xz
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>
Diffstat (limited to 'fs/ext4')
-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 8c04afb..fb6f117 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,
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 */
+
+ /* TODO: it's not obvious how to swap blocks for inodes with full
+ journaling enabled */
if (ext4_should_journal_data(orig_inode) ||
ext4_should_journal_data(donor_inode)) {
- return -EINVAL;
+ ext4_msg(orig_inode->i_sb, KERN_ERR,
+ "Online defrag not supported with data journaling");
+ return -EOPNOTSUPP;
}
+
/* Protect orig and donor inodes against a truncate */
lock_two_nondirectories(orig_inode, donor_inode);