https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4359f488386c604c2e67a…
commit 4359f488386c604c2e67a03c1fadadb27f40f1ea
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Tue Jul 6 02:37:34 2021 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Tue Jul 6 02:37:34 2021 +0300
[BTRFS] Do not rely on mountmgr when mounting volumes
This turns off mountmgr listening on new devices. Now
BTRFS will only be mounted on demand when OS asks for it. RAID
is not going to work this way probably (have anybody checked it at all?)
This is a temporary workaround for CORE-17469
---
drivers/filesystems/btrfs/btrfs.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/filesystems/btrfs/btrfs.c b/drivers/filesystems/btrfs/btrfs.c
index 84495cd36c8..2f3858cd1c6 100644
--- a/drivers/filesystems/btrfs/btrfs.c
+++ b/drivers/filesystems/btrfs/btrfs.c
@@ -4218,8 +4218,8 @@ static NTSTATUS check_mount_device(_In_ PDEVICE_OBJECT DeviceObject,
_Out_ bool*
NTSTATUS Status;
ULONG to_read;
superblock* sb;
- UNICODE_STRING pnp_name;
- const GUID* guid;
+ // UNICODE_STRING pnp_name;
+ // const GUID* guid;
to_read = DeviceObject->SectorSize == 0 ? sizeof(superblock) :
(ULONG)sector_align(sizeof(superblock), DeviceObject->SectorSize);
@@ -4247,18 +4247,19 @@ static NTSTATUS check_mount_device(_In_ PDEVICE_OBJECT
DeviceObject, _Out_ bool*
DeviceObject->Flags &= ~DO_VERIFY_VOLUME;
- pnp_name.Buffer = NULL;
+ // pnp_name.Buffer = NULL;
- Status = get_device_pnp_name(DeviceObject, &pnp_name, &guid);
- if (!NT_SUCCESS(Status)) {
- WARN("get_device_pnp_name returned %08lx\n", Status);
- pnp_name.Length = 0;
- }
+ // Status = get_device_pnp_name(DeviceObject, &pnp_name, &guid);
+ // if (!NT_SUCCESS(Status)) {
+ // WARN("get_device_pnp_name returned %08lx\n", Status);
+ // pnp_name.Length = 0;
+ // }
- *pno_pnp = pnp_name.Length == 0;
+ // *pno_pnp = pnp_name.Length == 0;
+ *pno_pnp = true;
- if (pnp_name.Buffer)
- ExFreePool(pnp_name.Buffer);
+ // if (pnp_name.Buffer)
+ // ExFreePool(pnp_name.Buffer);
Status = STATUS_SUCCESS;
@@ -6406,9 +6407,9 @@ NTSTATUS __stdcall DriverEntry(_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_S
KeInitializeEvent(&mountmgr_thread_event, NotificationEvent, false);
- Status = PsCreateSystemThread(&mountmgr_thread_handle, 0,
&system_thread_attributes, NULL, NULL, mountmgr_thread, NULL);
- if (!NT_SUCCESS(Status))
- WARN("PsCreateSystemThread returned %08lx\n", Status);
+ // Status = PsCreateSystemThread(&mountmgr_thread_handle, 0,
&system_thread_attributes, NULL, NULL, mountmgr_thread, NULL);
+ // if (!NT_SUCCESS(Status))
+ // WARN("PsCreateSystemThread returned %08lx\n", Status);
IoRegisterFileSystem(DeviceObject);