1
0
Fork 0
remarkable-linux/fs/nfs
Trond Myklebust 4a883b8204 NFS: Fix another OPEN_DOWNGRADE bug
[ Upstream commit e547f26283 ]

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: cd9288ffae ("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>
2016-07-10 22:27:13 -04:00
..
blocklayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
filelayout nfs/filelayout: Fix NULL reference caused by double freeing of fh_array 2015-10-22 14:43:26 -07:00
flexfilelayout pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn 2016-02-15 15:45:19 -05:00
objlayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
Kconfig kernel: conditionally support non-root users, groups and capabilities 2015-04-15 16:35:22 -07:00
Makefile NFS: Rename idmap.c to nfs4idmap.c 2015-04-23 15:16:14 -04:00
cache_lib.c NFS: simplify and clean cache library 2013-02-15 10:43:36 -05:00
cache_lib.h NFS: simplify and clean cache library 2013-02-15 10:43:36 -05:00
callback.c nfs: fix high load average due to callback thread sleeping 2015-04-23 14:38:07 -04:00
callback.h NFS: Add in v4.2 callback operation 2013-06-08 16:20:18 -04:00
callback_proc.c NFSv4.1: Don't set up a backchannel if the server didn't agree to do so 2015-02-18 12:30:47 -08:00
callback_xdr.c NFSv4.1: Convert open-coded array allocation calls to kmalloc_array() 2015-02-11 19:02:52 -05:00
client.c NFS: Remove the "NFS_CAP_CHANGE_ATTR" capability 2016-02-01 14:53:19 -05:00
delegation.c Merge branch 'bugfixes' 2015-04-23 15:16:27 -04:00
delegation.h NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return 2014-11-12 17:19:04 -05:00
dir.c make nfs_atomic_open() call d_drop() on all ->open_context() errors. 2016-07-10 22:27:12 -04:00
direct.c NFS client updates for Linux 4.1 2015-04-26 17:33:59 -07:00
dns_resolve.c NFS: Enabling v4.2 should not recompile nfsd and lockd 2013-11-19 16:20:40 -05:00
dns_resolve.h NFS: DNS resolver cache per network namespace context introduced 2012-01-31 18:20:26 -05:00
file.c NFS client updates for Linux 4.1 2015-04-26 17:33:59 -07:00
fscache-index.c NFS: Fabricate fscache server index key correctly 2014-09-25 21:25:18 -04:00
fscache.c nfs: define nfs_inc_fscache_stats and using it as possible 2014-11-24 20:08:47 -05:00
fscache.h NFS: Use i_writecount to control whether to get an fscache cookie in nfs_open() 2013-09-27 18:40:25 +01:00
getroot.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
inode.c NFS: Fix attribute cache revalidation 2016-02-01 14:53:22 -05:00
internal.h NFS: Add attribute update barriers to NFS writebacks 2015-03-01 23:23:06 -05:00
iostat.h nfs: define nfs_inc_fscache_stats and using it as possible 2014-11-24 20:08:47 -05:00
mount_clnt.c nfs: have nfs_mount fake up a auth_flavs list when the server didn't provide it 2013-06-28 15:51:51 -04:00
namespace.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
netns.h pnfs/blocklayout: serialize GETDEVICEINFO calls 2014-11-12 14:22:52 -05:00
nfs.h NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
nfs2super.c NFS: Convert v2 into a module 2012-07-30 19:06:41 -04:00
nfs2xdr.c nfs: save server READ/WRITE/COMMIT status 2015-02-03 11:06:40 -08:00
nfs3_fs.h nfsv3: introduce nfs3_set_ds_client 2015-02-03 11:06:34 -08:00
nfs3acl.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs3client.c nfs: set hostname when creating nfsv3 ds connection 2015-02-03 11:06:38 -08:00
nfs3proc.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs3super.c nfsv3: introduce nfs3_set_ds_client 2015-02-03 11:06:34 -08:00
nfs3xdr.c NFS: Fix size of NFSACL SETACL operations 2015-08-03 09:29:17 -07:00
nfs4_fs.h Merge branch 'flexfiles' 2015-02-03 16:01:27 -05:00
nfs4client.c nfs4: start callback_ident at idr 1 2015-12-14 21:24:37 -08:00
nfs4file.c NFS client updates for Linux 4.1 2015-04-26 17:33:59 -07:00
nfs4getroot.c NFSv4: Fix security auto-negotiation 2013-09-07 16:18:30 -04:00
nfs4idmap.c NFS: Rename idmap.c to nfs4idmap.c 2015-04-23 15:16:14 -04:00
nfs4idmap.h NFS: Move nfs_idmap.h into fs/nfs/ 2015-04-23 15:16:14 -04:00
nfs4namespace.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs4proc.c NFS: Fix another OPEN_DOWNGRADE bug 2016-07-10 22:27:13 -04:00
nfs4renewd.c NFSv4.1: Fix an NFSv4.1 state renewal regression 2014-09-30 17:18:42 -04:00
nfs4session.c NFSv4.1: Don't set up a backchannel if the server didn't agree to do so 2015-02-18 12:30:47 -08:00
nfs4session.h NFSv4.1: Clear the old state by our client id before establishing a new lease 2015-03-03 21:52:30 -05:00
nfs4state.c fixing infinite OPEN loop in 4.0 stateid recovery 2015-08-03 09:29:17 -07:00
nfs4super.c NFS: Move nfs_idmap.h into fs/nfs/ 2015-04-23 15:16:14 -04:00
nfs4sysctl.c NFS: Move nfs_idmap.h into fs/nfs/ 2015-04-23 15:16:14 -04:00
nfs4trace.c NFSv4.1: Add tracepoints for debugging slot table operations 2013-08-22 08:58:27 -04:00
nfs4trace.h VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs4xdr.c NFS: Move nfs_idmap.h into fs/nfs/ 2015-04-23 15:16:14 -04:00
nfs42.h nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfs42proc.c NFS: Reduce time spent holding the i_mutex during fallocate() 2015-04-23 14:36:28 -04:00
nfs42xdr.c NFS: Don't zap caches on fallocate() 2015-04-23 14:36:28 -04:00
nfsroot.c NFS: a couple off by ones 2015-01-30 20:43:30 -05:00
nfstrace.c NFSv4: Allow tracing of NFSv4 fsync calls 2015-03-27 12:39:34 -04:00
nfstrace.h NFS: fix the handling of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping 2014-01-27 15:35:56 -05:00
pagelist.c nfs: fix pg_test page count calculation 2015-10-22 14:43:18 -07:00
pnfs.c NFS: Ensure we set NFS_CONTEXT_RESEND_WRITES when requeuing writes 2015-08-03 09:29:17 -07:00
pnfs.h NFS client updates for Linux 4.1 2015-04-26 17:33:59 -07:00
pnfs_dev.c NFSv4.1: Don't cache deviceids that have no notifications 2015-03-27 12:32:24 -04:00
pnfs_nfs.c pnfs_nfs: fix _cancel_empty_pagelist 2016-07-10 20:20:05 -04:00
proc.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
read.c NFS: Do cleanup before resetting pageio read/write to mds 2015-10-22 14:43:18 -07:00
super.c NFS client updates for Linux 4.1 2015-04-26 17:33:59 -07:00
symlink.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
sysctl.c nfs: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
unlink.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
write.c nfs: avoid race that crashes nfs_init_commit 2016-07-10 20:20:05 -04:00