ramfs: Acquire write lock before unmounting.

Might help with #18032.
This commit is contained in:
Augustin Cavalier
2022-11-29 19:06:56 -05:00
parent d5c130a3f9
commit 05fdda96b7
@@ -119,13 +119,14 @@ ramfs_unmount(fs_volume* _volume)
{ {
FUNCTION_START(); FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
status_t error = B_OK;
status_t error = volume->Unmount(); if (VolumeWriteLocker locker = volume) {
error = volume->Unmount();
if (error == B_OK) if (error == B_OK)
delete volume; delete volume;
if (error != B_OK) } else
REPORT_ERROR(error); SET_ERROR(error, B_ERROR);
return error; RETURN_ERROR(error);
} }