Matthew DeVore has uploaded this change for review.

View Change

nfs4_op_open: fix refcnt for reopen non-upgrade

Grab an extra ref even when not re-opening the file.

open4_create_fh implicitly reduces the reference count of the
fsal_obj_handle for which it is creating a fh. So in nfs4_op_open.c on
line 997 and 1017 an extra ref is grabbed to accomodate that. However,
if the file is not being reopened (reopens only happen for upgraded open
flags) the extra ref was not being grabbed.

The macOS NFS client uses some strange pattern where an already-open
file may be reopened with the same flags. See
https://github.com/nfs-ganesha/nfs-ganesha/issues/649 (fixed by this
commit) for details.

Change-Id: I142bdd1bf7589a3e2fe671b23fc95df3768327f5
Signed-off-by: Matthew DeVore <matvore@google.com>
---
M src/Protocols/NFS/nfs4_op_open.c
1 file changed, 3 insertions(+), 3 deletions(-)

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

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

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I142bdd1bf7589a3e2fe671b23fc95df3768327f5
Gerrit-Change-Number: 505966
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew DeVore <matvore@comcast.net>
Gerrit-MessageType: newchange