···149 pCifsFile->pid = current->tgid;150 pCifsFile->pInode = newinode;151 pCifsFile->invalidHandle = false;152+ pCifsFile->closePend = false;153 mutex_init(&pCifsFile->fh_mutex);154 mutex_init(&pCifsFile->lock_mutex);155 INIT_LIST_HEAD(&pCifsFile->llist);···162 pCifsInode = CIFS_I(newinode);163 if (pCifsInode) {164 /* if readable file instance put first in list*/165+ if (write_only)166 list_add_tail(&pCifsFile->flist,167 &pCifsInode->openFileList);168+ else169+ list_add(&pCifsFile->flist, &pCifsInode->openFileList);170+0171 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {172 pCifsInode->clientCanCacheAll = true;173 pCifsInode->clientCanCacheRead = true;174+ cFYI(1, ("Exclusive Oplock inode %p", newinode));0175 } else if ((oplock & 0xF) == OPLOCK_READ)176+ pCifsInode->clientCanCacheRead = true;177 }178 write_unlock(&GlobalSMBSeslock);179}···668 parent_dir_inode->i_sb, mode,669 nd->intent.open.flags, &oplock,670 &fileHandle, xid);671+ /*672+ * This code works around a bug in673+ * samba posix open in samba versions 3.3.1674+ * and earlier where create works675+ * but open fails with invalid parameter.676+ * If either of these error codes are677+ * returned, follow the normal lookup.678+ * Otherwise, the error during posix open679+ * is handled.680+ */681 if ((rc != -EINVAL) && (rc != -EOPNOTSUPP))682 posix_open = true;683 }
+1-3
fs/cifs/file.c
···307 rc = 0;308 FreeXid(xid);309 return rc;310- } else {311- if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))312 cERROR(1, ("could not find file instance for "313 "new file %p", file));314- }315316 full_path = build_path_from_dentry(file->f_path.dentry);317 if (full_path == NULL) {
···307 rc = 0;308 FreeXid(xid);309 return rc;310+ } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))0311 cERROR(1, ("could not find file instance for "312 "new file %p", file));0313314 full_path = build_path_from_dentry(file->f_path.dentry);315 if (full_path == NULL) {