HomeFreeBSD

Add cond_resched to zfs_zget to prevent infinite loop

Description

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

Details

Provenance
tuxoko <tuxoko@gmail.com>Authored on May 1 2015, 3:11 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on May 4 2015, 4:12 PM
Parents
rGc9520ecc0f46: dmu: fix integer overflows
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG6102d0376ecf: Add cond_resched to zfs_zget to prevent infinite loop (authored by tuxoko <tuxoko@gmail.com>).May 4 2015, 4:12 PM