Print this page
OS-5148 ftruncate at offset should emit proper events
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/pcfs/pc_vnops.c
          +++ new/usr/src/uts/common/fs/pcfs/pc_vnops.c
↓ open down ↓ 773 lines elided ↑ open up ↑
 774  774                  }
 775  775                  if (vap->va_size > UINT32_MAX) {
 776  776                          error = EFBIG;
 777  777                          goto out;
 778  778                  }
 779  779                  error = pc_truncate(pcp, (uint_t)vap->va_size);
 780  780  
 781  781                  if (error)
 782  782                          goto out;
 783  783  
 784      -                if (vap->va_size == 0)
      784 +                if (vap->va_size == 0) {
 785  785                          vnevent_truncate(vp, ct);
      786 +                } else {
      787 +                        vnevent_resize(vp, ct);
      788 +                }
 786  789          }
 787  790          /*
 788  791           * Change file modified times.
 789  792           */
 790  793          if (mask & (AT_MTIME | AT_CTIME)) {
 791  794                  /*
 792  795                   * If SysV-compatible option to set access and
 793  796                   * modified times if privileged, owner, or write access,
 794  797                   * use current time rather than va_mtime.
 795  798                   *
↓ open down ↓ 1644 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX