Commit 1a70252c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd: Allow read access over NFS to files with APPEND bit set.

Write access cannot safely be allowed as NFS doesn't support append, but read
access should be ok.
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ddfefa1a
......@@ -656,12 +656,15 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
dentry = fhp->fh_dentry;
inode = dentry->d_inode;
/* Disallow access to files with the append-only bit set or
* with mandatory locking enabled
/* Disallow write access to files with the append-only bit set
* or any access when mandatory locking enabled
*/
err = nfserr_perm;
if (IS_APPEND(inode) || IS_ISMNDLK(inode))
if (IS_APPEND(inode) && (access & MAY_WRITE))
goto out;
if (IS_ISMNDLK(inode))
goto out;
if (!inode->i_fop)
goto out;
......
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