Commit cbdfa1aa authored by Nils Goroll's avatar Nils Goroll

Only update VSM segments which actually _have_ changed

a vav[0] is the error or NULL if ok. vsm_cmp_av considers NULL the end
of the av, so we would always comare vg and the av equal and begin insertion
of new vgs. This would lead to all vsm segments be removed and newly added.

Fixes #2470
parent ab2126af
......@@ -447,6 +447,10 @@ vsm_refresh_set2(struct vsm *vd, struct vsm_set *vs, struct vsb *vsb)
VTAILQ_FOREACH(vg, &vs->segs, list)
vg->markscan = 0;
/*
* Efficient comparison walking the two lists side-by-side is ok because
* segment inserts always happen at the tail (VSMW_Allocv)
*/
vg = VTAILQ_FIRST(&vs->segs);
while (p != NULL && *p != '\0') {
e = strchr(p, '\n');
......@@ -463,7 +467,7 @@ vsm_refresh_set2(struct vsm *vd, struct vsm_set *vs, struct vsb *vsb)
VAV_Free(av);
break;
}
while (vg != NULL && !vsm_cmp_av(vg->av, av))
while (vg != NULL && !vsm_cmp_av(&vg->av[1], &av[1]))
vg = VTAILQ_NEXT(vg, list);
if (vg != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment