Skip to content

Commit 15c8e72

Browse files
rhvgoyalMiklos Szeredi
authored andcommitted
fuse: allow skipping control interface and forced unmount
virtio-fs does not support aborting requests which are being processed. That is requests which have been sent to fuse daemon on host. Signed-off-by: Vivek Goyal <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 783863d commit 15c8e72

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

fs/fuse/fuse_i.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ struct fuse_fs_context {
468468
bool default_permissions:1;
469469
bool allow_other:1;
470470
bool destroy:1;
471+
bool no_control:1;
472+
bool no_force_umount:1;
471473
unsigned int max_read;
472474
unsigned int blksize;
473475
const char *subtype;
@@ -696,6 +698,12 @@ struct fuse_conn {
696698
/* Delete dentries that have gone stale */
697699
unsigned int delete_stale:1;
698700

701+
/** Do not create entry in fusectl fs */
702+
unsigned int no_control:1;
703+
704+
/** Do not allow MNT_FORCE umount */
705+
unsigned int no_force_umount:1;
706+
699707
/** The number of requests waiting for completion */
700708
atomic_t num_waiting;
701709

fs/fuse/inode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ void fuse_unlock_inode(struct inode *inode, bool locked)
364364

365365
static void fuse_umount_begin(struct super_block *sb)
366366
{
367-
fuse_abort_conn(get_fuse_conn_super(sb));
367+
struct fuse_conn *fc = get_fuse_conn_super(sb);
368+
369+
if (!fc->no_force_umount)
370+
fuse_abort_conn(fc);
368371
}
369372

370373
static void fuse_send_destroy(struct fuse_conn *fc)
@@ -1171,6 +1174,8 @@ int fuse_fill_super_common(struct super_block *sb, struct fuse_fs_context *ctx)
11711174
fc->group_id = ctx->group_id;
11721175
fc->max_read = max_t(unsigned, 4096, ctx->max_read);
11731176
fc->destroy = ctx->destroy;
1177+
fc->no_control = ctx->no_control;
1178+
fc->no_force_umount = ctx->no_force_umount;
11741179

11751180
err = -ENOMEM;
11761181
root = fuse_get_root_inode(sb, ctx->rootmode);

0 commit comments

Comments
 (0)