]> git.michaelhowe.org Git - packages/o/openafs.git/commit
DEVEL15-windows-vnovnode-while-file-in-use-20070918
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 18 Sep 2007 17:59:23 +0000 (17:59 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 18 Sep 2007 17:59:23 +0000 (17:59 +0000)
commitc37415713f75349a0c3aa9faf1937af3a3c7d9b3
treec60f598a7b5c66b573f0636398de63cdbc0511e7
parentbbb7ec760f66306e88cfb7a7a2433c46fae595f6
DEVEL15-windows-vnovnode-while-file-in-use-20070918

Discovered another case where VNOVNODE errors were not being handled.
If there are dirty buffers and a VNOVNODE error is received while
writing the buffer, the buffer would be left in the dirty buffers queue.
This caused a couple problems:
(1) any attempt to flush the file, volume, or cache would fail because
    there were unflushed dirty buffers that could not be flushed.
(2) shutdown of the service would hang because the buffers could not
    be flushed.

In addition, while a VNOVNODE error would result in the cm_scache_t
being marked CM_SCACHEFLAG_DELETED, this state was not being checked
at the SMB layer.  As a result, if a smb_fid_t was allocated and it
referenced the deleted cm_scache_t, the SMB operations would continue
to be processed and report success even if the actual file or directory
no longer existed.

We now clear the dirty state on buffers which cannot be written due to
VNOVNODE errors.  We also check the cm_scache_t for deletion prior to
use whenever a smb_fid_t is looked up.  If the cm_scache_t is deleted,
the smb_fid_t is closed and the error CM_ERROR_NOSUCHFILE is returned
for files or CM_ERROR_NOSUCHPATH for directories.

(cherry picked from commit b8abf04a45a82cc880d2ad59d3bbf2217fa08c11)
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c