b00131d43c
The problem here is that prune_icache() tries to evict/delete both the xattr directory inode as well as at least one xattr inode contained in that directory. Here's what happens: 1. File is created. 2. xattr is created for that file (behind the scenes a xattr directory and a file in that xattr directory are created) 3. File is deleted. 4. Both the xattr directory inode and at least one xattr inode from that directory are evicted by prune_icache(); prune_icache() acquires a lock on both inodes before it calls ->evict() on the inodes When the xattr directory inode is evicted zfs_zinactive attempts to delete the xattr files contained in that directory. While enumerating these files zfs_zget() is called to obtain a reference to the xattr file znode - which tries to lock the xattr inode. However that very same xattr inode was already locked by prune_icache() further up the call stack, thus leading to a deadlock. This can be reliably reproduced like this: $ touch test $ attr -s a -V b test $ rm test $ echo 3 > /proc/sys/vm/drop_caches This patch fixes the deadlock by moving the zfs_purgedir() call to zfs_unlinked_drain(). Instead zfs_rmnode() now checks whether the xattr dir is empty and leaves the xattr dir in the unlinked set if it finds any xattrs. To ensure zfs_unlinked_drain() never accesses a stale super block zfsvfs_teardown() has been update to block until the iput taskq has been drained. This avoids a potential race where a file with an xattr directory is removed and the file system is immediately unmounted. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #266 |
||
---|---|---|
cmd | ||
config | ||
dracut | ||
etc | ||
include | ||
lib | ||
man | ||
module | ||
patches | ||
scripts | ||
.gitignore | ||
AUTHORS | ||
COPYING | ||
COPYRIGHT | ||
ChangeLog | ||
DISCLAIMER | ||
META | ||
Makefile.am | ||
Makefile.in | ||
OPENSOLARIS.LICENSE | ||
README.markdown | ||
ZFS.RELEASE | ||
autogen.sh | ||
configure | ||
configure.ac | ||
zfs-modules.spec.in | ||
zfs-script-config.sh.in | ||
zfs.spec.in | ||
zfs_config.h.in |
README.markdown
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