[Devel] [PATCH] fs/fuse kio: fix fuse_mutex leak in pcs_fuse_stat_fini()

Pavel Butsykin pbutsykin at virtuozzo.com
Wed Jul 3 15:09:01 MSK 2019


Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/fuse_stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/kio/pcs/fuse_stat.c b/fs/fuse/kio/pcs/fuse_stat.c
index bc3879d33de9..580f655e7567 100644
--- a/fs/fuse/kio/pcs/fuse_stat.c
+++ b/fs/fuse/kio/pcs/fuse_stat.c
@@ -848,8 +848,10 @@ fail1:
 void pcs_fuse_stat_fini(struct pcs_fuse_stat *stat)
 {
 	mutex_lock(&fuse_mutex);
-	if (!stat->kio_stat)
+	if (!stat->kio_stat) {
+		mutex_unlock(&fuse_mutex);
 		return;
+	}
 
 	if (fuse_control_sb) {
 		if (stat->iostat)
@@ -864,6 +866,7 @@ void pcs_fuse_stat_fini(struct pcs_fuse_stat *stat)
 			fuse_kio_rm_dentry(stat->cs_stats);
 		fuse_kio_rm_dentry(stat->kio_stat);
 	}
+	stat->kio_stat = NULL;
 	mutex_unlock(&fuse_mutex);
 
 	cancel_delayed_work_sync(&stat->work);
-- 
2.15.1



More information about the Devel mailing list