From: Niu Yawei <[email protected]> cfs_hash_for_each_relax() should break iteration when callback returns non-zero value.
Signed-off-by: Niu Yawei <[email protected]> Reviewed-on: http://review.whamcloud.com/14927 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6636 Reviewed-by: Bobi Jam <[email protected]> Reviewed-by: Andreas Dilger <[email protected]> Reviewed-by: Liang Zhen <[email protected]> Signed-off-by: Oleg Drokin <[email protected]> --- drivers/staging/lustre/lustre/libcfs/hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 286641b..6f4c7d4 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -1623,8 +1623,12 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, if (rc) /* callback wants to break iteration */ break; } + if (rc) /* callback wants to break iteration */ + break; } cfs_hash_bd_unlock(hs, &bd, 0); + if (rc) /* callback wants to break iteration */ + break; } cfs_hash_unlock(hs, 0); -- 2.1.0 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
