namei: IH_REALLYCLOSE special inode on delete
authorAndrew Deason <adeason@sinenomine.net>
Thu, 29 Aug 2013 20:33:49 +0000 (15:33 -0500)
committerD Brashear <shadow@your-file-system.com>
Mon, 1 Dec 2014 16:53:34 +0000 (11:53 -0500)
commit752d77b5561bfb6b70e203d3bfcddd93c9dffa12
treebbb0e17e22c93bb3bede14f215d57f22ddf5f320
parent5b62fac45d9eab00626f8aba9d9994d9138980c0
namei: IH_REALLYCLOSE special inode on delete

When we delete a special inode, we should IH_REALLYCLOSE it, to ensure
no other cached file handles are open for that special inode. However,
currently PurgeHeader_r does this, and then IH_DECs the special
inodes. On namei, calling IH_DEC on a special inode causes the inode
to be opened, so we create a cached file handle right after we closed
all cached file handles for that inode with IH_REALLYCLOSE.

Making namei IH_DEC not open an FdHandle_t for the given file is
non-trivial, at least when dec'ing the linktable. So instead, just
make namei IH_DEC itself issue the IH_REALLYCLOSE right before the
actual unlink() call.

With this, we can keep the cached file handle open for special inodes
until right before they are actually deleted, so we don't issue extra
unnecessary open()s and close()s.

Change-Id: I35b234ab429bc7cd0f29654cc8f854c82c961071
Reviewed-on: http://gerrit.openafs.org/10196
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/vol/namei_ops.c
src/vol/purge.c