bk://cifs.bkbits.net/linux-2.5cifs stevef@stevef95.austin.ibm.com|ChangeSet|20040628214917|56249 stevef # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/06/28 16:49:17-05:00 stevef@stevef95.austin.ibm.com # hash cifs inodes # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/inode.c # 2004/06/28 16:49:08-05:00 stevef@stevef95.austin.ibm.com +6 -5 # hash cifs inodes # # fs/cifs/file.c # 2004/06/28 16:49:08-05:00 stevef@stevef95.austin.ibm.com +2 -0 # hash cifs inodes # # ChangeSet # 2004/06/27 16:50:25-05:00 stevef@smfhome1.smfdom # Merge bk://cifs.bkbits.net/linux-2.5cifs # into smfhome1.smfdom:/suse/home/stevef/bk_cifs_org/linux-2.5cifs # # fs/cifs/inode.c # 2004/06/27 16:50:21-05:00 stevef@smfhome1.smfdom +0 -0 # Auto merged # # ChangeSet # 2004/06/27 16:49:10-05:00 stevef@smfhome1.smfdom # Fix cifs xid transaction counts to be more consistent. Start using __set_page_dirty_no_buffers. # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/link.c # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +2 -2 # fix cifs xid transaction counts to be more consistent # # fs/cifs/inode.c # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +18 -25 # fix cifs xid transaction counts to be more consistent # # fs/cifs/file.c # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +5 -6 # Fix cifs xid transaction counts to be more consistent. Start using __set_page_dirty_no_buffers. # # fs/cifs/dir.c # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +5 -5 # fix cifs xid transaction counts to be more consistent # # fs/cifs/cifsproto.h # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +2 -2 # fix cifs xid transaction counts to be more consistent # # fs/cifs/cifsfs.h # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +1 -1 # Update cifs change log for version 1.20 # # fs/cifs/CHANGES # 2004/06/27 16:49:01-05:00 stevef@smfhome1.smfdom +5 -0 # Update cifs change log for version 1.20 # # ChangeSet # 2004/06/25 14:19:24-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/25 14:19:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/25 10:53:41-05:00 stevef@smfhome1.smfdom # Do not loop in cifsd demultiplex thread when someone sigkills it. # On unmount of second user on same tcp session, make sure that we # do not kill cifsd prematurely. # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/transport.c # 2004/06/25 10:53:34-05:00 stevef@smfhome1.smfdom +6 -0 # clean up exit path when unmounting with lots of requests blocked to get in to send. # # fs/cifs/file.c # 2004/06/25 10:53:34-05:00 stevef@smfhome1.smfdom +0 -1 # remove redundant line (variable is set earlier in the function) # # fs/cifs/connect.c # 2004/06/25 10:53:34-05:00 stevef@smfhome1.smfdom +29 -31 # Do not loop in cifsd demultiplex thread when someone sigkills it. # On unmount of second user on same tcp session, make sure that we # do not kill cifsd prematurely. # # fs/cifs/cifssmb.c # 2004/06/25 10:53:34-05:00 stevef@smfhome1.smfdom +0 -2 # cleanup comment # # fs/cifs/CHANGES # 2004/06/25 10:53:34-05:00 stevef@smfhome1.smfdom +2 -1 # update cifs change log # # ChangeSet # 2004/06/20 13:06:08-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/20 13:06:05-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/19 15:18:03-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/19 15:17:59-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/18 11:48:49-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/18 11:48:46-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/15 21:37:10-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/15 21:37:07-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/13 11:11:30-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/13 11:11:26-07:00 akpm@bix.(none) +0 -0 # Auto merged # # fs/cifs/cifsfs.c # 2004/06/13 11:11:26-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/07 14:00:04-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/07 14:00:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/02 13:18:48-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/06/02 13:18:44-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/27 21:24:47-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/27 21:24:44-07:00 akpm@bix.(none) +0 -0 # Auto merged # # fs/cifs/cifsfs.c # 2004/05/27 21:24:43-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/27 12:36:56-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/27 12:36:53-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/25 21:18:56-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/25 21:18:53-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/24 18:04:01-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/24 18:03:57-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/22 23:28:34-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/22 23:28:31-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/18 14:31:25-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/05/18 14:31:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/11 16:37:09-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/11 16:37:06-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/04 13:51:19-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/04 13:51:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/02 21:56:11-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/02 21:56:09-07:00 akpm@bix.(none) +0 -0 # Auto merged # # fs/cifs/cifsfs.c # 2004/05/02 21:56:08-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/05/01 15:05:17-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/05/01 15:05:14-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/29 15:41:50-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifssmb.c # 2004/04/29 15:41:48-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/26 18:11:55-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/04/26 18:11:52-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/23 12:36:52-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/04/23 12:36:49-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/19 19:23:58-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/04/19 19:23:56-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/16 20:19:53-07:00 akpm@bix.(none) # Merge bk://cifs.bkbits.net/linux-2.5cifs # into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/04/16 20:19:51-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/16 20:18:59-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-cifs # # fs/cifs/cifsfs.c # 2004/04/16 20:18:56-07:00 akpm@bix.(none) +0 -0 # Auto merged # diff -Nru a/fs/cifs/CHANGES b/fs/cifs/CHANGES --- a/fs/cifs/CHANGES 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/CHANGES 2004-06-28 19:12:44 -07:00 @@ -1,3 +1,8 @@ +Version 1.20 +------------ +Make transaction counts more consistent. Merge /proc/fs/cifs/SimultaneousOps +info into /proc/fs/cifs/DebugData + Version 1.19 ------------ Fix /proc/fs/cifs/Stats and DebugData display to handle larger @@ -6,7 +11,8 @@ Do not kill cifsd (and thus hurt the other SMB session) when more than one session to the same server (but with different userids) exists and one of the two user's smb sessions is being removed while leaving the other. - +Do not loop reconnecting in cifsd demultiplex thread when admin +kills the thread without going through unmount. Version 1.18 ------------ diff -Nru a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h --- a/fs/cifs/cifsfs.h 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/cifsfs.h 2004-06-28 19:12:44 -07:00 @@ -93,5 +93,5 @@ size_t, int); extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); -#define CIFS_VERSION "1.19" +#define CIFS_VERSION "1.20" #endif /* _CIFSFS_H */ diff -Nru a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h --- a/fs/cifs/cifsproto.h 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/cifsproto.h 2004-06-28 19:12:44 -07:00 @@ -63,10 +63,10 @@ extern int cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, FILE_ALL_INFO * pfile_info, - struct super_block *sb); + struct super_block *sb, int xid); extern int cifs_get_inode_info_unix(struct inode **pinode, const unsigned char *search_path, - struct super_block *sb); + struct super_block *sb,int xid); extern int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, struct nls_table * nls_info); diff -Nru a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c --- a/fs/cifs/cifssmb.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/cifssmb.c 2004-06-28 19:12:44 -07:00 @@ -315,8 +315,6 @@ return 0; } -/* BB remove (from server) list of shares - but with smp safety BB */ -/* BB is ses active - do we need to check here - but how? BB */ if((tcon->ses == 0) || (tcon->ses->server == 0)) { up(&tcon->tconSem); return -EIO; diff -Nru a/fs/cifs/connect.c b/fs/cifs/connect.c --- a/fs/cifs/connect.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/connect.c 2004-06-28 19:12:45 -07:00 @@ -253,13 +253,12 @@ /* some servers kill tcp session rather than returning smb negprot error in which case reconnecting here is not going to help - return error to mount */ - spin_lock(&GlobalMid_Lock); - server->tcpStatus = CifsExiting; - spin_unlock(&GlobalMid_Lock); - wake_up(&server->response_q); break; } - + if(length == -EINTR) { + cFYI(1,("cifsd thread killed")); + break; + } cFYI(1,("Reconnecting after unexpected peek error %d",length)); cifs_reconnect(server); csocket = server->ssocket; @@ -292,11 +291,6 @@ /* if nack on negprot (rather than ret of smb negprot error) reconnecting not going to help, ret error to mount */ - spin_lock(&GlobalMid_Lock); - server->tcpStatus = CifsExiting; - spin_unlock(&GlobalMid_Lock); - /* wake up thread doing negprot */ - wake_up(&server->response_q); break; } else { /* give server a second to @@ -407,15 +401,19 @@ } spin_lock(&GlobalMid_Lock); server->tcpStatus = CifsExiting; - spin_unlock(&GlobalMid_Lock); + server->tsk = NULL; atomic_set(&server->inFlight, 0); + spin_unlock(&GlobalMid_Lock); /* Although there should not be any requests blocked on this queue it can not hurt to be paranoid and try to wake up requests that may haven been blocked when more than 50 at time were on the wire to the same server - they now will see the session is in exit state and get out of SendReceive. */ - wake_up_all(&server->request_q); - server->tsk = NULL; + wake_up_all(&server->request_q); + /* give those requests time to exit */ + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/8); + if(server->ssocket) { sock_release(csocket); server->ssocket = NULL; @@ -1358,31 +1356,37 @@ } } } - if (pSesInfo->capabilities & CAP_LARGE_FILES) { - cFYI(0, ("Large files supported ")); - sb->s_maxbytes = (u64) 1 << 63; - } else - sb->s_maxbytes = (u64) 1 << 31; /* 2 GB */ + if(pSesInfo) { + if (pSesInfo->capabilities & CAP_LARGE_FILES) { + sb->s_maxbytes = (u64) 1 << 63; + } else + sb->s_maxbytes = (u64) 1 << 31; /* 2 GB */ + } /* on error free sesinfo and tcon struct if needed */ if (rc) { + /* if session setup failed, use count is zero but + we still need to free cifsd thread */ if(atomic_read(&srvTcp->socketUseCount) == 0) { spin_lock(&GlobalMid_Lock); srvTcp->tcpStatus = CifsExiting; spin_unlock(&GlobalMid_Lock); + if(srvTcp->tsk) + send_sig(SIGKILL,srvTcp->tsk,1); } /* If find_unc succeeded then rc == 0 so we can not end */ - if (tcon) /* up here accidently freeing someone elses tcon struct */ + if (tcon) /* up accidently freeing someone elses tcon struct */ tconInfoFree(tcon); if (existingCifsSes == 0) { if (pSesInfo) { - if (pSesInfo->server) { - if (pSesInfo->Suid) - CIFSSMBLogoff(xid, pSesInfo); - if(pSesInfo->server->tsk) + if ((pSesInfo->server) && + (pSesInfo->status == CifsGood)) { + int temp_rc; + temp_rc = CIFSSMBLogoff(xid, pSesInfo); + /* if the socketUseCount is now zero */ + if((temp_rc == -ESHUTDOWN) && + (pSesInfo->server->tsk)) send_sig(SIGKILL,pSesInfo->server->tsk,1); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ / 4); /* give captive thread time to exit */ } else cFYI(1, ("No session or bad tcon")); sesInfoFree(pSesInfo); @@ -2791,12 +2795,6 @@ FreeXid(xid); return 0; } else if (rc == -ESHUTDOWN) { - /* should we add wake_up_all(&server->request_q); - and add a check in the check inFlight loop - for the session ending */ - set_current_state(TASK_INTERRUPTIBLE); - /* give captive thread time to exit */ - schedule_timeout(HZ / 4); cFYI(1,("Waking up socket by sending it signal")); send_sig(SIGKILL,cifsd_task,1); rc = 0; diff -Nru a/fs/cifs/dir.c b/fs/cifs/dir.c --- a/fs/cifs/dir.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/dir.c 2004-06-28 19:12:44 -07:00 @@ -233,10 +233,10 @@ /* BB server might mask mode so we have to query for Unix case*/ if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&newinode, full_path, - inode->i_sb); + inode->i_sb,xid); else { rc = cifs_get_inode_info(&newinode, full_path, - buf, inode->i_sb); + buf, inode->i_sb,xid); if(newinode) newinode->i_mode = mode; } @@ -329,7 +329,7 @@ device_number, cifs_sb->local_nls); if(!rc) { rc = cifs_get_inode_info_unix(&newinode, full_path, - inode->i_sb); + inode->i_sb,xid); direntry->d_op = &cifs_dentry_ops; if(rc == 0) d_instantiate(direntry, newinode); @@ -389,10 +389,10 @@ if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&newInode, full_path, - parent_dir_inode->i_sb); + parent_dir_inode->i_sb,xid); else rc = cifs_get_inode_info(&newInode, full_path, NULL, - parent_dir_inode->i_sb); + parent_dir_inode->i_sb,xid); if ((rc == 0) && (newInode != NULL)) { direntry->d_op = &cifs_dentry_ops; diff -Nru a/fs/cifs/file.c b/fs/cifs/file.c --- a/fs/cifs/file.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/file.c 2004-06-28 19:12:44 -07:00 @@ -215,10 +215,10 @@ } if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&file->f_dentry->d_inode, - full_path, inode->i_sb); + full_path, inode->i_sb,xid); else rc = cifs_get_inode_info(&file->f_dentry->d_inode, - full_path, buf, inode->i_sb); + full_path, buf, inode->i_sb,xid); if((oplock & 0xF) == OPLOCK_EXCLUSIVE) { pCifsInode->clientCanCacheAll = TRUE; @@ -367,10 +367,10 @@ pCifsInode->clientCanCacheRead = FALSE; if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&inode, - full_path, inode->i_sb); + full_path, inode->i_sb,xid); else rc = cifs_get_inode_info(&inode, - full_path, NULL, inode->i_sb); + full_path, NULL, inode->i_sb,xid); } /* else we are writing out data to server already and could deadlock if we tried to flush data, and since we do not know if we have data that would @@ -627,7 +627,6 @@ while we blocked so return what we managed to write */ return total_written; } - open_file = (struct cifsFileInfo *) file->private_data; if(open_file->closePend) { FreeXid(xid); if(total_written) @@ -1535,6 +1534,7 @@ if(*ptmp_inode == NULL) return; d_instantiate(tmp_dentry, *ptmp_inode); + insert_inode_hash(*ptmp_inode); } } else { tmp_dentry = d_alloc(file->f_dentry, qstring); @@ -1546,12 +1546,11 @@ *ptmp_inode = new_inode(file->f_dentry->d_sb); tmp_dentry->d_op = &cifs_dentry_ops; - cFYI(0, (" instantiate dentry 0x%p with inode 0x%p ", - tmp_dentry, *ptmp_inode)); if(*ptmp_inode == NULL) return; d_instantiate(tmp_dentry, *ptmp_inode); d_rehash(tmp_dentry); + insert_inode_hash(*ptmp_inode); } tmp_dentry->d_time = jiffies; @@ -2137,6 +2136,7 @@ .writepage = cifs_writepage, .prepare_write = cifs_prepare_write, .commit_write = cifs_commit_write, + .set_page_dirty = __set_page_dirty_nobuffers, /* .sync_page = cifs_sync_page, */ /*.direct_IO = */ }; diff -Nru a/fs/cifs/inode.c b/fs/cifs/inode.c --- a/fs/cifs/inode.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/inode.c 2004-06-28 19:12:44 -07:00 @@ -35,9 +35,8 @@ int cifs_get_inode_info_unix(struct inode **pinode, const unsigned char *search_path, - struct super_block *sb) + struct super_block *sb,int xid) { - int xid; int rc = 0; FILE_UNIX_BASIC_INFO findData; struct cifsTconInfo *pTcon; @@ -45,8 +44,6 @@ struct cifs_sb_info *cifs_sb = CIFS_SB(sb); char *tmp_path; - xid = GetXid(); - pTcon = cifs_sb->tcon; cFYI(1, (" Getting info on %s ", search_path)); /* we could have done a find first instead but this returns more info */ @@ -62,7 +59,6 @@ strnlen(search_path, MAX_PATHCONF) + 1, GFP_KERNEL); if (tmp_path == NULL) { - FreeXid(xid); return -ENOMEM; } /* have to skip first of the double backslash of UNC name */ @@ -75,7 +71,6 @@ /* BB fix up inode etc. */ } else if (rc) { - FreeXid(xid); return rc; } @@ -85,9 +80,12 @@ /* get new inode */ if (*pinode == NULL) { *pinode = new_inode(sb); + if(*pinode == NULL) + return -ENOMEM; + insert_inode_hash(*pinode); } + inode = *pinode; - cifsInfo = CIFS_I(inode); cFYI(1, (" Old time %ld ", cifsInfo->time)); @@ -172,15 +170,13 @@ inode->i_rdev); } } - FreeXid(xid); return rc; } int cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, - FILE_ALL_INFO * pfindData, struct super_block *sb) + FILE_ALL_INFO * pfindData, struct super_block *sb, int xid) { - int xid; int rc = 0; struct cifsTconInfo *pTcon; struct inode *inode; @@ -188,15 +184,12 @@ char *tmp_path; char *buf = NULL; - xid = GetXid(); - pTcon = cifs_sb->tcon; cFYI(1,("Getting info on %s ", search_path)); if((pfindData == NULL) && (*pinode != NULL)) { if(CIFS_I(*pinode)->clientCanCacheRead) { cFYI(1,("No need to revalidate inode sizes on cached file ")); - FreeXid(xid); return rc; } } @@ -221,7 +214,6 @@ if (tmp_path == NULL) { if(buf) kfree(buf); - FreeXid(xid); return -ENOMEM; } @@ -235,7 +227,6 @@ } else if (rc) { if(buf) kfree(buf); - FreeXid(xid); return rc; } } else { @@ -244,8 +235,10 @@ /* get new inode */ if (*pinode == NULL) { *pinode = new_inode(sb); + if(*pinode == NULL) + return -ENOMEM; + insert_inode_hash(*pinode); } - inode = *pinode; cifsInfo = CIFS_I(inode); pfindData->Attributes = le32_to_cpu(pfindData->Attributes); @@ -332,22 +325,23 @@ } if(buf) kfree(buf); - FreeXid(xid); return rc; } void cifs_read_inode(struct inode *inode) { /* gets root inode */ - + int xid; struct cifs_sb_info *cifs_sb; cifs_sb = CIFS_SB(inode->i_sb); - + xid = GetXid(); if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) - cifs_get_inode_info_unix(&inode, "", inode->i_sb); + cifs_get_inode_info_unix(&inode, "", inode->i_sb,xid); else - cifs_get_inode_info(&inode, "", NULL, inode->i_sb); + cifs_get_inode_info(&inode, "", NULL, inode->i_sb,xid); + /* can not call macro FreeXid here since in a void func */ + _FreeXid(xid); } int @@ -473,10 +467,10 @@ inode->i_nlink++; if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&newinode, full_path, - inode->i_sb); + inode->i_sb,xid); else rc = cifs_get_inode_info(&newinode, full_path,NULL, - inode->i_sb); + inode->i_sb,xid); direntry->d_op = &cifs_dentry_ops; d_instantiate(direntry, newinode); @@ -698,7 +692,7 @@ if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) { rc = cifs_get_inode_info_unix(&direntry->d_inode, full_path, - direntry->d_sb); + direntry->d_sb,xid); if(rc) { cFYI(1,("error on getting revalidate info %d",rc)); /* if(rc != -ENOENT) @@ -706,7 +700,7 @@ } } else { rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL, - direntry->d_sb); + direntry->d_sb,xid); if(rc) { cFYI(1,("error on getting revalidate info %d",rc)); /* if(rc != -ENOENT) diff -Nru a/fs/cifs/link.c b/fs/cifs/link.c --- a/fs/cifs/link.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/link.c 2004-06-28 19:12:44 -07:00 @@ -188,10 +188,10 @@ if (rc == 0) { if (pTcon->ses->capabilities & CAP_UNIX) rc = cifs_get_inode_info_unix(&newinode, full_path, - inode->i_sb); + inode->i_sb,xid); else rc = cifs_get_inode_info(&newinode, full_path, NULL, - inode->i_sb); + inode->i_sb,xid); if (rc != 0) { cFYI(1, diff -Nru a/fs/cifs/transport.c b/fs/cifs/transport.c --- a/fs/cifs/transport.c 2004-06-28 19:12:44 -07:00 +++ b/fs/cifs/transport.c 2004-06-28 19:12:44 -07:00 @@ -215,8 +215,14 @@ < CIFS_MAX_REQ); spin_lock(&GlobalMid_Lock); } else { + if(ses->server->tcpStatus == CifsExiting) { + spin_unlock(&GlobalMid_Lock); + return -ENOENT; + } + /* can not count locking commands against total since they are allowed to block on server */ + if(long_op < 3) { /* update # of requests on the wire to server */ atomic_inc(&ses->server->inFlight);