summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-10-12 12:38:03 +0000
committersos <sos@FreeBSD.org>2003-10-12 12:38:03 +0000
commite9cd93f0343e407429825539d29633974ba3eba1 (patch)
treebf2eab03ec10561a0d58c9f6df9b50b9e573afee
parente0cb3af529f3c97942ceb911ca9a1a1cb1d417a1 (diff)
downloadFreeBSD-src-e9cd93f0343e407429825539d29633974ba3eba1.zip
FreeBSD-src-e9cd93f0343e407429825539d29633974ba3eba1.tar.gz
Avoid potential race on ATA_R_DONE.
-rw-r--r--sys/dev/ata/ata-queue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c
index 734fae9..deb0514 100644
--- a/sys/dev/ata/ata-queue.c
+++ b/sys/dev/ata/ata-queue.c
@@ -97,8 +97,9 @@ ata_queue_request(struct ata_request *request)
return;
/* if this is not a callback and we havn't seen DONE yet -> sleep */
- if (!request->callback && !(request->flags & ATA_R_DONE)) {
- while (tsleep(request, PRIBIO, "atareq", 60*10*hz)) ;
+ if (!request->callback) {
+ while (!(request->flags & ATA_R_DONE))
+ tsleep(request, PRIBIO, "atareq", hz/10);
}
}
OpenPOWER on IntegriCloud