From: Akira Fujita Date: Sun, 6 Sep 2009 02:46:29 +0000 (-0400) Subject: ext4: Return exchanged blocks count to user space in failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d6669133d8cdbb7cbe0e1f0f3744e7802a84afe;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ext4: Return exchanged blocks count to user space in failure Return exchanged blocks count (moved_len) to user space, if ext4_move_extents() failed on the way. Signed-off-by: Akira Fujita Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 7050a9cd04a4..c1cdf613e725 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -243,10 +243,9 @@ setversion_out: 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; }