Commit 3477565e authored by J. Bruce Fields's avatar J. Bruce Fields

Revert "nfsd: nfs4_file_get_access: need to be more careful with O_RDWR"

This reverts commit df66e753.

nfsd4_lock can get a read-only or write-only reference when only a
read-write open is available.  This is normal.

Cc: Harshula Jayasuriya <harshula@redhat.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent b8297cec
...@@ -282,14 +282,19 @@ static unsigned int file_hashval(struct inode *ino) ...@@ -282,14 +282,19 @@ static unsigned int file_hashval(struct inode *ino)
static struct hlist_head file_hashtbl[FILE_HASH_SIZE]; static struct hlist_head file_hashtbl[FILE_HASH_SIZE];
static void __nfs4_file_get_access(struct nfs4_file *fp, int oflag)
{
WARN_ON_ONCE(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]));
atomic_inc(&fp->fi_access[oflag]);
}
static void nfs4_file_get_access(struct nfs4_file *fp, int oflag) static void nfs4_file_get_access(struct nfs4_file *fp, int oflag)
{ {
WARN_ON_ONCE(!fp->fi_fds[oflag]);
if (oflag == O_RDWR) { if (oflag == O_RDWR) {
atomic_inc(&fp->fi_access[O_RDONLY]); __nfs4_file_get_access(fp, O_RDONLY);
atomic_inc(&fp->fi_access[O_WRONLY]); __nfs4_file_get_access(fp, O_WRONLY);
} else } else
atomic_inc(&fp->fi_access[oflag]); __nfs4_file_get_access(fp, oflag);
} }
static void nfs4_file_put_fd(struct nfs4_file *fp, int oflag) static void nfs4_file_put_fd(struct nfs4_file *fp, int oflag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment