Print this page
NEX-6276 SMB sparse file support
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-2604 Windows Explorer Stops Working / Crashes when Security Tab is accessed
NEX-2593 SMB2: unable to create folder with long filename on 4.0.3
NEX-2442 regression with smbtorture test raw.sfileinfo.rename
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/smb2_setinfo_file.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb2_setinfo_file.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       13 + * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  14   14   */
  15   15  
  16   16  /*
  17   17   * Dispatch function for SMB2_SET_INFO
  18   18   *
  19   19   * [MS-FSCC 2.4] If a file system does not support ...
  20   20   * an Information Classs, NT_STATUS_INVALID_PARAMETER...
  21   21   */
  22   22  
  23   23  #include <smbsrv/smb2_kproto.h>
↓ open down ↓ 232 lines elided ↑ open up ↑
 256  256  static uint32_t
 257  257  smb2_setf_valid_len(smb_request_t *sr, smb_setinfo_t *si)
 258  258  {
 259  259          smb_ofile_t *of = sr->fid_ofile;
 260  260          uint64_t eod;
 261  261          int rc;
 262  262  
 263  263          if (smb_mbc_decodef(&si->si_data, "q", &eod) != 0)
 264  264                  return (NT_STATUS_INFO_LENGTH_MISMATCH);
 265  265  
 266      -        rc = smb_fsop_set_data_length(sr, of->f_cr, of->f_node, eod);
      266 +        /*
      267 +         * Zero out data from EoD to end of file.
      268 +         * (Passing len=0 covers to end of file)
      269 +         */
      270 +        rc = smb_fsop_freesp(sr, of->f_cr, of, eod, 0);
 267  271          if (rc != 0)
 268  272                  return (smb_errno2status(rc));
 269  273  
 270  274          return (0);
 271  275  }
 272  276  
 273  277  /*
 274  278   * FileShortNameInformation
 275  279   *      We can (optionally) support supply short names,
 276  280   *      but you can't change them.
↓ open down ↓ 14 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX