Skip to content

Commit cfc84c9

Browse files
SteapAlex Elder
authored andcommitted
ceph: fix dentry reference leak in ceph_encode_fh().
dput() was not called in the error path. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Reviewed-by: Alex Elder <elder@inktank.com>
1 parent 22cddde commit cfc84c9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/ceph/export.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
5656
struct ceph_nfs_confh *cfh = (void *)rawfh;
5757
int connected_handle_length = sizeof(*cfh)/4;
5858
int handle_length = sizeof(*fh)/4;
59-
struct dentry *dentry = d_find_alias(inode);
59+
struct dentry *dentry;
6060
struct dentry *parent;
6161

6262
/* don't re-export snaps */
6363
if (ceph_snap(inode) != CEPH_NOSNAP)
6464
return -EINVAL;
6565

66+
dentry = d_find_alias(inode);
67+
6668
/* if we found an alias, generate a connectable fh */
6769
if (*max_len >= connected_handle_length && dentry) {
6870
dout("encode_fh %p connectable\n", dentry);

0 commit comments

Comments
 (0)