xfs: wrong error sign conversion during failed DIO writes
authorDave Chinner <dchinner@redhat.com>
Wed, 16 Apr 2014 22:15:27 +0000 (08:15 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 16 Apr 2014 22:15:27 +0000 (08:15 +1000)
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 <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_file.c

index 79e96ce987331cad3aab2d0a7513ce19cad2fcb4..82afdcb33183951350df18d3ce05b3aeecdf3e76 100644 (file)
@@ -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;