vtruncbuf: improve the check for meta buffer

Revision e99215a614 reorganized the code in vtruncbuf(), and moved
the logic to flush meta buffers into a dedicated loop. While doing it,
the condition was changed from bp->b_lblkno < 0 (to handle) into
bp->b_lblkno > 0 (to skip), which causes buffer at lblkno to needlessly
flush.

Reviewed by:	chs, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43261
This commit is contained in:
Konstantin Belousov 2023-12-31 22:46:53 +02:00
parent 4c41d10f15
commit 2d33ad48bd

View file

@ -2554,7 +2554,7 @@ restart_unlocked:
*/
restartsync:
TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) {
if (bp->b_lblkno > 0)
if (bp->b_lblkno >= 0)
continue;
/*
* Since we hold the vnode lock this should only