fuse: Try automatically load kio module

Submitted by Kirill Tkhai on May 9, 2018, 2:05 p.m.

Details

Message ID 152587468292.6421.8834935521787953327.stgit@localhost.localdomain
State New
Series "fuse: Try automatically load kio module"
Headers show

Commit Message

Kirill Tkhai May 9, 2018, 2:05 p.m.
Make admin and developer life easier: load the module
automatically, avoid manual modprobe.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/inode.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f89bda719c71..9941561587ff 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -500,7 +500,8 @@  EXPORT_SYMBOL_GPL(fuse_unregister_kio);
 static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
 {
 	struct fuse_kio_ops *ops;
-
+	bool once = true;
+again:
 	mutex_lock(&fuse_mutex);
 	list_for_each_entry(ops, &fuse_kios_list, list) {
 		if (!strncmp(name, ops->name, FUSE_KIO_NAME) &&
@@ -511,6 +512,11 @@  static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
 		}
 	}
 	mutex_unlock(&fuse_mutex);
+	if (once) {
+		once = false;
+		request_module("fuse_kio_%s", name);
+		goto again;
+	}
 	return NULL;
 }