From: Yan, Zheng Date: Tue, 26 Jan 2016 15:05:37 +0000 (+0800) Subject: ceph: fix snap context leak in error path X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~10788^2~6 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=db6aed70235b35a113e1b0e81cb293fd2e92de0f;p=mirror_ubuntu-focal-kernel.git ceph: fix snap context leak in error path Signed-off-by: Yan, Zheng --- diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 7c85ddef68ab..eb9028e8cfc5 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -716,7 +716,6 @@ static void ceph_aio_retry_work(struct work_struct *work) ceph_osdc_build_request(req, req->r_ops[0].extent.offset, snapc, CEPH_NOSNAP, &aio_req->mtime); - ceph_put_snap_context(snapc); ceph_osdc_put_request(orig_req); req->r_callback = ceph_aio_complete_req; @@ -731,6 +730,7 @@ out: ceph_aio_complete_req(req, NULL); } + ceph_put_snap_context(snapc); kfree(aio_work); }