mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] block_dev: don't update file access position for sync direct IO
@ 2016-12-14  3:07 Shaohua Li
  2016-12-14  4:08 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Shaohua Li @ 2016-12-14  3:07 UTC (permalink / raw)
  To: linux-block, linux-kernel; +Cc: kernel-team, Christoph Hellwig, Jens Axboe

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>
---
 fs/block_dev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 95acbd2..1eb7dcf 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;
-- 
2.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block_dev: don't update file access position for sync direct IO
  2016-12-14  3:07 [PATCH] block_dev: don't update file access position for sync direct IO Shaohua Li
@ 2016-12-14  4:08 ` Jens Axboe
  2016-12-14 10:20   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2016-12-14  4:08 UTC (permalink / raw)
  To: Shaohua Li, linux-block, linux-kernel; +Cc: kernel-team, Christoph Hellwig

On 12/13/2016 08:07 PM, Shaohua Li wrote:
> 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.

That's not great... Thanks, added.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block_dev: don't update file access position for sync direct IO
  2016-12-14  4:08 ` Jens Axboe
@ 2016-12-14 10:20   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2016-12-14 10:20 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Shaohua Li, linux-block, linux-kernel, kernel-team, Christoph Hellwig

On Tue, Dec 13, 2016 at 09:08:18PM -0700, Jens Axboe wrote:
> That's not great... Thanks, added.

Ooops, yeah - we're still going through ->direct_IO for block devices.
I'll take a stab at removing that, as it's just a pointless indirect
call.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-14 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14  3:07 [PATCH] block_dev: don't update file access position for sync direct IO Shaohua Li
2016-12-14  4:08 ` Jens Axboe
2016-12-14 10:20   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®