[RHEL7,COMMIT] fuse: Try automatically load kio module

Submitted by Konstantin Khorenko on May 16, 2018, 8:37 a.m.

Details

Message ID 201805160837.w4G8b1DI028863@finist_ce7.work
State New
Series "fuse: Try automatically load kio module"
Headers show

Commit Message

Konstantin Khorenko May 16, 2018, 8:37 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.47.6
------>
commit 5100a4177c8bd3f3f13cefa936207f6aa02c17d1
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Wed May 16 11:37:00 2018 +0300

    fuse: Try automatically load kio module
    
    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;
 }