Print this page
NEX-3046 hsfs asserts instead of handling getpage beyond EOF
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Marcel Telka <marcel.telka@nexenta.com>
Revert "NEX-5659 hsfs asserts instead of handling getpage beyond EOF"
This reverts commit c4b53e5f3fdfec5d117f9719bc4b77581f318442.
NEX-5659 hsfs asserts instead of handling getpage beyond EOF
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Marcel Telka <marcel.telka@nexenta.com>
NEX-2974 cannot exec from hsfs since illumos 5405
        
*** 20,30 ****
   */
  
  /*
   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   * Use is subject to license terms.
!  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
   * Copyright (c) 2017 by Delphix. All rights reserved.
   */
  
  /*
   * Vnode operations for the High Sierra filesystem
--- 20,30 ----
   */
  
  /*
   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   * Use is subject to license terms.
!  * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
   * Copyright (c) 2017 by Delphix. All rights reserved.
   */
  
  /*
   * Vnode operations for the High Sierra filesystem
*** 1159,1168 ****
--- 1159,1170 ----
                   * Need to really do disk IO to get the page.
                   */
                  if (!calcdone) {
                          extension += hp->hs_ra_bytes;
  
+                         len = (extension != 0) ? extension : PAGESIZE;
+ 
                          /*
                           * Some cd writers don't write sectors that aren't
                           * used. Also, there's no point in reading sectors
                           * we'll never look at.  So, if we're asked to go
                           * beyond the end of a file, truncate to the length
*** 1169,1188 ****
                           * of that file.
                           *
                           * Additionally, this behaviour is required by section
                           * 6.4.5 of ISO 9660:1988(E).
                           */
!                         len = MIN(extension ? extension : PAGESIZE,
!                             filsiz - off);
  
-                         /* A little paranoia. */
-                         ASSERT(len > 0);
- 
                          /*
                           * After all that, make sure we're asking for things
!                          * in units that bdev_strategy() will understand
!                          * (see bug 4202551).
                           */
                          len = roundup(len, DEV_BSIZE);
                          calcdone = 1;
                  }
  
--- 1171,1186 ----
                           * of that file.
                           *
                           * Additionally, this behaviour is required by section
                           * 6.4.5 of ISO 9660:1988(E).
                           */
!                         if (off < filsiz && off + len > filsiz)
!                                 len = filsiz - off;
  
                          /*
                           * After all that, make sure we're asking for things
!                          * in units that bdev_strategy() will understand.
                           */
                          len = roundup(len, DEV_BSIZE);
                          calcdone = 1;
                  }