Print this page
4278 read-only lofi devices can never be removed if used
        
*** 473,490 ****
          if (lsp->ls_vp == NULL) {
                  mutex_exit(&lofi_lock);
                  return (ENXIO);
          }
  
!         if (mark_opened(lsp, otyp) == -1) {
                  mutex_exit(&lofi_lock);
!                 return (EINVAL);
          }
  
!         if (lsp->ls_readonly && (flag & FWRITE)) {
                  mutex_exit(&lofi_lock);
!                 return (EROFS);
          }
  
          mutex_exit(&lofi_lock);
          return (0);
  }
--- 473,490 ----
          if (lsp->ls_vp == NULL) {
                  mutex_exit(&lofi_lock);
                  return (ENXIO);
          }
  
!         if (lsp->ls_readonly && (flag & FWRITE)) {
                  mutex_exit(&lofi_lock);
!                 return (EROFS);
          }
  
!         if (mark_opened(lsp, otyp) == -1) {
                  mutex_exit(&lofi_lock);
!                 return (EINVAL);
          }
  
          mutex_exit(&lofi_lock);
          return (0);
  }