Mark zfs_inactive() with PF_FSTRANS

Allowing direct reclaim to re-enter the VFS in the zfs_inactive()
call path has historically been problematic for ZoL.  Therefore,
in order to avoid an entire class of current and future issues
caused by this PF_FSTRANS is set for all zfs_inactive() callers.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3163
This commit is contained in:
Brian Behlendorf 2015-03-09 13:57:22 -07:00
parent 6184b3a6a0
commit 7f3e466283
1 changed files with 8 additions and 0 deletions

View File

@ -98,9 +98,13 @@ zpl_dirty_inode(struct inode *ip)
static void
zpl_evict_inode(struct inode *ip)
{
fstrans_cookie_t cookie;
cookie = spl_fstrans_mark();
truncate_setsize(ip, 0);
clear_inode(ip);
zfs_inactive(ip);
spl_fstrans_unmark(cookie);
}
#else
@ -108,7 +112,11 @@ zpl_evict_inode(struct inode *ip)
static void
zpl_clear_inode(struct inode *ip)
{
fstrans_cookie_t cookie;
cookie = spl_fstrans_mark();
zfs_inactive(ip);
spl_fstrans_unmark(cookie);
}
static void