Whamcloud - gitweb
LU-1994 kernel: fix reference counting with l_dentry_open
authorJeff Mahoney <jeffm@suse.com>
Thu, 21 Feb 2013 15:05:53 +0000 (10:05 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Mar 2013 18:18:55 +0000 (14:18 -0400)
commit1e149bef8d832aade6c04b65b8308b71c6d523ed
treecfbf7d761e483b09c3457244b6d314e13534b670
parent34d5ccc193c948c5946f2363976de09eb0f2ab10
LU-1994 kernel: fix reference counting with l_dentry_open

Commit 78b1d1bd (LU-1994 kernel: 3.6 dentry_open uses struct path
as first arg) added support for the new dentry_open call that
accepts struct path instead of a dentry/vfsmount pair, but missed
the new reference counting rules that go along with it.

Upstream commit 765927b2 also makes dentry_open grab references itself
so it no longer frees references that weren't passed to it.

On failure, we'll end up with an extra reference to the dentry
that was passed in.

Since new dentry_open is the one that will be around for the
foreseeable future, let's just map to that directly for the path case.

For the other two cases, we'll take the references ourselves in
ll_dentry_open, free them on failure, and adjust callers to expect
that it won't free any references passed to it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: I05a95cf735a5b2d70273a485335d571fcda7a6b0
Reviewed-on: http://review.whamcloud.com/5330
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/include/linux/lustre_compat25.h
lustre/lvfs/lvfs_linux.c
lustre/obdclass/llog_lvfs.c