OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-3707-gaa0046a
Gerrit Code Review
Tue, 9 Apr 2013 10:39:38 -0700 (PDT)
The following commit has been merged in the master branch:
Author: Jeffrey Altman <email@example.com>
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 <firstname.lastname@example.org>
Reviewed-by: Rod Widdowson <email@example.com>
Reviewed-by: Peter Scott <firstname.lastname@example.org>
Reviewed-by: Jeffrey Altman <email@example.com>
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
OpenAFS Master Repository