]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] nfsd: Allow read access over NFS to files with APPEND bit set.
authorNeil Brown <neilb@cse.unsw.edu.au>
Mon, 7 Feb 2005 23:48:20 +0000 (15:48 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 7 Feb 2005 23:48:20 +0000 (15:48 -0800)
Write access cannot safely be allowed as NFS doesn't support append, but read
access should be ok.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfsd/vfs.c

index f7ad9f759f83d468637d87dc6a1719d3680948ad..a5a58a1dba0ad1c32f2737a3804954aa74c4ad23 100644 (file)
@@ -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;