Print this page
NEX-15069 smtorture smb2.create.blob is failed
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-15069 smtorture smb2.create.blob is failed
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-1643 dtrace provider for smbsrv
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
SMB-11 SMB2 message parse & dispatch
SMB-12 SMB2 Negotiate Protocol
SMB-13 SMB2 Session Setup
SMB-14 SMB2 Logoff
SMB-15 SMB2 Tree Connect
SMB-16 SMB2 Tree Disconnect
SMB-17 SMB2 Create
SMB-18 SMB2 Close
SMB-19 SMB2 Flush
SMB-20 SMB2 Read
SMB-21 SMB2 Write
SMB-22 SMB2 Lock/Unlock
SMB-23 SMB2 Ioctl
SMB-24 SMB2 Cancel
SMB-25 SMB2 Echo
SMB-26 SMB2 Query Dir
SMB-27 SMB2 Change Notify
SMB-28 SMB2 Query Info
SMB-29 SMB2 Set Info
SMB-30 SMB2 Oplocks
SMB-53 SMB2 Create Context options
(SMB2 code review cleanup 1, 2, 3)
SMB-63 taskq_create_proc ... TQ_DYNAMIC puts tasks in p0
re #11974 CIFS Share - Tree connect fails from Windows 7 Clients
re #10733 Windows 7 directory listing keeps restarting

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb_find.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb_find.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       23 + * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  
  26   26  #include <smbsrv/smb_kproto.h>
  27   27  
  28   28  /*
  29   29   * smb_com_search
  30   30   * smb_com_find, smb_com_find_close
  31   31   * smb_find_unique
  32   32   *
  33   33   * These commands are used for directory searching. They share the same
↓ open down ↓ 162 lines elided ↑ open up ↑
 196  196   */
 197  197  
 198  198  #define SMB_NAME83_BUFLEN       12
 199  199  static void smb_name83(const char *, char *, size_t);
 200  200  
 201  201  /* *** smb_com_search *** */
 202  202  
 203  203  smb_sdrc_t
 204  204  smb_pre_search(smb_request_t *sr)
 205  205  {
 206      -        DTRACE_SMB_1(op__Search__start, smb_request_t *, sr);
      206 +        DTRACE_SMB_START(op__Search, smb_request_t *, sr);
 207  207          return (SDRC_SUCCESS);
 208  208  }
 209  209  
 210  210  void
 211  211  smb_post_search(smb_request_t *sr)
 212  212  {
 213      -        DTRACE_SMB_1(op__Search__done, smb_request_t *, sr);
      213 +        DTRACE_SMB_DONE(op__Search, smb_request_t *, sr);
 214  214  }
 215  215  
 216  216  smb_sdrc_t
 217  217  smb_com_search(smb_request_t *sr)
 218  218  {
 219  219          int                     rc;
 220  220          uint16_t                count, maxcount, index;
 221  221          uint16_t                sattr, odid;
 222  222          uint16_t                key_len;
 223  223          uint32_t                client_key;
↓ open down ↓ 69 lines elided ↑ open up ↑
 293  293          client_key = 0;
 294  294  
 295  295          if (find_first) {
 296  296                  status = smb_odir_openpath(sr, pn->pn_path, sattr, 0, &od);
 297  297                  if (status != 0) {
 298  298                          if (status == NT_STATUS_ACCESS_DENIED)
 299  299                                  smbsr_warn(sr, NT_STATUS_NO_MORE_FILES,
 300  300                                      ERRDOS, ERROR_NO_MORE_FILES);
 301  301                          return (SDRC_ERROR);
 302  302                  }
      303 +                odid = od->d_odid;
 303  304          } else {
 304  305                  if (smb_mbc_decodef(&sr->smb_data, "b12.wwl",
 305  306                      &resume_char, &index, &odid, &client_key) != 0) {
 306  307                          return (SDRC_ERROR);
 307  308                  }
 308  309                  od = smb_tree_lookup_odir(sr, odid);
 309  310          }
 310  311  
 311  312          if (od == NULL) {
 312  313                  smbsr_error(sr, NT_STATUS_INVALID_HANDLE,
↓ open down ↓ 74 lines elided ↑ open up ↑
 387  388          smb_odir_release(od);
 388  389          return (SDRC_SUCCESS);
 389  390  }
 390  391  
 391  392  
 392  393  /* *** smb_com_find *** */
 393  394  
 394  395  smb_sdrc_t
 395  396  smb_pre_find(smb_request_t *sr)
 396  397  {
 397      -        DTRACE_SMB_1(op__Find__start, smb_request_t *, sr);
      398 +        DTRACE_SMB_START(op__Find, smb_request_t *, sr);
 398  399          return (SDRC_SUCCESS);
 399  400  }
 400  401  
 401  402  void
 402  403  smb_post_find(smb_request_t *sr)
 403  404  {
 404      -        DTRACE_SMB_1(op__Find__done, smb_request_t *, sr);
      405 +        DTRACE_SMB_DONE(op__Find, smb_request_t *, sr);
 405  406  }
 406  407  
 407  408  smb_sdrc_t
 408  409  smb_com_find(smb_request_t *sr)
 409  410  {
 410  411          int                     rc;
 411  412          uint16_t                count, maxcount, index;
 412  413          uint16_t                sattr, odid;
 413  414          uint16_t                key_len;
 414  415          uint32_t                client_key;
↓ open down ↓ 33 lines elided ↑ open up ↑
 448  449          find_first = (key_len == 0);
 449  450          resume_char = 0;
 450  451          client_key = 0;
 451  452  
 452  453          if (find_first) {
 453  454                  status = smb_odir_openpath(sr, pn->pn_path, sattr, 0, &od);
 454  455                  if (status != 0) {
 455  456                          smbsr_error(sr, status, 0, 0);
 456  457                          return (SDRC_ERROR);
 457  458                  }
      459 +                odid = od->d_odid;
 458  460          } else {
 459  461                  if (smb_mbc_decodef(&sr->smb_data, "b12.wwl",
 460  462                      &resume_char, &index, &odid, &client_key) != 0) {
 461  463                          return (SDRC_ERROR);
 462  464                  }
 463  465                  od = smb_tree_lookup_odir(sr, odid);
 464  466          }
 465  467  
 466  468          if (od == NULL) {
 467  469                  smbsr_error(sr, NT_STATUS_INVALID_HANDLE,
↓ open down ↓ 72 lines elided ↑ open up ↑
 540  542          smb_odir_release(od);
 541  543          return (SDRC_SUCCESS);
 542  544  }
 543  545  
 544  546  
 545  547  /* *** smb_com_find_close *** */
 546  548  
 547  549  smb_sdrc_t
 548  550  smb_pre_find_close(smb_request_t *sr)
 549  551  {
 550      -        DTRACE_SMB_1(op__FindClose__start, smb_request_t *, sr);
      552 +        DTRACE_SMB_START(op__FindClose, smb_request_t *, sr);
 551  553          return (SDRC_SUCCESS);
 552  554  }
 553  555  
 554  556  void
 555  557  smb_post_find_close(smb_request_t *sr)
 556  558  {
 557      -        DTRACE_SMB_1(op__FindClose__done, smb_request_t *, sr);
      559 +        DTRACE_SMB_DONE(op__FindClose, smb_request_t *, sr);
 558  560  }
 559  561  
 560  562  smb_sdrc_t
 561  563  smb_com_find_close(smb_request_t *sr)
 562  564  {
 563  565          int             rc;
 564  566          uint16_t        maxcount, index;
 565  567          uint16_t        sattr, odid;
 566  568          uint16_t        key_len;
 567  569          uint32_t        client_key;
↓ open down ↓ 38 lines elided ↑ open up ↑
 606  608  
 607  609          return (SDRC_SUCCESS);
 608  610  }
 609  611  
 610  612  
 611  613  /* *** smb_com_find_unique *** */
 612  614  
 613  615  smb_sdrc_t
 614  616  smb_pre_find_unique(smb_request_t *sr)
 615  617  {
 616      -        DTRACE_SMB_1(op__FindUnique__start, smb_request_t *, sr);
      618 +        DTRACE_SMB_START(op__FindUnique, smb_request_t *, sr);
 617  619          return (SDRC_SUCCESS);
 618  620  }
 619  621  
 620  622  void
 621  623  smb_post_find_unique(smb_request_t *sr)
 622  624  {
 623      -        DTRACE_SMB_1(op__FindUnique__done, smb_request_t *, sr);
      625 +        DTRACE_SMB_DONE(op__FindUnique, smb_request_t *, sr);
 624  626  }
 625  627  
 626  628  smb_sdrc_t
 627  629  smb_com_find_unique(struct smb_request *sr)
 628  630  {
 629  631          int                     rc;
 630  632          uint16_t                count, maxcount, index;
 631  633          uint16_t                sattr;
 632  634          smb_pathname_t          *pn;
 633  635          unsigned char           resume_char = '\0';
↓ open down ↓ 50 lines elided ↑ open up ↑
 684  686  
 685  687                  if (*fileinfo.fi_shortname == '\0') {
 686  688                          if (smb_needs_mangled(fileinfo.fi_name))
 687  689                                  continue;
 688  690                          (void) strlcpy(fileinfo.fi_shortname, fileinfo.fi_name,
 689  691                              SMB_SHORTNAMELEN - 1);
 690  692                  }
 691  693                  smb_name83(fileinfo.fi_shortname, name83, SMB_SHORTNAMELEN);
 692  694  
 693  695                  (void) smb_mbc_encodef(&sr->reply, "b11c.wwlbYl13c",
 694      -                    resume_char, name83, index, od->d_odid,
 695      -                    client_key, fileinfo.fi_dosattr & 0xff,
      696 +                    resume_char, name83, index, od->d_odid, client_key,
      697 +                    fileinfo.fi_dosattr & 0xff,
 696  698                      smb_time_gmt_to_local(sr, fileinfo.fi_mtime.tv_sec),
 697  699                      (int32_t)fileinfo.fi_size,
 698  700                      fileinfo.fi_shortname);
 699  701  
 700  702                  count++;
 701  703                  index++;
 702  704          }
 703  705          if (eos && rc == ENOENT)
 704  706                  rc = 0;
 705  707  
↓ open down ↓ 73 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX