Skip to content

Commit

Permalink
ext4: make online defrag error reporting consistent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Whitney authored and Theodore Ts'o committed Jun 22, 2015
1 parent c27e43a commit 04e2241
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 04e2241

Please sign in to comment.