FreeBSD src
Go to file
Chunwei Chen 21a96fb635 Fix "BUG: Bad page state" caused by writeback flag
Commit d958324 fixed the deadlock between page lock and range lock by
unlocking the page lock before acquiring the range lock. However,
this created a new issue #3075.

The problem is that if we can't set the write back bit before releasing
the page lock.  Then other processes will be unaware that the page is
under active write back.  They may therefore truncate the page,
invalidate the page, or not honor the sync semantics.

To workaround this problem we re-dirty the page before dropping the
page lock.  While this doesn't prevent the page from being truncated
it does ensure it won't be invalidated.  Then the range lock and the
page lock are reacquired in the correct deadlock-free order.

Once both locks are safely held the page state can be rechecked.  If
all is well and the page is in the expect state the dirty bit can be
removed, the write back bit set, and the page removed from the skip
count.  If not the page will be handled as appropriate.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3075
2015-07-29 07:38:15 -07:00
cmd Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
config Fix some minor issues with the SYSV init and initramfs scripts. 2015-07-24 15:05:33 -07:00
contrib Make sure that POOL_IMPORTED is set, unset and checked where appropriate. 2015-07-28 13:29:28 -07:00
etc Fix some minor issues with the SYSV init and initramfs scripts. 2015-07-24 15:05:33 -07:00
include Fix build failure with Linux 4.1 and FTRACE 2015-07-29 07:35:06 -07:00
lib Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
man Reinstate zfs_arc_p_min_shift 2015-07-23 09:42:32 -07:00
module Fix "BUG: Bad page state" caused by writeback flag 2015-07-29 07:38:15 -07:00
rpm Set default _initconfdir directory 2015-07-21 13:16:50 -07:00
scripts Use truncate instead of fallocate in ziltest.sh 2015-07-13 11:02:59 -07:00
udev Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
.gitignore Ignore *.{deb,rpm,tar.gz} files in the top directory. 2013-04-24 16:18:59 -07:00
.gitmodules Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
AUTHORS Add a missing > to AUTHORS 2014-09-02 14:18:53 -07:00
autogen.sh build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
configure.ac Move dracut directory to contrib 2015-07-09 13:59:37 -07:00
copy-builtin Consistent menuconfig name 2012-08-26 13:49:37 -07:00
COPYRIGHT Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
DISCLAIMER Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
Makefile.am Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
META Tag zfs-0.6.4 2015-04-08 20:16:45 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
zfs-script-config.sh.in Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

Native ZFS for Linux!

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers.

Full documentation for installing ZoL on your favorite Linux distribution can be found at: http://zfsonlinux.org