Print this page
10262 excessive page destruction caused by 6602
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com>
Reviewed by: Ryan Zezeski <rpz@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/lofi.c
          +++ new/usr/src/uts/common/io/lofi.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   *
  24   24   * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  25   25   * Copyright (c) 2016 Andrey Sokolov
  26   26   * Copyright 2016 Toomas Soome <tsoome@me.com>
       27 + * Copyright 2019 Joyent, Inc.
  27   28   */
  28   29  
  29   30  /*
  30   31   * lofi (loopback file) driver - allows you to attach a file to a device,
  31   32   * which can then be accessed through that device. The simple model is that
  32   33   * you tell lofi to open a file, and then use the block device you get as
  33   34   * you would any block device. lofi translates access to the block device
  34   35   * into I/O on the underlying file. This is mostly useful for
  35   36   * mounting images of filesystems.
  36   37   *
↓ open down ↓ 509 lines elided ↑ open up ↑
 546  547                  for (i = 0; i < lofi_taskq_nthreads; i++) {
 547  548                          if (lsp->ls_comp_bufs[i].bufsize > 0)
 548  549                                  kmem_free(lsp->ls_comp_bufs[i].buf,
 549  550                                      lsp->ls_comp_bufs[i].bufsize);
 550  551                  }
 551  552                  kmem_free(lsp->ls_comp_bufs,
 552  553                      sizeof (struct compbuf) * lofi_taskq_nthreads);
 553  554          }
 554  555  
 555  556          if (lsp->ls_vp != NULL) {
 556      -                (void) VOP_PUTPAGE(lsp->ls_vp, 0, 0, B_INVAL, credp, NULL);
      557 +                (void) VOP_PUTPAGE(lsp->ls_vp, 0, 0, B_FREE, credp, NULL);
 557  558                  (void) VOP_CLOSE(lsp->ls_vp, lsp->ls_openflag,
 558  559                      1, 0, credp, NULL);
 559  560                  VN_RELE(lsp->ls_vp);
 560  561          }
 561  562          if (lsp->ls_stacked_vp != lsp->ls_vp)
 562  563                  VN_RELE(lsp->ls_stacked_vp);
 563  564          lsp->ls_vp = lsp->ls_stacked_vp = NULL;
 564  565  
 565  566          if (lsp->ls_kstat != NULL) {
 566  567                  kstat_delete(lsp->ls_kstat);
↓ open down ↓ 2360 lines elided ↑ open up ↑
2927 2928                  *rvalp = id;
2928 2929          (void) copy_out_lofi_ioctl(klip, ulip, ioctl_flag);
2929 2930          free_lofi_ioctl(klip);
2930 2931          return (0);
2931 2932  
2932 2933  err:
2933 2934          if (lsp != NULL) {
2934 2935                  lofi_destroy(lsp, credp);
2935 2936          } else {
2936 2937                  if (vp != NULL) {
2937      -                        (void) VOP_PUTPAGE(vp, 0, 0, B_INVAL, credp, NULL);
     2938 +                        (void) VOP_PUTPAGE(vp, 0, 0, B_FREE, credp, NULL);
2938 2939                          (void) VOP_CLOSE(vp, flag, 1, 0, credp, NULL);
2939 2940                          VN_RELE(vp);
2940 2941                  }
2941 2942          }
2942 2943  
2943 2944          mutex_exit(&lofi_lock);
2944 2945          free_lofi_ioctl(klip);
2945 2946          return (error);
2946 2947  }
2947 2948  
↓ open down ↓ 645 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX