mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
a140dc5469
When modifing overlapping regions of a file using mmap(2) and write(2)/read(2) it is possible to deadlock due to a lock inversion. The zfs_write() and zfs_read() hooks first take the zfs range lock and then lock the individual pages. Conversely, when using mmap'ed I/O the zpl_writepage() hook is called with the individual page locks already taken and then zfs_putpage() takes the zfs range lock. The most straight forward fix is to simply not take the zfs range lock in the mmap(2) case. The individual pages will still be locked thus serializing access. Updating the same region of a file with write(2) and mmap(2) has always been a dodgy thing to do. This change at a minimum ensures we don't deadlock and is consistent with the existing Linux semantics enforced by the VFS. This isn't an issue under Solaris because the only range locking performed will be with the zfs range locks. It's up to each filesystem to perform its own file locking. Under Linux the VFS provides many of these services. It may be possible/desirable at a latter date to entirely dump the existing zfs range locking and rely on the Linux VFS page locks. However, for now its safest to perform both layers of locking until zfs is more tightly integrated with the page cache. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #302 |
||
---|---|---|
cmd | ||
config | ||
dracut | ||
etc | ||
include | ||
lib | ||
man | ||
module | ||
patches | ||
scripts | ||
.gitignore | ||
AUTHORS | ||
autogen.sh | ||
ChangeLog | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYRIGHT | ||
DISCLAIMER | ||
Makefile.am | ||
Makefile.in | ||
META | ||
OPENSOLARIS.LICENSE | ||
README.markdown | ||
zfs_config.h.in | ||
zfs-modules.spec.in | ||
zfs-script-config.sh.in | ||
ZFS.RELEASE | ||
zfs.spec.in |
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