diff options
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 8e86aaceb68..4830acc86d7 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -135,10 +135,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, struct cifs_sb_info *cifs_sb; struct cifsTconInfo *pTcon; char *full_path = NULL; - FILE_ALL_INFO * buf = NULL; + FILE_ALL_INFO *buf = NULL; struct inode *newinode = NULL; - struct cifsFileInfo * pCifsFile = NULL; - struct cifsInodeInfo * pCifsInode; + struct cifsFileInfo *pCifsFile = NULL; + struct cifsInodeInfo *pCifsInode; int disposition = FILE_OVERWRITE_IF; int write_only = FALSE; @@ -207,8 +207,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, } else { /* If Open reported that we actually created a file then we now have to set the mode if possible */ - if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) && - (oplock & CIFS_CREATE_ACTION)) { + if ((pTcon->unix_ext) && (oplock & CIFS_CREATE_ACTION)) { mode &= ~current->fs->umask; if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode, @@ -235,8 +234,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, /* Could set r/o dos attribute if mode & 0222 == 0 */ } - /* BB server might mask mode so we have to query for Unix case*/ - if (pTcon->ses->capabilities & CAP_UNIX) + /* server might mask mode so we have to query for it */ + if (pTcon->unix_ext) rc = cifs_get_inode_info_unix(&newinode, full_path, inode->i_sb, xid); else { @@ -264,7 +263,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, direntry->d_op = &cifs_dentry_ops; d_instantiate(direntry, newinode); } - if ((nd->flags & LOOKUP_OPEN) == FALSE) { + if ((nd == NULL /* nfsd case - nfs srv does not set nd */) || + ((nd->flags & LOOKUP_OPEN) == FALSE)) { /* mknod case - do not leave file open */ CIFSSMBClose(xid, pTcon, fileHandle); } else if (newinode) { @@ -323,7 +323,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, struct cifs_sb_info *cifs_sb; struct cifsTconInfo *pTcon; char *full_path = NULL; - struct inode * newinode = NULL; + struct inode *newinode = NULL; if (!old_valid_dev(device_number)) return -EINVAL; @@ -336,7 +336,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, full_path = build_path_from_dentry(direntry); if (full_path == NULL) rc = -ENOMEM; - else if (pTcon->ses->capabilities & CAP_UNIX) { + else if (pTcon->unix_ext) { mode &= ~current->fs->umask; if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path, @@ -490,7 +490,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, cFYI(1, (" Full path: %s inode = 0x%p", full_path, direntry->d_inode)); - if (pTcon->ses->capabilities & CAP_UNIX) + if (pTcon->unix_ext) rc = cifs_get_inode_info_unix(&newInode, full_path, parent_dir_inode->i_sb, xid); else |