* [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs() @ 2021-12-20 1:52 ` Yuezhang.Mo 2021-12-21 11:57 ` Namjae Jeon 2021-12-21 12:34 ` Sungjong Seo 0 siblings, 2 replies; 3+ messages in thread From: Yuezhang.Mo @ 2021-12-20 1:52 UTC (permalink / raw) To: linkinjeon, sj1557.seo; +Cc: linux-fsdevel, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1051 bytes --] 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); } for (i = 0; i < nr_bhs && sync; i++) { -- 2.25.1 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-exfat-fix-missing-REQ_SYNC-in-exfat_update_bhs.patch --] [-- Type: text/x-patch; name="0001-exfat-fix-missing-REQ_SYNC-in-exfat_update_bhs.patch", Size: 1273 bytes --] From 6760187314aae4381ff573bd78a0153a6b831e0e Mon Sep 17 00:00:00 2001 From: "Yuezhang.Mo" <Yuezhang.Mo@sony.com> Date: Mon, 16 Aug 2021 11:30:51 +0800 Subject: [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs() 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); } for (i = 0; i < nr_bhs && sync; i++) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs() 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 1 sibling, 0 replies; 3+ messages in thread From: Namjae Jeon @ 2021-12-21 11:57 UTC (permalink / raw) To: Yuezhang.Mo; +Cc: sj1557.seo, linux-fsdevel, linux-kernel 2021-12-20 10:52 GMT+09:00, Yuezhang.Mo@sony.com <Yuezhang.Mo@sony.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> Applied, Thanks for your patch. ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] exfat: fix missing REQ_SYNC in exfat_update_bhs() 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 1 sibling, 0 replies; 3+ messages in thread From: Sungjong Seo @ 2021-12-21 12:34 UTC (permalink / raw) To: linkinjeon; +Cc: linux-fsdevel, linux-kernel, sj1557.seo > 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-21 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).