client: Fix ref counting double free with hardlink

Peforming a hard link through the libcephfs interface causes
a double free on shutdown, due to the Client::link call decrementing
the parent (of the target) directory's inode.  This fix removes the
put_inode(dir) call, to match the behavior of Client::ll_link.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sam Lang 2012-10-29 10:30:01 -05:00 committed by Sage Weil
parent 49ca7d50f9
commit 1638f62668

View File

@ -3777,7 +3777,6 @@ int Client::link(const char *relexisting, const char *relpath)
if (r < 0)
goto out_unlock;
r = _link(in, dir, name.c_str());
put_inode(dir);
out_unlock:
put_inode(in);
out: