]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do not overwrite error return value in the balance ioctl
authorFilipe Manana <fdmanana@suse.com>
Tue, 8 Jan 2019 11:42:01 +0000 (11:42 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:21 +0000 (14:13 +0100)
commit7333c7cb4baaed52a506fb79446b030626d0a883
tree4ab81a974750e3ae29b14866a0e936edf3afd278
parent26288d6fb17ef903f4234fd7f080d55168e3fa0f
Btrfs: do not overwrite error return value in the balance ioctl

If the call to btrfs_balance() failed we would overwrite the error
returned to user space with -EFAULT if the call to copy_to_user() failed
as well. Fix that by calling copy_to_user() only if btrfs_balance()
returned success or was canceled.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c