diff options
author | Shaohua Li <shli@fb.com> | 2016-12-13 19:07:55 -0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-12-13 21:07:08 -0700 |
commit | 7a62a52333f8b5b82753d9529c11b3404bc5c183 (patch) | |
tree | b194e9735e3a8d5a60e5cc81c46613dc86fddcad /fs/block_dev.c | |
parent | d2a61918401ea8db8a6f922e98e86a66b4930cec (diff) | |
download | linux-7a62a52333f8b5b82753d9529c11b3404bc5c183.tar.bz2 |
block_dev: don't update file access position for sync direct IO
For sync direct IO, generic_file_direct_write/generic_file_read_iter
will update file access position. Don't duplicate the update in
.direct_IO. This cause my raid array can't assemble.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index d4f23353ee4d..7c4507224ed6 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -264,7 +264,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, if (unlikely(bio.bi_error)) return bio.bi_error; - iocb->ki_pos += ret; return ret; } @@ -411,10 +410,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) __set_current_state(TASK_RUNNING); ret = dio->bio.bi_error; - if (likely(!ret)) { + if (likely(!ret)) ret = dio->size; - iocb->ki_pos += ret; - } bio_put(&dio->bio); return ret; |