[PATCH] nfs: verify open flags before allowing open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix another path for:
9597c13b nfs: verify open flags before allowing an atomic open

which forbade the NFSv4 open for O_DIRECT|O_APPEND in nfs_atomic_open().
That code path is missed when a cached positive dentry exists;
nfs4_file_open() is used instead.  Duplicate the forbid in nfs4_file_open().

Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
Cc: Jeff Layton <jeff.layton@xxxxxxxxxxxxxxx>
---
 fs/nfs/nfs4file.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index c51fb4d..c2e4767 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -37,6 +37,10 @@ nfs4_file_open(struct inode *inode, struct file *filp)
 
 	dprintk("NFS: open file(%pd2)\n", dentry);
 
+	err = nfs_check_flags(openflags);
+	if (err)
+		return err;
+
 	if ((openflags & O_ACCMODE) == 3)
 		openflags--;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux