[RHEL7,COMMIT] fs/fuse kio: fix sreq and msg leak in prepare_map_flush_ireq()

Submitted by Konstantin Khorenko on Dec. 4, 2018, 1:17 p.m.

Details

Message ID 201812041317.wB4DH9RL002700@finist-ce7.sw.ru
State New
Series "Fuse KIO: fix fsync/flush loss"
Headers show

Commit Message

Konstantin Khorenko Dec. 4, 2018, 1:17 p.m.
The commit is pushed to "branch-rh7-3.10.0-862.20.2.vz7.73.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.20.2.vz7.73.17
------>
commit 9e9fe84896d4091e11a7cfda50fe6e224762402b
Author: Pavel Butsykin <pbutsykin@virtuozzo.com>
Date:   Tue Dec 4 16:17:09 2018 +0300

    fs/fuse kio: fix sreq and msg leak in prepare_map_flush_ireq()
    
    https://pmc.acronis.com/browse/VSTOR-18475
    
    Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_map.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index 4bd18c5224ab..1e700dff2043 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -3016,6 +3016,8 @@  static int prepare_map_flush_ireq(struct pcs_map_entry *m,
 	cslist_put(cslist);
 	if (!valid_for_flush(m, timer_sync) || m->cs_list != cslist) {
 		spin_unlock(&m->lock);
+		pcs_free_msg(msg);
+		ireq_destroy(sreq);
 		return 0;
 	}
 	prepare_map_flush_msg(m, sreq, msg);