All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sungjong Seo" <sj1557.seo@samsung.com>
To: <linkinjeon@kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sj1557.seo@samsung.com>
Subject: RE: [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs()
Date: Tue, 21 Dec 2021 21:34:58 +0900	[thread overview]
Message-ID: <002001d7f667$2a968190$7fc384b0$@samsung.com> (raw)
In-Reply-To: <HK2PR04MB3891563FC310AE5E70896932817B9@HK2PR04MB3891.apcprd04.prod.outlook.com>

> If 'dirsync' is enabled, all directory updates within the
> filesystem should be done synchronously. exfat_update_bh()
> does as this, but exfat_update_bhs() does not.
> 
> Signed-off-by: Yuezhang.Mo <Yuezhang.Mo@sony.com>
> Reviewed-by: Andy.Wu <Andy.Wu@sony.com>
> Reviewed-by: Aoyama, Wataru <wataru.aoyama@sony.com>
> Reviewed-by: Kobayashi, Kento <Kento.A.Kobayashi@sony.com>
> ---
>  fs/exfat/misc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/exfat/misc.c b/fs/exfat/misc.c
> index d34e6193258d..d5bd8e6d9741 100644
> --- a/fs/exfat/misc.c
> +++ b/fs/exfat/misc.c
> @@ -10,6 +10,7 @@
>  #include <linux/fs.h>
>  #include <linux/slab.h>
>  #include <linux/buffer_head.h>
> +#include <linux/blk_types.h>
> 
>  #include "exfat_raw.h"
>  #include "exfat_fs.h"
> @@ -180,7 +181,7 @@ int exfat_update_bhs(struct buffer_head **bhs, int
> nr_bhs, int sync)
>  		set_buffer_uptodate(bhs[i]);
>  		mark_buffer_dirty(bhs[i]);
>  		if (sync)
> -			write_dirty_buffer(bhs[i], 0);
> +			write_dirty_buffer(bhs[i], REQ_SYNC);

I think there is no problem in terms of functionality related to
"synchronously" in the original code. However, REQ_SYNC could affect
I/O scheduling, and exfat_update_bh() already requests I/O with this
flag by calling sync_dirty_buffer(). And it is desirable for two
functions to have the same concept for I/O requests.

So, the original code does not seem like a bug,
but this patch looks useful.
Thanks.

Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>

>  	}
> 
>  	for (i = 0; i < nr_bhs && sync; i++) {
> --
> 2.25.1


      parent reply	other threads:[~2021-12-21 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20211220015249epcas1p4870b0ee2aeedbc4ca3b0b6e39361d4bb@epcas1p4.samsung.com>
2021-12-20  1:52 ` [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs() Yuezhang.Mo
2021-12-21 11:57   ` Namjae Jeon
2021-12-21 12:34   ` Sungjong Seo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002001d7f667$2a968190$7fc384b0$@samsung.com' \
    --to=sj1557.seo@samsung.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.