From: Dave Chinner Date: Wed, 16 Apr 2014 22:15:27 +0000 (+1000) Subject: xfs: wrong error sign conversion during failed DIO writes X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~14573^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=07d5035a289f8bebe0ea86c293b2d5412478c481;p=mirror_ubuntu-focal-kernel.git xfs: wrong error sign conversion during failed DIO writes We negate the error value being returned from a generic function incorrectly. The code path that it is running in returned negative errors, so there is no need to negate it to get the correct error signs here. This was uncovered by generic/019. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 79e96ce98733..82afdcb33183 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -679,7 +679,7 @@ xfs_file_dio_aio_write( goto out; if (mapping->nrpages) { - ret = -filemap_write_and_wait_range(VFS_I(ip)->i_mapping, + ret = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, pos, -1); if (ret) goto out;