diff options
author | tuxoko <[email protected]> | 2015-05-01 11:11:01 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-05-04 09:12:41 -0700 |
commit | 6102d0376ecfbcc1f63819bc1046ee78b7f3d4fc (patch) | |
tree | ce6dcf8bbff9e503da6908d07e6dfbcb41e5e040 /module/zfs | |
parent | c9520ecc0f4693cf6fbc3f678555268dc2b91089 (diff) |
Add cond_resched to zfs_zget to prevent infinite loop
It's been reported that threads would loop infinitely inside zfs_zget. The
speculated cause for this is that if an inode is marked for evict, zfs_zget
would see that and loop. However, if the looping thread doesn't yield, the
inode may not have a chance to finish evict, thus causing a infinite loop.
This patch solve this issue by add cond_resched to zfs_zget, making the
looping thread to yield when needed.
Tested-by: jlavoy <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3349
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/zfs_znode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 0c0091f04..a3d64fe01 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -950,6 +950,8 @@ again: mutex_exit(&zp->z_lock); sa_buf_rele(db, NULL); ZFS_OBJ_HOLD_EXIT(zsb, obj_num); + /* inode might need this to finish evict */ + cond_resched(); goto again; } *zpp = zp; |