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-4540 SMB server declines EA support incorrectly
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Reviewed by: Matt Barden <Matt.Barden@nexenta.com>
NEX-2442 regression with smbtorture test raw.sfileinfo.rename
NEX-946 smb_set_by_fid should return zero on success
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)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb_set_fileinfo.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb_set_fileinfo.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 2014 Nexenta Systems, Inc.  All rights reserved.
       23 + * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Trans2 Set File/Path Information Levels:
  28   28   *
  29   29   * SMB_INFO_STANDARD
  30   30   * SMB_INFO_SET_EAS
  31   31   * SMB_SET_FILE_BASIC_INFO
  32   32   * SMB_SET_FILE_DISPOSITION_INFO
  33   33   * SMB_SET_FILE_END_OF_FILE_INFO
↓ open down ↓ 86 lines elided ↑ open up ↑
 120  120  
 121  121          return (SDRC_SUCCESS);
 122  122  }
 123  123  
 124  124  /*
 125  125   * smb_com_set_information (aka setattr)
 126  126   */
 127  127  smb_sdrc_t
 128  128  smb_pre_set_information(smb_request_t *sr)
 129  129  {
 130      -        DTRACE_SMB_1(op__SetInformation__start, smb_request_t *, sr);
      130 +        DTRACE_SMB_START(op__SetInformation, smb_request_t *, sr);
 131  131          return (SDRC_SUCCESS);
 132  132  }
 133  133  
 134  134  void
 135  135  smb_post_set_information(smb_request_t *sr)
 136  136  {
 137      -        DTRACE_SMB_1(op__SetInformation__done, smb_request_t *, sr);
      137 +        DTRACE_SMB_DONE(op__SetInformation, smb_request_t *, sr);
 138  138  }
 139  139  
 140  140  smb_sdrc_t
 141  141  smb_com_set_information(smb_request_t *sr)
 142  142  {
 143  143          uint16_t        infolev = SMB_SET_INFORMATION;
 144  144          smb_fqi_t       *fqi = &sr->arg.dirop.fqi;
 145  145  
 146  146          if (STYPE_ISIPC(sr->tid_tree->t_res_type)) {
 147  147                  smbsr_error(sr, NT_STATUS_ACCESS_DENIED,
↓ open down ↓ 12 lines elided ↑ open up ↑
 160  160  
 161  161          return (SDRC_SUCCESS);
 162  162  }
 163  163  
 164  164  /*
 165  165   * smb_com_set_information2 (aka setattre)
 166  166   */
 167  167  smb_sdrc_t
 168  168  smb_pre_set_information2(smb_request_t *sr)
 169  169  {
 170      -        DTRACE_SMB_1(op__SetInformation2__start, smb_request_t *, sr);
      170 +        DTRACE_SMB_START(op__SetInformation2, smb_request_t *, sr);
 171  171          return (SDRC_SUCCESS);
 172  172  }
 173  173  
 174  174  void
 175  175  smb_post_set_information2(smb_request_t *sr)
 176  176  {
 177      -        DTRACE_SMB_1(op__SetInformation2__done, smb_request_t *, sr);
      177 +        DTRACE_SMB_DONE(op__SetInformation2, smb_request_t *, sr);
 178  178  }
 179  179  
 180  180  smb_sdrc_t
 181  181  smb_com_set_information2(smb_request_t *sr)
 182  182  {
 183  183          uint16_t infolev = SMB_SET_INFORMATION2;
 184  184  
 185  185          if (smbsr_decode_vwv(sr, "w", &sr->smb_fid) != 0)
 186  186                  return (SDRC_ERROR);
 187  187  
↓ open down ↓ 98 lines elided ↑ open up ↑
 286  286          rc = smb_pathname_reduce(sr, sr->user_cr, pn->pn_path,
 287  287              sr->tid_tree->t_snode, sr->tid_tree->t_snode, &dnode, name);
 288  288          if (rc == 0) {
 289  289                  rc = smb_fsop_lookup_name(sr, sr->user_cr, SMB_FOLLOW_LINKS,
 290  290                      sr->tid_tree->t_snode, dnode, name, &node);
 291  291                  smb_node_release(dnode);
 292  292          }
 293  293          kmem_free(name, MAXNAMELEN);
 294  294  
 295  295          if (rc != 0) {
 296      -                if (rc == ENOENT) {
 297      -                        smbsr_error(sr, NT_STATUS_OBJECT_NAME_NOT_FOUND,
 298      -                            ERRDOS, ERROR_FILE_NOT_FOUND);
 299      -                } else {
 300      -                        smbsr_errno(sr, rc);
 301      -                }
      296 +                smbsr_errno(sr, rc);
 302  297                  return (-1);
 303  298          }
 304  299  
 305  300          bzero(&sinfo, sizeof (sinfo));
 306  301          sinfo.si_node = node;
 307  302          if (xa != NULL)
 308  303                  sinfo.si_data = xa->req_data_mb;
 309  304          status = smb_set_fileinfo(sr, &sinfo, infolev);
 310  305          if (status != 0) {
 311  306                  smbsr_error(sr, status, 0, 0);
↓ open down ↓ 22 lines elided ↑ open up ↑
 334  329  
 335  330          case SMB_SET_INFORMATION2:
 336  331                  status = smb_set_information2(sr, sinfo);
 337  332                  break;
 338  333  
 339  334          case SMB_INFO_STANDARD:
 340  335                  status = smb_set_standard_info(sr, sinfo);
 341  336                  break;
 342  337  
 343  338          case SMB_INFO_SET_EAS:
 344      -                /* EAs not supported */
 345      -                status = 0;
      339 +                status = NT_STATUS_EAS_NOT_SUPPORTED;
 346  340                  break;
 347  341  
 348  342          case SMB_SET_FILE_BASIC_INFO:
 349  343          case SMB_FILE_BASIC_INFORMATION:
 350  344                  status = smb_set_basic_info(sr, sinfo);
 351  345                  break;
 352  346  
 353  347          case SMB_SET_FILE_DISPOSITION_INFO:
 354  348          case SMB_FILE_DISPOSITION_INFORMATION:
 355  349                  status = smb_set_disposition_info(sr, sinfo);
↓ open down ↓ 234 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX