]> git.michaelhowe.org Git - packages/o/openafs.git/commit
windows-vnovnode-while-file-in-use-20070918
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 18 Sep 2007 17:57:31 +0000 (17:57 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 18 Sep 2007 17:57:31 +0000 (17:57 +0000)
commitb8abf04a45a82cc880d2ad59d3bbf2217fa08c11
tree9d6d932cdc1a860e1b64f9507e58bcefd91951e4
parenta47f4bacd8b091a7917ffefe405a6f0f036499d9
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.
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c