aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/libcfs/hash.c
diff options
context:
space:
mode:
authorNiu Yawei <yawei.niu@intel.com>2015-09-14 18:41:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-15 06:26:53 -0700
commit3a956d8c1939e2ad34047fde96d40d39ec2186cf (patch)
treef1b69bbf5dba72aa94bd768dfdd1aa22dbe32031 /drivers/staging/lustre/lustre/libcfs/hash.c
parentstaging/lustre/osc: LBUG in osc_lru_reclaim (diff)
downloadlinux-dev-3a956d8c1939e2ad34047fde96d40d39ec2186cf.tar.xz
linux-dev-3a956d8c1939e2ad34047fde96d40d39ec2186cf.zip
staging/lustre/libcfs: minor fix in cfs_hash_for_each_relax()
cfs_hash_for_each_relax() should break iteration when callback returns non-zero value. Signed-off-by: Niu Yawei <yawei.niu@intel.com> Reviewed-on: http://review.whamcloud.com/14927 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6636 Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/libcfs/hash.c')
-rw-r--r--drivers/staging/lustre/lustre/libcfs/hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
index 286641bb1b41..6f4c7d47fa33 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);