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>

@@ -22,10 +22,11 @@
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  *
  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2016 Andrey Sokolov
  * Copyright 2016 Toomas Soome <tsoome@me.com>
+ * Copyright 2019 Joyent, Inc.
  */
 
 /*
  * lofi (loopback file) driver - allows you to attach a file to a device,
  * which can then be accessed through that device. The simple model is that

@@ -551,11 +552,11 @@
                 kmem_free(lsp->ls_comp_bufs,
                     sizeof (struct compbuf) * lofi_taskq_nthreads);
         }
 
         if (lsp->ls_vp != NULL) {
-                (void) VOP_PUTPAGE(lsp->ls_vp, 0, 0, B_INVAL, credp, NULL);
+                (void) VOP_PUTPAGE(lsp->ls_vp, 0, 0, B_FREE, credp, NULL);
                 (void) VOP_CLOSE(lsp->ls_vp, lsp->ls_openflag,
                     1, 0, credp, NULL);
                 VN_RELE(lsp->ls_vp);
         }
         if (lsp->ls_stacked_vp != lsp->ls_vp)

@@ -2932,11 +2933,11 @@
 err:
         if (lsp != NULL) {
                 lofi_destroy(lsp, credp);
         } else {
                 if (vp != NULL) {
-                        (void) VOP_PUTPAGE(vp, 0, 0, B_INVAL, credp, NULL);
+                        (void) VOP_PUTPAGE(vp, 0, 0, B_FREE, credp, NULL);
                         (void) VOP_CLOSE(vp, flag, 1, 0, credp, NULL);
                         VN_RELE(vp);
                 }
         }