From: Sage Weil Date: Wed, 10 Mar 2010 20:03:32 +0000 (-0800) Subject: ceph: fix possible double-free of mds request reference X-Git-Tag: upstream/snapshot3+hdmi~14940^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=393f66209669ad23f4f6d4191234c1df4367df3c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ceph: fix possible double-free of mds request reference Clear pointer to mds request after dropping the reference to ensure we don't drop it again, as there is at least one error path through this function that does not reset fi->last_readdir to a new value. Signed-off-by: Sage Weil --- diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 5107384..8a9116e 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -288,8 +288,10 @@ more: CEPH_MDS_OP_LSSNAP : CEPH_MDS_OP_READDIR; /* discard old result, if any */ - if (fi->last_readdir) + if (fi->last_readdir) { ceph_mdsc_put_request(fi->last_readdir); + fi->last_readdir = NULL; + } /* requery frag tree, as the frag topology may have changed */ frag = ceph_choose_frag(ceph_inode(inode), frag, NULL, NULL);