diff options
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/btrfs/file.c | 2 | ||||
-rw-r--r-- | fs/ext4/file.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 1e86823a9cbd..e4cba21a627e 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1523,7 +1523,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1523 | ssize_t err; | 1523 | ssize_t err; |
1524 | 1524 | ||
1525 | err = generic_write_sync(file, pos, ret); | 1525 | err = generic_write_sync(file, pos, ret); |
1526 | if (err < 0 && ret > 0) | 1526 | if (err < 0) |
1527 | ret = err; | 1527 | ret = err; |
1528 | } | 1528 | } |
1529 | blk_finish_plug(&plug); | 1529 | blk_finish_plug(&plug); |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 0165b8672f09..7331a230e30b 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1797,7 +1797,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1797 | BTRFS_I(inode)->last_sub_trans = root->log_transid; | 1797 | BTRFS_I(inode)->last_sub_trans = root->log_transid; |
1798 | if (num_written > 0) { | 1798 | if (num_written > 0) { |
1799 | err = generic_write_sync(file, pos, num_written); | 1799 | err = generic_write_sync(file, pos, num_written); |
1800 | if (err < 0 && num_written > 0) | 1800 | if (err < 0) |
1801 | num_written = err; | 1801 | num_written = err; |
1802 | } | 1802 | } |
1803 | 1803 | ||
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 1a5073959f32..6db7f7db7777 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -153,7 +153,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov, | |||
153 | ssize_t err; | 153 | ssize_t err; |
154 | 154 | ||
155 | err = generic_write_sync(file, iocb->ki_pos - ret, ret); | 155 | err = generic_write_sync(file, iocb->ki_pos - ret, ret); |
156 | if (err < 0 && ret > 0) | 156 | if (err < 0) |
157 | ret = err; | 157 | ret = err; |
158 | } | 158 | } |
159 | blk_finish_plug(&plug); | 159 | blk_finish_plug(&plug); |