Skip to content

Commit

Permalink
staging/lustre/libcfs: minor fix in cfs_hash_for_each_relax()
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
NiuYawei authored and gregkh committed Sep 15, 2015
1 parent 0df83c1 commit 3a956d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/staging/lustre/lustre/libcfs/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3a956d8

Please sign in to comment.