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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbclnt/netsmb/smb_trantcp.c
          +++ new/usr/src/uts/common/fs/smbclnt/netsmb/smb_trantcp.c
↓ open down ↓ 24 lines elided ↑ open up ↑
  25   25   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26   26   * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27   27   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28   28   * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29   29   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30   30   * SUCH DAMAGE.
  31   31   *
  32   32   * $Id: smb_trantcp.c,v 1.39 2005/03/02 01:27:44 lindak Exp $
  33   33   */
  34   34  /*
  35      - * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  36   35   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  37   36   * Use is subject to license terms.
       37 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  38   38   */
  39   39  
  40   40  #include <sys/param.h>
  41   41  #include <sys/systm.h>
  42   42  #include <sys/autoconf.h>
  43   43  #include <sys/sysmacros.h>
  44   44  #include <sys/sunddi.h>
  45   45  #include <sys/kmem.h>
  46   46  #include <sys/proc.h>
  47   47  #include <sys/protosw.h>
↓ open down ↓ 541 lines elided ↑ open up ↑
 589  589  nb_unloan_fp(struct nbpcb *nbp)
 590  590  {
 591  591  
 592  592          mutex_enter(&nbp->nbp_lock);
 593  593  
 594  594          nbp->nbp_flags &= ~NBF_CONNECTED;
 595  595          while (nbp->nbp_flags & (NBF_SENDLOCK | NBF_RECVLOCK)) {
 596  596                  nbp->nbp_flags |= NBF_LOCKWAIT;
 597  597                  cv_wait(&nbp->nbp_cv, &nbp->nbp_lock);
 598  598          }
 599      -
      599 +        if (nbp->nbp_frag != NULL) {
      600 +                freemsg(nbp->nbp_frag);
      601 +                nbp->nbp_frag = NULL;
      602 +        }
 600  603          if (nbp->nbp_tiptr != NULL) {
 601  604                  (void) t_kclose(nbp->nbp_tiptr, 0);
 602  605                  nbp->nbp_tiptr = NULL;
 603  606          }
 604  607          nbp->nbp_state = NBST_CLOSED;
 605  608  
 606  609          mutex_exit(&nbp->nbp_lock);
 607  610  }
 608  611  
 609  612  static int
↓ open down ↓ 46 lines elided ↑ open up ↑
 656  659  
 657  660  static int
 658  661  nb_disconnect(struct nbpcb *nbp)
 659  662  {
 660  663          int err = 0;
 661  664  
 662  665          mutex_enter(&nbp->nbp_lock);
 663  666  
 664  667          if ((nbp->nbp_flags & NBF_CONNECTED) != 0) {
 665  668                  nbp->nbp_flags &= ~NBF_CONNECTED;
 666      -
 667      -                if (nbp->nbp_frag != NULL) {
 668      -                        freemsg(nbp->nbp_frag);
 669      -                        nbp->nbp_frag = NULL;
 670      -                }
 671      -
 672  669                  err = nb_snddis(nbp);
 673  670          }
 674  671  
 675  672          mutex_exit(&nbp->nbp_lock);
 676  673          return (err);
 677  674  }
 678  675  
 679  676  /*
 680  677   * Add the NetBIOS session header and send.
 681  678   *
↓ open down ↓ 228 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX