Print this page
5133 Upstream SMB client fixes: Nexenta SUP-538 and SUP-548


 165          */
 166         SMB_VC_LOCK(vcp);
 167         if (vcp->vc_state != SMBIOD_ST_DEAD) {
 168                 smb_iod_newstate(vcp, SMBIOD_ST_DEAD);
 169                 cv_broadcast(&vcp->vc_statechg);
 170         }
 171         SMB_VC_UNLOCK(vcp);
 172 
 173         /*
 174          * Let's be safe here and avoid doing any
 175          * call across the network while trying to
 176          * shut things down.  If we just disconnect,
 177          * the server will take care of the logoff.
 178          */
 179         SMB_TRAN_DISCONNECT(vcp);
 180 
 181         /*
 182          * If we have an IOD, it should immediately notice
 183          * that its connection has closed.  But in case
 184          * it doesn't, let's also send it a signal.
 185          * (but don't shoot our own foot!)
 186          * Note: the iod calls smb_iod_invrq on its way out.
 187          */

 188         if (vcp->iod_thr != NULL &&
 189             vcp->iod_thr != curthread) {
 190                 tsignal(vcp->iod_thr, SIGKILL);
 191         }

 192 }
 193 
 194 /*
 195  * Send one request.
 196  *
 197  * Called by _addrq (for internal requests)
 198  * and _sendall (via _addrq, _multirq, _waitrq)
 199  */
 200 static int
 201 smb_iod_sendrq(struct smb_rq *rqp)
 202 {
 203         struct smb_vc *vcp = rqp->sr_vc;
 204         mblk_t *m;
 205         int error;
 206 
 207         ASSERT(vcp);
 208         ASSERT(SEMA_HELD(&vcp->vc_sendlock));
 209         ASSERT(RW_READ_HELD(&vcp->iod_rqlock));
 210 
 211         /*




 165          */
 166         SMB_VC_LOCK(vcp);
 167         if (vcp->vc_state != SMBIOD_ST_DEAD) {
 168                 smb_iod_newstate(vcp, SMBIOD_ST_DEAD);
 169                 cv_broadcast(&vcp->vc_statechg);
 170         }
 171         SMB_VC_UNLOCK(vcp);
 172 
 173         /*
 174          * Let's be safe here and avoid doing any
 175          * call across the network while trying to
 176          * shut things down.  If we just disconnect,
 177          * the server will take care of the logoff.
 178          */
 179         SMB_TRAN_DISCONNECT(vcp);
 180 
 181         /*
 182          * If we have an IOD, it should immediately notice
 183          * that its connection has closed.  But in case
 184          * it doesn't, let's also send it a signal.


 185          */
 186         SMB_VC_LOCK(vcp);
 187         if (vcp->iod_thr != NULL &&
 188             vcp->iod_thr != curthread) {
 189                 tsignal(vcp->iod_thr, SIGKILL);
 190         }
 191         SMB_VC_UNLOCK(vcp);
 192 }
 193 
 194 /*
 195  * Send one request.
 196  *
 197  * Called by _addrq (for internal requests)
 198  * and _sendall (via _addrq, _multirq, _waitrq)
 199  */
 200 static int
 201 smb_iod_sendrq(struct smb_rq *rqp)
 202 {
 203         struct smb_vc *vcp = rqp->sr_vc;
 204         mblk_t *m;
 205         int error;
 206 
 207         ASSERT(vcp);
 208         ASSERT(SEMA_HELD(&vcp->vc_sendlock));
 209         ASSERT(RW_READ_HELD(&vcp->iod_rqlock));
 210 
 211         /*