]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfs/dir.c
nfs: add support for the umask attribute
[karo-tx-linux.git] / fs / nfs / dir.c
index 7483722162fa0591e8ad2de2ac88687aed2d431e..cb22a9f9ae7e3694db1532a683ae34d4d313e787 100644 (file)
@@ -1529,8 +1529,13 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
                return -ENAMETOOLONG;
 
        if (open_flags & O_CREAT) {
+               struct nfs_server *server = NFS_SERVER(dir);
+
+               if (!(server->attr_bitmask[2] & FATTR4_WORD2_MODE_UMASK))
+                       mode &= ~current_umask();
+
                attr.ia_valid |= ATTR_MODE;
-               attr.ia_mode = mode & ~current_umask();
+               attr.ia_mode = mode;
        }
        if (open_flags & O_TRUNC) {
                attr.ia_valid |= ATTR_SIZE;