kernel - Hold vm_token() for certain buf/bio/vm_page interactions
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 28 Nov 2010 06:28:52 +0000 (22:28 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 28 Nov 2010 06:28:52 +0000 (22:28 -0800)
commit763e6ed1f4de4043907d79652371ce3303e9bebc
tree4240ce3c4d7b74b0819ade83324f9f34b413ef93
parentd041353dbb3ca6a5435ce91f0d7a42c37889d0b7
kernel - Hold vm_token() for certain buf/bio/vm_page interactions

* Hold the vm_token when messing around with page valid and dirty bits
  in buffer cache operations.  Such race conditions are possible but would
  be very rare.

* Fix inconsistent use of bio2.bio_offset when swapcache intercepts an
  I/O operation.  When this case occurs the normal filesystem VOP_STRATEGY
  function will not be called and any assumption that bio2.bio_offset
  will represent a block device offset will be invalid.

  To deal with this case swapcache will re-set bio_offset to NOOFFSET.
  Filesystems use this value to determine that no block device offset
  has been cached for a logical file block.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de> (bio_offset issue)
sys/kern/vfs_bio.c