]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix getblk() with GB_NOCREAT returning false-negatives.
authorBryan Drewery <bdrewery@FreeBSD.org>
Wed, 27 Jan 2021 17:59:50 +0000 (09:59 -0800)
committerBryan Drewery <bdrewery@FreeBSD.org>
Thu, 28 Jan 2021 19:24:24 +0000 (11:24 -0800)
commitc926114f2ff20d7c3e5a157f1618b6228f391bf7
tree0f11afd6f63128fda955d0fb2c6f3acf683810ea
parentae257282ae5b08db94ae46271d0fc3c24f0a0a4b
Fix getblk() with GB_NOCREAT returning false-negatives.

It is possible for a buf to be reassigned between the dirty and clean
lists while gbincore_unlocked() looks in each list.  Avoid creating
a buffer in that case and fallback to a locked lookup.

This fixes a regression from r363482.

More discussion on potential improvements to the clean and dirty lists
handling is in the review.

Reviewed by: cem, kib, markj, vangyzen, rlibby
Reported by: Suraj.Raju at dell.com
Submitted by: Suraj.Raju at dell.com, cem, [based on both]
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D28375
sys/kern/vfs_bio.c