FreeBSD src
Go to file
Brian Behlendorf f3ab88d646 Correctly lock pages for .readpages()
Unlike the .readpage() callback which is passed a single locked page
to be populated.  The .readpages() callback is passed a list of unlocked
pages which are all marked for read-ahead (PG_readahead set).  It is
the responsibly of .readpages() to ensure to pages are properly locked
before being populated.

Prior to this change the requested read-ahead pages would be updated
outside of the page lock which is unsafe.  The unlocked pages would then
be unlocked again which is harmless but should have been immediately
detected as bug.  Unfortunately, newer kernels failed detect this issue
because the check is done with a VM_BUG_ON which is disabled by default.
Luckily, the old Debian Lenny 2.6.26 kernel caught this because it
simply uses a BUG_ON.

The straight forward fix for this is to update the .readpages() callback
to use the read_cache_pages() helper function.  The helper function will
ensure that each page in the list is properly locked before it is passed
to the .readpage() callback.  In addition resolving the bug, this results
in a nice simplification of the existing code.

The downside to this change is that instead of passing one large read
request to the dmu multiple smaller ones are submitted.  All of these
requests however are marked for readahead so the lower layers should
issue a large I/O regardless.  Thus most of the request should hit the
ARC cache.

Futher optimization of this code can be done in the future is a perform
analysis determines it to be worthwhile.  But for the moment, it is
preferable that code be correct and understandable.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #355
2011-08-08 13:24:52 -07:00
cmd Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
config Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
dracut Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
etc Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
include Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
lib Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
man Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
module Correctly lock pages for .readpages() 2011-08-08 13:24:52 -07:00
patches
scripts Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
.gitignore
AUTHORS Add "ashift" property to zpool create 2011-06-17 16:35:49 -07:00
autogen.sh Make autogen.sh executable 2011-07-26 10:15:35 -07:00
ChangeLog
configure Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
configure.ac Turn the init.d scripts into autoconf config files 2011-08-01 09:54:44 -07:00
COPYING
COPYRIGHT
DISCLAIMER
Makefile.am Add dracut support 2011-03-17 16:52:04 -07:00
Makefile.in Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
META Prep zfs-0.6.0-rc5 tag 2011-07-01 15:24:34 -07:00
OPENSOLARIS.LICENSE
README.markdown Fix markdown rendering 2010-09-15 09:09:37 -07:00
zfs_config.h.in Add backing_device_info per-filesystem 2011-08-04 13:37:38 -07:00
zfs-modules.spec.in Fix rebuildable RPMs for el6/ch5 2011-04-08 10:22:42 -07:00
zfs-script-config.sh.in Unconditionally load core kernel modules 2010-11-11 11:38:25 -08:00
ZFS.RELEASE
zfs.spec.in Remove zfs service only on uninstall, not on upgrade 2011-07-08 11:44:17 -07:00

Native ZFS for Linux! ZFS is an advanced file system and volume manager which was originally developed for Solaris. It has been successfully ported to FreeBSD and now there is a functional Linux ZFS kernel port too. The port currently includes a fully functional and stable SPA, DMU, and ZVOL with a ZFS Posix Layer (ZPL) on the way!

$ ./configure
$ make pkg

Full documentation for building, configuring, and using ZFS can be found at: http://zfsonlinux.org