* [PATCH] fuse: disable some features for readonly mount
@ 2021-11-17 11:43 Peng Hao
0 siblings, 0 replies; only message in thread
From: Peng Hao @ 2021-11-17 11:43 UTC (permalink / raw)
To: miklos; +Cc: linux-fsdevel
auto_inval_data and parallel_dirops features are not necessary
for read-only mount.
Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
fs/fuse/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 36cd03114b6d..de9e15091715 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1109,7 +1109,7 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
if (arg->flags & FUSE_DONT_MASK)
fc->dont_mask = 1;
if (arg->flags & FUSE_AUTO_INVAL_DATA)
- fc->auto_inval_data = 1;
+ fc->auto_inval_data = sb_rdonly(fm->sb) ? 0 : 1;
else if (arg->flags & FUSE_EXPLICIT_INVAL_DATA)
fc->explicit_inval_data = 1;
if (arg->flags & FUSE_DO_READDIRPLUS) {
@@ -1122,7 +1122,7 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
if (arg->flags & FUSE_WRITEBACK_CACHE)
fc->writeback_cache = 1;
if (arg->flags & FUSE_PARALLEL_DIROPS)
- fc->parallel_dirops = 1;
+ fc->parallel_dirops = sb_rdonly(fm->sb) ? 0 : 1;
if (arg->flags & FUSE_HANDLE_KILLPRIV)
fc->handle_killpriv = 1;
if (arg->time_gran && arg->time_gran <= 1000000000)
--
2.27.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-17 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-17 11:43 [PATCH] fuse: disable some features for readonly mount Peng Hao
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).