From 284f17739e5d0445256218a95a35901d8ff42a51 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 19 Jul 2010 11:57:57 +0000 Subject: [PATCH] Open the underlying file (or device) with O_NOCACHE. This works around a potential page writer deadlock. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37587 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_corruption/driver/checksum_device.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tests/system/kernel/file_corruption/driver/checksum_device.cpp b/src/tests/system/kernel/file_corruption/driver/checksum_device.cpp index 2dda2d3285..10240c01b0 100644 --- a/src/tests/system/kernel/file_corruption/driver/checksum_device.cpp +++ b/src/tests/system/kernel/file_corruption/driver/checksum_device.cpp @@ -311,7 +311,12 @@ struct RawDevice : Device, DoublyLinkedListLinkImpl { status_t Init(const char* fileName) { // open and stat file - fFD = open(fileName, O_RDWR); + fFD = open(fileName, O_RDWR | O_NOCACHE); + // TODO: The O_NOCACHE is a work-around for a page writer problem. + // Since it collects pages for writing back without regard for + // which caches and file systems they belong to, a deadlock can + // result when pages from both the underlying file system and the + // one using the checksum device are collected in one run. if (fFD < 0) return errno;