]> 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)
commit2023a35612a5835577373c830039d9388cc37fa8
treeddc5e055445ad57ec2da3f1216ee2b4ef8ded4e7
parente0fb4b79137d09dc772f0b27502add7ab5e5931d
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