Skip to content

Commit ef55679

Browse files
ryaobehlendorf
authored andcommitted
Cleanup: metaslab_alloc_dva() should not NULL check mg->mg_next
This is a circularly linked list. mg->mg_next can never be NULL. This caused 3 defect reports in Coverity. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14042
1 parent d953bcb commit ef55679

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

module/zfs/metaslab.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5131,8 +5131,7 @@ metaslab_alloc_dva(spa_t *spa, metaslab_class_t *mc, uint64_t psize,
51315131
if (vd != NULL && vd->vdev_mg != NULL) {
51325132
mg = vdev_get_mg(vd, mc);
51335133

5134-
if (flags & METASLAB_HINTBP_AVOID &&
5135-
mg->mg_next != NULL)
5134+
if (flags & METASLAB_HINTBP_AVOID)
51365135
mg = mg->mg_next;
51375136
} else {
51385137
mg = mca->mca_rotor;

0 commit comments

Comments
 (0)