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>
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;