cvs commit: src/sys/vm vm_fault.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Apr 5 20:49:47 UTC 2007


pjd         2007-04-05 20:49:46 UTC

  FreeBSD src repository

  Modified files:
    sys/vm               vm_fault.c 
  Log:
  Fix a problem for file systems that don't implement VOP_BMAP() operation.
  
  The problem is this: vm_fault_additional_pages() calls vm_pager_has_page(),
  which calls vnode_pager_haspage(). Now when VOP_BMAP() returns an error (eg.
  EOPNOTSUPP), vnode_pager_haspage() returns TRUE without initializing 'before'
  and 'after' arguments, so we have some accidental values there. This bascially
  was causing this condition to be meet:
  
          if ((rahead + rbehind) >
              ((cnt.v_free_count + cnt.v_cache_count) - cnt.v_free_reserved)) {
                  pagedaemon_wakeup();
                  [...]
          }
  
  (we have some random values in rahead and rbehind variables)
  
  I'm not entirely sure this is the right fix, maybe we should just return FALSE
  in vnode_pager_haspage() when VOP_BMAP() fails?
  
  alc@ knows about this problem, maybe he will be able to come up with a better
  fix if this is not the right one.
  
  Revision  Changes    Path
  1.226     +2 -0      src/sys/vm/vm_fault.c


More information about the cvs-src mailing list