[Devel] [PATCH RHEL7 COMMIT] fuse kio: Do not get useless fuse.ko module reference

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 9 11:50:43 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.4
------>
commit 8d3b2f09278a395337cc964fe25b0ea8fb744118
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Oct 9 11:50:40 2018 +0300

    fuse kio: Do not get useless fuse.ko module reference
    
    kio ops are registered via fuse.ko's fuse_register_kio(),
    so there is already reference to this module. Do not do
    this twice.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/inode.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 5141651493a3..9b57e65fb1ed 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -492,7 +492,6 @@ static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
 	list_for_each_entry(ops, &fuse_kios_list, list) {
 		if (!strncmp(name, ops->name, FUSE_KIO_NAME) &&
 		    ops->probe(fc, name) && try_module_get(ops->owner)) {
-			__module_get(THIS_MODULE);
 			mutex_unlock(&fuse_mutex);
 			return ops;
 		}
@@ -509,7 +508,6 @@ static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
 static void fuse_kio_put(struct fuse_kio_ops *ops)
 {
 	module_put(ops->owner);
-	module_put(THIS_MODULE);
 }
 
 static void fuse_kdirect_put(struct fuse_conn *fc)



More information about the Devel mailing list