deepakarumugam.s@nutanix.com has uploaded this change for review.

View Change

Donot provide delegations when another client has a write
open file handle

Bug description: Today we provide read delegations
to clients even when another client has a write open file handle.
This causes read delegated clients to hold stale data(but
think that the data is valid) when the write client
tries to write to the file.

Experiments show that when the write client writes to the file
we respond to the write client saying write is done and then do
a delegation recall much later this is problematic.

How this bug was found: This bug was found by running pynfs
delegation tests against ganesha server and comparing it
against linux kernel nfs server.

Fix: This patch fixes that issue by introducing another
counter to keep track of the number of write opens. We don't provide
delegations if another client has opened this file in write mode

Change-Id: Icc203c9c144097efaed2b4fa928abe6d4ad6099e
Signed-off-by: Deepak Arumugam Sankara Subramanian <deepakarumugam.s@nutanix.com>
---
M src/Protocols/NFS/nfs4_op_close.c
M src/Protocols/NFS/nfs4_op_open.c
M src/SAL/state_deleg.c
M src/include/sal_data.h
4 files changed, 63 insertions(+), 2 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/63/552963/1

To view, visit change 552963. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Icc203c9c144097efaed2b4fa928abe6d4ad6099e
Gerrit-Change-Number: 552963
Gerrit-PatchSet: 1
Gerrit-Owner: deepakarumugam.s@nutanix.com
Gerrit-MessageType: newchange