Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d666913 authored by Akira Fujita's avatar Akira Fujita Committed by Theodore Ts'o
Browse files

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: default avatarAkira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent daea696d
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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)))
		if (copy_to_user((struct move_extent *)arg, &me, sizeof(me)))
			return -EFAULT;

		return err;
	}