Suhas Athani has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1240541?usp=email ) Change subject: nfs4: recall read delegations on UNCHECKED4 truncate OPEN (#945) ...................................................................... nfs4: recall read delegations on UNCHECKED4 truncate OPEN (#945) This is regarding github issue - https://github.com/nfs-ganesha/nfs-ganesha/issues/945 - Treat `FSAL_O_TRUNC` (UNCHECKED4 OPEN with size 0 on an existing file) as a delegation conflict in `open4_ex`, per RFC 8881 Section 18.16.4. - Pass a combined `open_conflicts_with_deleg` flag to `state_deleg_conflict_impl()` instead of only checking `OPEN4_SHARE_ACCESS_WRITE`. Problem: For `OPEN_DELEGATE_READ`, RFC 8881 requires recall when another client issues an OPEN that truncates an existing file via `OPEN4_CREATE` + `UNCHECKED4` with size 0, even if `share_access` is read-only. Ganesha only checked write access, so opens such as `O_RDONLY | O_CREAT | O_TRUNC` could proceed without recalling an outstanding read delegation. Solution: In `open4_ex`, set `open_conflicts_with_deleg` when either write access is requested or `FSAL_O_TRUNC` is set, and use it at both delegation conflict check sites (initial OPEN and `fsal_reopen2`). Change-Id: I3ae114c42cdedb46a0c967bd1cb25896732a8480 Signed-off-by: Suhas Athani <Suhas.Athani@ibm.com> --- M src/Protocols/NFS/nfs4_op_open.c 1 file changed, 15 insertions(+), 6 deletions(-) git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/41/1240541/1 -- To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1240541?usp=email To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: ffilz/nfs-ganesha Gerrit-Branch: next Gerrit-Change-Id: I3ae114c42cdedb46a0c967bd1cb25896732a8480 Gerrit-Change-Number: 1240541 Gerrit-PatchSet: 1 Gerrit-Owner: Suhas Athani <Suhas.Athani@ibm.com>