]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
In bufwrite(), a dirty buffer is moved to the clean queue before the
authorkib <kib@FreeBSD.org>
Wed, 20 Mar 2013 21:08:00 +0000 (21:08 +0000)
committerkib <kib@FreeBSD.org>
Wed, 20 Mar 2013 21:08:00 +0000 (21:08 +0000)
commitfbd9d518d57802d082c329f2089e625810bfb956
treef93d3e2d1cfcd0859b3dde3fad99529302b754dc
parent6fbc70a0bc5387f75b59d76d9857ee9aceab716a
In bufwrite(), a dirty buffer is moved to the clean queue before the
bufobj counter of the writes in progress is incremented.  Other thread
inspecting the bufobj would consider it clean.

For the regular vnodes, the vnode lock is typically held both by the
thread performing the bufwrite() and an other thread doing syncing,
which prevents the situation.  On the other hand, writes to the VCHR
vnodes are done without holding vnode lock.

Increment the write ref counter for the buffer object before calling
bundirty().

Sponsored by: The FreeBSD Foundation
Tested by: pho
MFC after: 2 weeks
sys/kern/vfs_bio.c