]> git.proxmox.com Git - mirror_zfs.git/commit
Add cond_resched to zfs_zget to prevent infinite loop
authortuxoko <tuxoko@gmail.com>
Fri, 1 May 2015 03:11:01 +0000 (11:11 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 May 2015 16:12:41 +0000 (09:12 -0700)
commit6102d0376ecfbcc1f63819bc1046ee78b7f3d4fc
treece6dcf8bbff9e503da6908d07e6dfbcb41e5e040
parentc9520ecc0f4693cf6fbc3f678555268dc2b91089
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 <jalavoy@gmail.com>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3349
module/zfs/zfs_znode.c