diff options
author | Brian Behlendorf <[email protected]> | 2015-03-09 13:57:22 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-03-10 09:21:48 -0700 |
commit | 7f3e4662832269b687ff20dafc6a33f8e1d28912 (patch) | |
tree | 2d034e860ef55183c85051a3a9e88355a0b6c1dc | |
parent | 6184b3a6a0c76c68bc980cd8a34acc22ee5fa1e4 (diff) |
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3163
-rw-r--r-- | module/zfs/zpl_super.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/module/zfs/zpl_super.c b/module/zfs/zpl_super.c index aa234bcff..47cc2fcf4 100644 --- a/module/zfs/zpl_super.c +++ b/module/zfs/zpl_super.c @@ -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 |