]> git.michaelhowe.org Git - packages/o/openafs.git/commit
LINUX: Sometimes let dentry_open handle refcounts
authorAndrew Deason <adeason@sinenomine.net>
Wed, 17 Apr 2013 23:04:58 +0000 (18:04 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 7 May 2013 15:03:03 +0000 (08:03 -0700)
commitd99de7f2e869c9dcf2873f0c62d7fbe54f7afe43
treeaa4a13da2142e3bbc5d779dbac2cdf4d20590fe9
parentd572281d5db2896362e9addf8a8157c618e3a776
LINUX: Sometimes let dentry_open handle refcounts

When Linux changed dentry_open to use a 'path' argument, they also
changed it so dentry_open handles incrementing the relevant ref
counts. So now, sometimes we need to inc the dentry and vfsmount
refcounts ourselves, and sometimes we need to leave them alone.

To accommodate this, change afs_dentry_open to also handle refcounting
itself, and 'get' the given dentry and vfsmount if necessary.

Also note that currently, afs_linux_raw_open can call afs_dentry_open
twice in the case of an error, but it does not dget(dp). This means
that dp could be undercounted, since dentry_open on older kernels will
dec the refcount on the given dentry in the case of an error. This
change should also fix this so dp is not undercounted in that case.

FIXES 131613

Reviewed-on: http://gerrit.openafs.org/9801
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit e31240732cbe449fedea5095037ac08d1d513fa9)

Change-Id: I082063d324d99c3d02ed372a1c20462f13bb4a26
Reviewed-on: http://gerrit.openafs.org/9803
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_file.c