All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: direct-io: fix missing sdio->boundary
@ 2021-03-22  4:22 Jack Qiu
  2021-03-22 11:28 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Qiu @ 2021-03-22  4:22 UTC (permalink / raw)
  To: viro, akpm, jack; +Cc: linux-fsdevel, jack.qiu

Function dio_send_cur_page may clear sdio->boundary,
so save it to avoid boundary missing.

Fixes: b1058b981272 ("direct-io: submit bio after boundary buffer is
added to it")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
---
 fs/direct-io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 9fe721dc04e0..c9023f0bb20a 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -812,6 +812,7 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
 		    struct buffer_head *map_bh)
 {
 	int ret = 0;
+	int boundary = sdio->boundary;	/* dio_send_cur_page may clear it */

 	if (dio->op == REQ_OP_WRITE) {
 		/*
@@ -850,10 +851,10 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
 	sdio->cur_page_fs_offset = sdio->block_in_file << sdio->blkbits;
 out:
 	/*
-	 * If sdio->boundary then we want to schedule the IO now to
+	 * If boundary then we want to schedule the IO now to
 	 * avoid metadata seeks.
 	 */
-	if (sdio->boundary) {
+	if (boundary) {
 		ret = dio_send_cur_page(dio, sdio, map_bh);
 		if (sdio->bio)
 			dio_bio_submit(dio, sdio);
--
2.17.1


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

* Re: [PATCH] fs: direct-io: fix missing sdio->boundary
  2021-03-22  4:22 [PATCH] fs: direct-io: fix missing sdio->boundary Jack Qiu
@ 2021-03-22 11:28 ` Jan Kara
  2021-03-28 21:40   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2021-03-22 11:28 UTC (permalink / raw)
  To: Jack Qiu; +Cc: viro, akpm, jack, linux-fsdevel

On Mon 22-03-21 12:22:53, Jack Qiu wrote:
> Function dio_send_cur_page may clear sdio->boundary,
> so save it to avoid boundary missing.
> 
> Fixes: b1058b981272 ("direct-io: submit bio after boundary buffer is
> added to it")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jack Qiu <jack.qiu@huawei.com>

Indeed. The patch looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/direct-io.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 9fe721dc04e0..c9023f0bb20a 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -812,6 +812,7 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
>  		    struct buffer_head *map_bh)
>  {
>  	int ret = 0;
> +	int boundary = sdio->boundary;	/* dio_send_cur_page may clear it */
> 
>  	if (dio->op == REQ_OP_WRITE) {
>  		/*
> @@ -850,10 +851,10 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
>  	sdio->cur_page_fs_offset = sdio->block_in_file << sdio->blkbits;
>  out:
>  	/*
> -	 * If sdio->boundary then we want to schedule the IO now to
> +	 * If boundary then we want to schedule the IO now to
>  	 * avoid metadata seeks.
>  	 */
> -	if (sdio->boundary) {
> +	if (boundary) {
>  		ret = dio_send_cur_page(dio, sdio, map_bh);
>  		if (sdio->bio)
>  			dio_bio_submit(dio, sdio);
> --
> 2.17.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH] fs: direct-io: fix missing sdio->boundary
  2021-03-22 11:28 ` Jan Kara
@ 2021-03-28 21:40   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2021-03-28 21:40 UTC (permalink / raw)
  To: Jan Kara; +Cc: Jack Qiu, viro, linux-fsdevel

On Mon, 22 Mar 2021 12:28:47 +0100 Jan Kara <jack@suse.cz> wrote:

> On Mon 22-03-21 12:22:53, Jack Qiu wrote:
> > Function dio_send_cur_page may clear sdio->boundary,
> > so save it to avoid boundary missing.
> > 
> > Fixes: b1058b981272 ("direct-io: submit bio after boundary buffer is
> > added to it")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
> 
> Indeed. The patch looks good to me. Feel free to add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

It's been 8 years and nobody has noticed.  I'm struggling to see the
cc:stable justification here.  Do we have any performance measurements
which would justify backporting?


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

end of thread, other threads:[~2021-03-28 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22  4:22 [PATCH] fs: direct-io: fix missing sdio->boundary Jack Qiu
2021-03-22 11:28 ` Jan Kara
2021-03-28 21:40   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.