]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: return EAGAIN if defrag is canceled
authorTian Tao <tiantao6@hisilicon.com>
Wed, 5 May 2021 01:26:28 +0000 (09:26 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:05 +0000 (15:19 +0200)
commite334d62a807c48b15d6d0d148567dd6b8a00a771
treeddc5e055445ad57ec2da3f1216ee2b4ef8ded4e7
parent0608d822a7c21248063c580fd0cdcdc7517bdd24
btrfs: return EAGAIN if defrag is canceled

When inode defrag is canceled, the error is set to EAGAIN but then
overwritten by number of defragmented bytes. As this would hide the
error, rather return EAGAIN. This does not harm 'btrfs fi defrag', it
will print the error and continue to next file (as it does in for any
other error).

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c