diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2019-10-15 10:11:41 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-10-15 10:11:41 -0400 |
commit | 3f22c7467136adfa6d2a7baf7cd5c573f0641bd1 (patch) | |
tree | f5b1f84e894ec982e4d554b7169fed2d8cd698e5 | |
parent | 112e72373d1f60f1e4558d0a7f0de5da39a1224d (diff) |
virtio-fs: don't show mount options
Virtio-fs does not accept any mount options, so it's confusing and wrong to
show any in /proc/mounts.
Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r-- | fs/fuse/fuse_i.h | 4 | ||||
-rw-r--r-- | fs/fuse/inode.c | 4 | ||||
-rw-r--r-- | fs/fuse/virtio_fs.c | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 956aeaf961ae..d148188cfca4 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -479,6 +479,7 @@ struct fuse_fs_context { | |||
479 | bool destroy:1; | 479 | bool destroy:1; |
480 | bool no_control:1; | 480 | bool no_control:1; |
481 | bool no_force_umount:1; | 481 | bool no_force_umount:1; |
482 | bool no_mount_options:1; | ||
482 | unsigned int max_read; | 483 | unsigned int max_read; |
483 | unsigned int blksize; | 484 | unsigned int blksize; |
484 | const char *subtype; | 485 | const char *subtype; |
@@ -713,6 +714,9 @@ struct fuse_conn { | |||
713 | /** Do not allow MNT_FORCE umount */ | 714 | /** Do not allow MNT_FORCE umount */ |
714 | unsigned int no_force_umount:1; | 715 | unsigned int no_force_umount:1; |
715 | 716 | ||
717 | /* Do not show mount options */ | ||
718 | unsigned int no_mount_options:1; | ||
719 | |||
716 | /** The number of requests waiting for completion */ | 720 | /** The number of requests waiting for completion */ |
717 | atomic_t num_waiting; | 721 | atomic_t num_waiting; |
718 | 722 | ||
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index e040e2a2b621..16aec32f7f3d 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -558,6 +558,9 @@ static int fuse_show_options(struct seq_file *m, struct dentry *root) | |||
558 | struct super_block *sb = root->d_sb; | 558 | struct super_block *sb = root->d_sb; |
559 | struct fuse_conn *fc = get_fuse_conn_super(sb); | 559 | struct fuse_conn *fc = get_fuse_conn_super(sb); |
560 | 560 | ||
561 | if (fc->no_mount_options) | ||
562 | return 0; | ||
563 | |||
561 | seq_printf(m, ",user_id=%u", from_kuid_munged(fc->user_ns, fc->user_id)); | 564 | seq_printf(m, ",user_id=%u", from_kuid_munged(fc->user_ns, fc->user_id)); |
562 | seq_printf(m, ",group_id=%u", from_kgid_munged(fc->user_ns, fc->group_id)); | 565 | seq_printf(m, ",group_id=%u", from_kgid_munged(fc->user_ns, fc->group_id)); |
563 | if (fc->default_permissions) | 566 | if (fc->default_permissions) |
@@ -1180,6 +1183,7 @@ int fuse_fill_super_common(struct super_block *sb, struct fuse_fs_context *ctx) | |||
1180 | fc->destroy = ctx->destroy; | 1183 | fc->destroy = ctx->destroy; |
1181 | fc->no_control = ctx->no_control; | 1184 | fc->no_control = ctx->no_control; |
1182 | fc->no_force_umount = ctx->no_force_umount; | 1185 | fc->no_force_umount = ctx->no_force_umount; |
1186 | fc->no_mount_options = ctx->no_mount_options; | ||
1183 | 1187 | ||
1184 | err = -ENOMEM; | 1188 | err = -ENOMEM; |
1185 | root = fuse_get_root_inode(sb, ctx->rootmode); | 1189 | root = fuse_get_root_inode(sb, ctx->rootmode); |
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 6af3f131e468..e22a0c003c3d 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c | |||
@@ -992,6 +992,7 @@ static int virtio_fs_fill_super(struct super_block *sb) | |||
992 | .destroy = true, | 992 | .destroy = true, |
993 | .no_control = true, | 993 | .no_control = true, |
994 | .no_force_umount = true, | 994 | .no_force_umount = true, |
995 | .no_mount_options = true, | ||
995 | }; | 996 | }; |
996 | 997 | ||
997 | mutex_lock(&virtio_fs_mutex); | 998 | mutex_lock(&virtio_fs_mutex); |