]> git.michaelhowe.org Git - packages/o/openafs.git/commit
ihandle: Avoid FD cache in ih_sync_all
authorAndrew Deason <adeason@sinenomine.net>
Wed, 19 Dec 2012 22:57:20 +0000 (16:57 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 22 Dec 2012 20:18:58 +0000 (12:18 -0800)
commitaeb42c44bc005b8935650351470020f2e715bcb8
tree02639121d4b7bec021a488bfb245e6c8c68d654d
parent140fb74331a6fda552d25bbf56dda5f9c785839a
ihandle: Avoid FD cache in ih_sync_all

If an ihandle is IH_REALLYCLOSE'd immediately before or during the
IH_OPEN call in ih_sync_all, ih_sync_all can open a new file handle
after the IH_REALLYCLOSE is complete. For a volume that has gone
offline, this means that ih_sync_all can hold a file open for a volume
that has gone offline, and is possibly being manipulated or deleted by
an external program (e.g. the volserver for a clone operation).

While the FdHandle_t is open, or after the handle has been closed and
returned to the FD cache, another caller in the fileserver could try
to open the same file and get back the cached FdHandle_t. If the file
has been deleted by the volserver, this means the fileserver is
writing to the 'wrong' file, as it has been deleted. This can result
in a CopyOnWrite operation causing a file from the clients' point of
view to suddenly become empty, or to revert to a previous version.

To avoid this, prevent ih_sync_all from interacting with the FD cache
entirely, and just open a file descriptor directly from the IHandle_t.
This should prevent it from causing any problems with other users of
the FD cache.

This change is not intended for the master branch. The current
intention for the master branch and future versions is to eliminate
ih_sync_all entirely.

FIXES 131530

Change-Id: I809a0e3ebfe4692eab01671fdf83bf58676453f6
Reviewed-on: http://gerrit.openafs.org/8796
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/ihandle.c