Do not leak transient ENOLCK error from flush_newblk_dep() loop.
authorkib <kib@FreeBSD.org>
Thu, 8 Sep 2016 12:08:54 +0000 (12:08 +0000)
committerkib <kib@FreeBSD.org>
Thu, 8 Sep 2016 12:08:54 +0000 (12:08 +0000)
commit03f5910da5bc2d5fc75ed97e3355811599498ce8
tree02eaa5f6715afa4448dc4a2ce7600880e1c816d3
parent835bb1130ca4bbb68fef2985a4eb782f11813ab7
Do not leak transient ENOLCK error from flush_newblk_dep() loop.

The buffer lock is retried on failed LK_SLEEPFAIL attempt, and error
from the failed attempt is irrelevant.  But since there is path after
retry which does not clear error, it is possible to return spurious
error from the function.

The issue resulted in a spurious failure of softdep_sync_buf(),
causing further spurious failure of ffs_sync().

In collaboration with: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
sys/ufs/ffs/ffs_softdep.c