Skip to content

Commit 2d4fde5

Browse files
bsberndMiklos Szeredi
authored andcommitted
fuse: prevent disabling io-uring on active connections
The enable_uring module parameter allows administrators to enable/disable io-uring support for FUSE at runtime. However, disabling io-uring while connections already have it enabled can lead to an inconsistent state. Fix this by keeping io-uring enabled on connections that were already using it, even if the module parameter is later disabled. This ensures active FUSE mounts continue to function correctly. Signed-off-by: Bernd Schubert <bschubert@ddn.com> Reviewed-by: Luis Henriques <luis@igalia.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 786412a commit 2d4fde5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/fuse/dev_uring.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,11 +1091,6 @@ int fuse_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags)
10911091
u32 cmd_op = cmd->cmd_op;
10921092
int err;
10931093

1094-
if (!enable_uring) {
1095-
pr_info_ratelimited("fuse-io-uring is disabled\n");
1096-
return -EOPNOTSUPP;
1097-
}
1098-
10991094
if ((unlikely(issue_flags & IO_URING_F_CANCEL))) {
11001095
fuse_uring_cancel(cmd, issue_flags);
11011096
return 0;
@@ -1112,6 +1107,12 @@ int fuse_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags)
11121107
}
11131108
fc = fud->fc;
11141109

1110+
/* Once a connection has io-uring enabled on it, it can't be disabled */
1111+
if (!enable_uring && !fc->io_uring) {
1112+
pr_info_ratelimited("fuse-io-uring is disabled\n");
1113+
return -EOPNOTSUPP;
1114+
}
1115+
11151116
if (fc->aborted)
11161117
return -ECONNABORTED;
11171118
if (!fc->connected)

0 commit comments

Comments
 (0)