Keep read and write fds with each nlm_file

[ Upstream commit 7f024fcd5c97dc70bb9121c80407cf3cf9be7159 ]

We shouldn't really be using a read-only file descriptor to take a write
lock.

Most filesystems will put up with it.  But NFS, for example, won't.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
J. Bruce Fields
2021-08-23 16:44:00 -04:00
committed by Greg Kroah-Hartman
parent b4bf52174b
commit e580323ac0
7 changed files with 111 additions and 44 deletions

View File

@@ -27,7 +27,8 @@ struct rpc_task;
struct nlmsvc_binding {
__be32 (*fopen)(struct svc_rqst *,
struct nfs_fh *,
struct file **);
struct file **,
int mode);
void (*fclose)(struct file *);
};