OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_23-32-g55d82bf
Gerrit Code Review
Tue, 9 Apr 2013 20:19:39 -0700 (PDT)
The following commit has been merged in the openafs-devel-1_7_x branch:
Author: Jeffrey Altman <firstname.lastname@example.org>
Date: Tue Apr 9 08:12:29 2013 -0400
Windows: Race between NonCached and Cached Writes
The following race was identified by Rod Widdowson.
A. File is complete up to 1000 Eof=1000, VDL=1000
B. File Eof is set to 2000. Eof=2000, VDL=1000 (SetInfo doesn't move VDL)
C. Locks dropped.
Thread1) Write comes in for 1000 for 500. This is not extending.
Locks taken shared.
Thread1) Data Written to Server. Thread stalls.
Thread2) Read comes in for 1000 for 1000. Locks taken shared
so it proceeds.
Thread2) CcRead calls CcZero and so the cache get zeros from 1000 to 2000
Thread1) VDL moves forward.
The windows cache is now poisoned between 1000 and 1500 and protected by
the VDL. Any future reads gets the wrong data and any write to that part
will cause an overwrite of zeros.
Instead of holding the Fcb->NPFcb->Resource and
Fcb->NPFcb->SectionObjectResource shared during a NonCached write, hold it
exclusive because the write is occurring behind the back of the windows
Tested-by: BuildBot <email@example.com>
Reviewed-by: Rod Widdowson <firstname.lastname@example.org>
Reviewed-by: Peter Scott <email@example.com>
Reviewed-by: Jeffrey Altman <firstname.lastname@example.org>
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
OpenAFS Master Repository