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>
NEX-4797 MS-Office crash while saving a file on a Nexenta smb share
Revert "NEX-4324 Should not include $DATA when enumerating streams"
This reverts commits c72f3674cf6d0db6a44cd40c1ed626e79f20a537
and 2db2cee12b7a06b6651924ff35cf8bfc42a3b32f.
NEX-4324 Should not include $DATA when enumerating streams (lint)
NEX-4324 Should not include $DATA when enumerating streams
Reviewed by: Daniel Borek <daniel.borek@nexenta.com>
Reviewed by: Matt Barden <Matt.Barden@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@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 #14152 Race between ipmi_submit_driver_request() and kcs_loop() (sync with illumos fix 3902)
SMB-46 File handle leaks exposed by mtime fixes (rm 7815)
re #7815 SMB server delivers old modification time...

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb_query_fileinfo.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb_query_fileinfo.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  25   25   */
  26   26  
  27   27  #include <smbsrv/smb_kproto.h>
  28   28  #include <smbsrv/smb_vops.h>
  29   29  #include <smbsrv/smb_fsops.h>
  30   30  
  31   31  /*
  32   32   * Trans2 Query File/Path Information Levels:
  33   33   *
  34   34   * SMB_INFO_STANDARD
↓ open down ↓ 107 lines elided ↑ open up ↑
 142  142   * smb_com_query_information (aka getattr)
 143  143   */
 144  144  smb_sdrc_t
 145  145  smb_pre_query_information(smb_request_t *sr)
 146  146  {
 147  147          int rc;
 148  148          smb_fqi_t *fqi = &sr->arg.dirop.fqi;
 149  149  
 150  150          rc = smbsr_decode_data(sr, "%S", sr, &fqi->fq_path.pn_path);
 151  151  
 152      -        DTRACE_SMB_2(op__QueryInformation__start, smb_request_t *, sr,
 153      -            smb_fqi_t *, fqi);
      152 +        DTRACE_SMB_START(op__QueryInformation, smb_request_t *, sr);
 154  153  
 155  154          return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 156  155  }
 157  156  
 158  157  void
 159  158  smb_post_query_information(smb_request_t *sr)
 160  159  {
 161      -        DTRACE_SMB_1(op__QueryInformation__done, smb_request_t *, sr);
      160 +        DTRACE_SMB_DONE(op__QueryInformation, smb_request_t *, sr);
 162  161  }
 163  162  
 164  163  smb_sdrc_t
 165  164  smb_com_query_information(smb_request_t *sr)
 166  165  {
 167  166          uint16_t infolev = SMB_QUERY_INFORMATION;
 168  167  
 169  168          if (STYPE_ISIPC(sr->tid_tree->t_res_type)) {
 170  169                  smbsr_error(sr, NT_STATUS_ACCESS_DENIED,
 171  170                      ERRDOS, ERROR_ACCESS_DENIED);
↓ open down ↓ 8 lines elided ↑ open up ↑
 180  179  
 181  180  /*
 182  181   * smb_com_query_information2 (aka getattre)
 183  182   */
 184  183  smb_sdrc_t
 185  184  smb_pre_query_information2(smb_request_t *sr)
 186  185  {
 187  186          int rc;
 188  187          rc = smbsr_decode_vwv(sr, "w", &sr->smb_fid);
 189  188  
 190      -        DTRACE_SMB_1(op__QueryInformation2__start, smb_request_t *, sr);
      189 +        DTRACE_SMB_START(op__QueryInformation2, smb_request_t *, sr);
 191  190  
 192  191          return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 193  192  }
 194  193  
 195  194  void
 196  195  smb_post_query_information2(smb_request_t *sr)
 197  196  {
 198      -        DTRACE_SMB_1(op__QueryInformation2__done, smb_request_t *, sr);
      197 +        DTRACE_SMB_DONE(op__QueryInformation2, smb_request_t *, sr);
 199  198  }
 200  199  
 201  200  smb_sdrc_t
 202  201  smb_com_query_information2(smb_request_t *sr)
 203  202  {
 204  203          uint16_t infolev = SMB_QUERY_INFORMATION2;
 205  204  
 206  205          if (smb_query_by_fid(sr, NULL, infolev) != 0)
 207  206                  return (SDRC_ERROR);
 208  207  
↓ open down ↓ 114 lines elided ↑ open up ↑
 323  322              sr->tid_tree->t_snode, sr->tid_tree->t_snode, &dnode,
 324  323              qinfo->qi_name);
 325  324  
 326  325          if (rc == 0) {
 327  326                  rc = smb_fsop_lookup_name(sr, sr->user_cr, SMB_FOLLOW_LINKS,
 328  327                      sr->tid_tree->t_snode, dnode, qinfo->qi_name, &node);
 329  328                  smb_node_release(dnode);
 330  329          }
 331  330  
 332  331          if (rc != 0) {
 333      -                if (rc == ENOENT)
 334      -                        smbsr_error(sr, NT_STATUS_OBJECT_NAME_NOT_FOUND,
 335      -                            ERRDOS, ERROR_FILE_NOT_FOUND);
 336      -                else
 337      -                        smbsr_errno(sr, rc);
      332 +                smbsr_errno(sr, rc);
 338  333  
 339  334                  kmem_free(qinfo, sizeof (smb_queryinfo_t));
 340  335                  return (-1);
 341  336          }
 342  337  
 343  338          if ((sr->smb_flg2 & SMB_FLAGS2_DFS) && smb_node_is_dfslink(node)) {
 344  339                  smbsr_error(sr, NT_STATUS_PATH_NOT_COVERED, ERRSRV, ERRbadpath);
 345  340                  kmem_free(qinfo, sizeof (smb_queryinfo_t));
 346  341                  smb_node_release(node);
 347  342                  return (-1);
↓ open down ↓ 300 lines elided ↑ open up ↑
 648  643  
 649  644          sinfo = kmem_alloc(sizeof (smb_streaminfo_t), KM_SLEEP);
 650  645          sinfo_next = kmem_alloc(sizeof (smb_streaminfo_t), KM_SLEEP);
 651  646          datasz = attr->sa_vattr.va_size;
 652  647          allocsz = attr->sa_allocsz;
 653  648  
 654  649          status = smb_odir_openat(sr, fnode, &od);
 655  650          switch (status) {
 656  651          case 0:
 657  652                  break;
      653 +        case NT_STATUS_OBJECT_NAME_NOT_FOUND:
 658  654          case NT_STATUS_NO_SUCH_FILE:
 659  655          case NT_STATUS_NOT_SUPPORTED:
 660  656                  /* No streams. */
      657 +                status = 0;
 661  658                  done = B_TRUE;
 662  659                  break;
 663  660          default:
 664  661                  return (status);
 665  662          }
 666  663  
 667  664          if (!done) {
 668  665                  rc = smb_odir_read_streaminfo(sr, od, sinfo, &eos);
 669  666                  if ((rc != 0) || (eos))
 670  667                          done = B_TRUE;
↓ open down ↓ 333 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX