Skip to content
Commit ab0fc21b authored by ChenXiaoSong's avatar ChenXiaoSong Committed by Trond Myklebust
Browse files

Revert "NFSv4: Handle the special Linux file open access mode"

This reverts commit 44942b4e

.

After secondly opening a file with O_ACCMODE|O_DIRECT flags,
nfs4_valid_open_stateid() will dereference NULL nfs4_state when lseek().

Reproducer:
  1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/
  2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT)
  3. close(fd)
  4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT)
  5. lseek(fd)

Reported-by: default avatarLyu Tao <tao.lyu@epfl.ch>
Signed-off-by: default avatarChenXiaoSong <chenxiaosong2@huawei.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 7c9d845f
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