git: 2d33ad48bd37 - main - vtruncbuf: improve the check for meta buffer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Jan 2024 05:00:50 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2d33ad48bd37f27925e4c46c798f8f2d23a2b501 commit 2d33ad48bd37f27925e4c46c798f8f2d23a2b501 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-12-31 20:46:53 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-01-05 04:58:50 +0000 vtruncbuf: improve the check for meta buffer Revision e99215a614675 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 --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2e2457f59f60..e18c34656af4 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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