Skip to content

Commit

Permalink
ext4: Return exchanged blocks count to user space in failure
Browse files Browse the repository at this point in the history
Return exchanged blocks count (moved_len) to user space,
if ext4_move_extents() failed on the way.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Akira Fujita authored and Theodore Ts'o committed Sep 6, 2009
1 parent daea696 commit 8d66691
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,9 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
me.donor_start, me.len, &me.moved_len);
fput(donor_filp);

if (!err)
if (copy_to_user((struct move_extent *)arg,
&me, sizeof(me)))
return -EFAULT;
if (copy_to_user((struct move_extent *)arg, &me, sizeof(me)))
return -EFAULT;

return err;
}

Expand Down

0 comments on commit 8d66691

Please sign in to comment.