add patch set-lazytime-on-remount
[ext4-patch-queue.git] / make-online-defrag-error-reporting-consistent
blob3d98225d111dbedcf4bbe2d76f51644419ec4acd
1 ext4: make online defrag error reporting consistent
3 From: Eric Whitney <enwlinux@gmail.com>
5 Make the error reporting behavior resulting from the unsupported use
6 of online defrag on files with data journaling enabled consistent with
7 that implemented for bigalloc file systems. Difference found with
8 ext4/308.
10 Signed-off-by: Eric Whitney <enwlinux@gmail.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
13 ---
14  fs/ext4/move_extent.c | 10 +++++++---
15  1 file changed, 7 insertions(+), 3 deletions(-)
17 diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
18 index 8c04afb..fb6f117 100644
19 --- a/fs/ext4/move_extent.c
20 +++ b/fs/ext4/move_extent.c
21 @@ -571,12 +571,16 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
22                         orig_inode->i_ino, donor_inode->i_ino);
23                 return -EINVAL;
24         }
25 -       /* TODO: This is non obvious task to swap blocks for inodes with full
26 -          jornaling enabled */
28 +       /* TODO: it's not obvious how to swap blocks for inodes with full
29 +          journaling enabled */
30         if (ext4_should_journal_data(orig_inode) ||
31             ext4_should_journal_data(donor_inode)) {
32 -               return -EINVAL;
33 +               ext4_msg(orig_inode->i_sb, KERN_ERR,
34 +                        "Online defrag not supported with data journaling");
35 +               return -EOPNOTSUPP;
36         }
38         /* Protect orig and donor inodes against a truncate */
39         lock_two_nondirectories(orig_inode, donor_inode);
41 -- 
42 2.1.4
45 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
46 the body of a message to majordomo@vger.kernel.org
47 More majordomo info at  http://vger.kernel.org/majordomo-info.html