Skip to content

Commit 3f22c74

Browse files
author
Miklos Szeredi
committed
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>
1 parent 112e723 commit 3f22c74

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎fs/fuse/fuse_i.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ struct fuse_fs_context {
479479
bool destroy:1;
480480
bool no_control:1;
481481
bool no_force_umount:1;
482+
bool no_mount_options:1;
482483
unsigned int max_read;
483484
unsigned int blksize;
484485
const char *subtype;
@@ -713,6 +714,9 @@ struct fuse_conn {
713714
/** Do not allow MNT_FORCE umount */
714715
unsigned int no_force_umount:1;
715716

717+
/* Do not show mount options */
718+
unsigned int no_mount_options:1;
719+
716720
/** The number of requests waiting for completion */
717721
atomic_t num_waiting;
718722

‎fs/fuse/inode.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ static int fuse_show_options(struct seq_file *m, struct dentry *root)
558558
struct super_block *sb = root->d_sb;
559559
struct fuse_conn *fc = get_fuse_conn_super(sb);
560560

561+
if (fc->no_mount_options)
562+
return 0;
563+
561564
seq_printf(m, ",user_id=%u", from_kuid_munged(fc->user_ns, fc->user_id));
562565
seq_printf(m, ",group_id=%u", from_kgid_munged(fc->user_ns, fc->group_id));
563566
if (fc->default_permissions)
@@ -1180,6 +1183,7 @@ int fuse_fill_super_common(struct super_block *sb, struct fuse_fs_context *ctx)
11801183
fc->destroy = ctx->destroy;
11811184
fc->no_control = ctx->no_control;
11821185
fc->no_force_umount = ctx->no_force_umount;
1186+
fc->no_mount_options = ctx->no_mount_options;
11831187

11841188
err = -ENOMEM;
11851189
root = fuse_get_root_inode(sb, ctx->rootmode);

‎fs/fuse/virtio_fs.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ static int virtio_fs_fill_super(struct super_block *sb)
992992
.destroy = true,
993993
.no_control = true,
994994
.no_force_umount = true,
995+
.no_mount_options = true,
995996
};
996997

997998
mutex_lock(&virtio_fs_mutex);

0 commit comments

Comments
 (0)