Suhas Athani has uploaded this change for review.
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 change 1240541. To unsubscribe, or for help writing mail filters, visit settings.