mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
nfsv4.1/4.2 client: fix handling of delegations for "oneopenown" mnt option
If a delegation for a file has been acquired, the "oneopenown" option was ignored when the local open was issued. This could result in multiple openowners/opens for a file, that would be transferred to the server when the delegation was recalled. This would not be serious, but could result in more than one openowner. Since the Amazon/EFS does not issue delegations, this probably never occurs in practice. Spotted during code inspection. This small patch fixes the code so that it checks for "oneopenown" when doing client local opens on a delegation. MFC after: 2 weeks
This commit is contained in:
parent
4d5460a720
commit
e61b29ab5d
1 changed files with 6 additions and 8 deletions
|
|
@ -267,17 +267,15 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg,
|
|||
}
|
||||
}
|
||||
|
||||
if (dp != NULL) {
|
||||
/* For NFSv4.1/4.2 and this option, use a single open_owner. */
|
||||
if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount)))
|
||||
nfscl_filllockowner(NULL, own, F_POSIX);
|
||||
else
|
||||
nfscl_filllockowner(p->td_proc, own, F_POSIX);
|
||||
if (dp != NULL)
|
||||
ohp = &dp->nfsdl_owner;
|
||||
} else {
|
||||
/* For NFSv4.1 and this option, use a single open_owner. */
|
||||
if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount)))
|
||||
nfscl_filllockowner(NULL, own, F_POSIX);
|
||||
else
|
||||
nfscl_filllockowner(p->td_proc, own, F_POSIX);
|
||||
else
|
||||
ohp = &clp->nfsc_owner;
|
||||
}
|
||||
/* Now, search for an openowner */
|
||||
LIST_FOREACH(owp, ohp, nfsow_list) {
|
||||
if (!NFSBCMP(owp->nfsow_owner, own, NFSV4CL_LOCKNAMELEN))
|
||||
|
|
|
|||
Loading…
Reference in a new issue