diff options
author | kib <kib@FreeBSD.org> | 2016-03-23 09:58:51 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-03-23 09:58:51 +0000 |
commit | e8766307c36e35dac7110c3d9a523b34a8f05dc5 (patch) | |
tree | ea56d2b9e0eca919ec57bddc843a0280aeebd6af | |
parent | 6837b0bc3fda7f0a57c4ef6345e2e890b71e87fc (diff) | |
download | FreeBSD-src-e8766307c36e35dac7110c3d9a523b34a8f05dc5.zip FreeBSD-src-e8766307c36e35dac7110c3d9a523b34a8f05dc5.tar.gz |
Fix locking mistake in softdep_waitidle(). The surrounding code
expects that the loop is always exited with the SU lock owned, even on
error.
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 04ea39c..bedc8e1 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1937,9 +1937,9 @@ softdep_waitidle(struct mount *mp, int flags __unused) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, MNT_WAIT, td); VOP_UNLOCK(devvp, 0); + ACQUIRE_LOCK(ump); if (error != 0) break; - ACQUIRE_LOCK(ump); } ump->softdep_req = 0; if (i == SU_WAITIDLE_RETRIES && error == 0 && ump->softdep_deps != 0) { |