]> www.infradead.org Git - users/jedix/linux-maple.git/commit
NFS: Fix another OPEN_DOWNGRADE bug
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 25 Jun 2016 23:19:28 +0000 (19:19 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:21:58 +0000 (17:21 -0500)
commit6cdc1953f286bffedd837ba3d96dcef2175dd105
tree54357b62e0806334e8ea7ba53a5a83e84809825e
parent2075a86e682ead2863cc6488ff9cc548bb5b4d22
NFS: Fix another OPEN_DOWNGRADE bug

Orabug: 25308034

[ Upstream commit e547f2628327fec6afd2e03b46f113f614cca05b ]

Olga Kornievskaia reports that the following test fails to trigger
an OPEN_DOWNGRADE on the wire, and only triggers the final CLOSE.

fd0 = open(foo, RDRW)   -- should be open on the wire for "both"
fd1 = open(foo, RDONLY)  -- should be open on the wire for "read"
close(fd0) -- should trigger an open_downgrade
read(fd1)
close(fd1)

The issue is that we're missing a check for whether or not the current
state transitioned from an O_RDWR state as opposed to having transitioned
from a combination of O_RDONLY and O_WRONLY.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: cd9288ffaea4 ("NFSv4: Fix another bug in the close/open_downgrade code")
Cc: stable@vger.kernel.org # 2.6.33+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 4a883b820416683360258a08becad92d99f7fab1)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
fs/nfs/nfs4proc.c