From 87e00819ce743f5540234e9f8444462d879a4b15 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 18 Nov 2024 16:41:46 -0500 Subject: [PATCH] ram_disk: Fix lock assertion failure and use VM_PRIORITY_USER in another place. Change-Id: Iefd997e7e5838b51e4973f9f69bae6ea07f3b3cb Reviewed-on: https://review.haiku-os.org/c/haiku/+/8584 Reviewed-by: waddlesplash --- src/add-ons/kernel/drivers/disk/virtual/ram_disk/ram_disk.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/drivers/disk/virtual/ram_disk/ram_disk.cpp b/src/add-ons/kernel/drivers/disk/virtual/ram_disk/ram_disk.cpp index 8dd73aadc5..160f431495 100644 --- a/src/add-ons/kernel/drivers/disk/virtual/ram_disk/ram_disk.cpp +++ b/src/add-ons/kernel/drivers/disk/virtual/ram_disk/ram_disk.cpp @@ -321,7 +321,9 @@ struct RawDevice : Device, DoublyLinkedListLinkImpl { fCache->temporary = 1; fCache->virtual_end = fDeviceSize; - error = fCache->Commit(fDeviceSize, VM_PRIORITY_SYSTEM); + fCache->Lock(); + error = fCache->Commit(fDeviceSize, VM_PRIORITY_USER); + fCache->Unlock(); if (error != B_OK) { Unprepare(); return error;