From: Niu Yawei <yawei....@intel.com> cfs_hash_for_each_relax() should break iteration when callback returns non-zero value.
Signed-off-by: Niu Yawei <yawei....@intel.com> Reviewed-on: http://review.whamcloud.com/14927 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6636 Reviewed-by: Bobi Jam <bobi...@hotmail.com> Reviewed-by: Andreas Dilger <andreas.dil...@intel.com> Reviewed-by: Liang Zhen <liang.z...@intel.com> Signed-off-by: Oleg Drokin <oleg.dro...@intel.com> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/