[PATCH] fuse: disable some features for readonly mount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



auto_inval_data and parallel_dirops features are not necessary
for read-only mount.

Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux