提交 7a62a523 编写于 作者: S Shaohua Li 提交者: Jens Axboe

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: NShaohua Li <shli@fb.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 d2a61918
...@@ -264,7 +264,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, ...@@ -264,7 +264,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
if (unlikely(bio.bi_error)) if (unlikely(bio.bi_error))
return bio.bi_error; return bio.bi_error;
iocb->ki_pos += ret;
return ret; return ret;
} }
...@@ -411,10 +410,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) ...@@ -411,10 +410,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
ret = dio->bio.bi_error; ret = dio->bio.bi_error;
if (likely(!ret)) { if (likely(!ret))
ret = dio->size; ret = dio->size;
iocb->ki_pos += ret;
}
bio_put(&dio->bio); bio_put(&dio->bio);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册