Skip to content

Commit

Permalink
Merged in DW-1743-bsod-log-printf-vsprint (pull request #598)
Browse files Browse the repository at this point in the history
DW-1743

Approved-by: 김성은 <sekim@mantech.co.kr>
  • Loading branch information
mantechswhan authored and sungeun-kim committed Jan 8, 2019
2 parents 54613bc + 7a32c9c commit 35e5c70
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 99 deletions.
5 changes: 0 additions & 5 deletions drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3722,13 +3722,8 @@ void drbd_cleanup_by_win_shutdown(PVOLUME_EXTENSION VolumeExtension)
} device_list;
struct device_list *device_list_p, *p;

#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("Shutdown: IRQL(%d) device(%ws) Name(%wZ)\n",
KeGetCurrentIrql(), VolumeExtension->PhysicalDeviceName, &VolumeExtension->MountPoint);
#else
WDRBD_INFO("Shutdown: IRQL(%d) device(%ws)\n",
KeGetCurrentIrql(), VolumeExtension->PhysicalDeviceName);
#endif

if (retry.wq)
destroy_workqueue(retry.wq);
Expand Down
33 changes: 2 additions & 31 deletions wdrbd9/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,21 +357,13 @@ mvolAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceOb
// DW-1109: create block device in add device routine, it won't be destroyed at least we put ref in remove device routine.
VolumeExtension->dev = create_drbd_block_device(VolumeExtension);

#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("VolumeExt(0x%p) Device(%ws) minor(%d) Active(%d) MountPoint(%wZ) VolumeGUID(%wZ)\n",
VolumeExtension,
VolumeExtension->PhysicalDeviceName,
VolumeExtension->Minor,
VolumeExtension->Active,
&VolumeExtension->MountPoint,
&VolumeExtension->VolumeGuid);
#else
WDRBD_INFO("VolumeExt(0x%p) Device(%ws) minor(%d) Active(%d)\n",
VolumeExtension,
VolumeExtension->PhysicalDeviceName,
VolumeExtension->Minor,
VolumeExtension->Active);
#endif

return STATUS_SUCCESS;
}
Expand Down Expand Up @@ -676,13 +668,8 @@ mvolWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
// then allow to lower device, so not try to send to peer
if (offset_sector + size_sector > vol_size_sector) {

#if WINVER != _WIN32_WINNT_WS08
WDRBD_TRACE("Upper driver WRITE vol(%wZ) sect(0x%llx+%u) VolumeExtension->IrpCount(%d) ......................Skipped Irp:%p Irp->Flags:%x\n",
&VolumeExtension->MountPoint, offset_sector, size_sector, VolumeExtension->IrpCount, Irp, Irp->Flags);
#else
WDRBD_TRACE("Upper driver WRITE sect(0x%llx+%u) VolumeExtension->IrpCount(%d) ......................Skipped Irp:%p Irp->Flags:%x\n",
offset_sector, size_sector, VolumeExtension->IrpCount, Irp, Irp->Flags);
#endif

unsigned long long saved_size = VolumeExtension->dev->bd_contains->d_size;
unsigned long long real_size = get_targetdev_volsize(VolumeExtension);
Expand All @@ -700,14 +687,9 @@ mvolWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)


#ifdef DRBD_TRACE
#if WINVER == _WIN32_WINNT_WS08
WDRBD_TRACE("Upper driver WRITE sect(0x%llx+%u) ................Queuing(%d)!\n",
offset_sector, size_sector, VolumeExtension->IrpCount);
#else
WDRBD_TRACE("Upper driver WRITE vol(%wZ) sect(0x%llx+%u) ................Queuing(%d)!\n",
&VolumeExtension->MountPoint, offset_sector, size_sector, VolumeExtension->IrpCount);
#endif
#endif

#ifdef _WIN32_MULTIVOL_THREAD
IoMarkIrpPending(Irp);
Expand Down Expand Up @@ -746,13 +728,10 @@ mvolWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
// DW-1300: put device reference count when no longer use.
if (device)
kref_put(&device->kref, drbd_destroy_device);
#if WINVER != _WIN32_WINNT_WS08

WDRBD_TRACE("Upper driver WRITE vol(%wZ) VolumeExtension->IrpCount(%d) STATUS_INVALID_DEVICE_REQUEST return Irp:%p Irp->Flags:%x\n",
&VolumeExtension->MountPoint, VolumeExtension->IrpCount, Irp, Irp->Flags);
#else
WDRBD_TRACE("Upper driver WRITE VolumeExtension->IrpCount(%d) STATUS_INVALID_DEVICE_REQUEST return Irp:%p Irp->Flags:%x\n",
VolumeExtension->IrpCount, Irp, Irp->Flags);
#endif

Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
Expand Down Expand Up @@ -853,21 +832,13 @@ mvolDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
status = IOCTL_MountVolume(DeviceObject, Irp, &size);
if (!NT_SUCCESS(status))
{
#if WINVER != _WIN32_WINNT_WS08
WDRBD_WARN("IOCTL_MVOL_MOUNT_VOLUME. %wZ Volume fail. status(0x%x)\n",
&VolumeExtension->MountPoint, status);
#else
WDRBD_WARN("IOCTL_MVOL_MOUNT_VOLUME. fail. status(0x%x)\n", status);
#endif
}
else if (!size)
{ // ok
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("IOCTL_MVOL_MOUNT_VOLUME. %wZ Volume is mounted\n",
&VolumeExtension->MountPoint);
#else
WDRBD_INFO("IOCTL_MVOL_MOUNT_VOLUME. mounted\n");
#endif
}

MVOL_IOCOMPLETE_REQ(Irp, status, size);
Expand Down
5 changes: 1 addition & 4 deletions wdrbd9/drbd_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -2267,11 +2267,8 @@ void update_targetdev(PVOLUME_EXTENSION pvext, bool bMountPointUpdate)
status = mvolUpdateMountPointInfoByExtension(pvext);
if(NT_SUCCESS(status)) {

#if WINVER != _WIN32_WINNT_WS08
WDRBD_TRACE("old_mount_point:%wZ new mount point:%wZ\n",&old_mount_point,&pvext->MountPoint);
#else
WDRBD_TRACE("update_targetdev new mount");
#endif

// DW-1105: detach volume when replicating volume letter is changed.
if (pvext->Active && bWasExist) {
if(IsEmptyUnicodeString(&pvext->MountPoint) ||
Expand Down
12 changes: 0 additions & 12 deletions wdrbd9/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,9 @@ IOCTL_MountVolume(PDEVICE_OBJECT DeviceObject, PIRP Irp, PULONG ReturnLength)

if (!pvext->Active)
{
#if WINVER != _WIN32_WINNT_WS08
sprintf(Message, "%wZ volume is not dismounted", &pvext->MountPoint);
*ReturnLength = strlen(Message);
WDRBD_ERROR("%s\n", Message);
#else
sprintf(Message, "volume is not dismounted");
*ReturnLength = strlen(Message);
WDRBD_ERROR("%s\n", Message);
#endif
//status = STATUS_INVALID_DEVICE_REQUEST;
goto out;
}
Expand All @@ -156,16 +150,10 @@ IOCTL_MountVolume(PDEVICE_OBJECT DeviceObject, PIRP Irp, PULONG ReturnLength)
if (pvext->WorkThreadInfo.Active && device)
#endif
{
#if WINVER != _WIN32_WINNT_WS08
sprintf(Message, "%wZ volume is handling by drbd. Failed to mount",
&pvext->MountPoint);
*ReturnLength = strlen(Message);
WDRBD_ERROR("%s\n", Message);
#else
sprintf(Message, "volume is handling by drbd. Failed to mount");
*ReturnLength = strlen(Message);
WDRBD_ERROR("%s\n", Message);
#endif
//status = STATUS_VOLUME_DISMOUNTED;
goto out;
}
Expand Down
17 changes: 2 additions & 15 deletions wdrbd9/sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,15 @@ mvolRemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
// DW-1277: check volume type we marked when drbd attaches.
// for normal volume.
if (!test_bit(VOLUME_TYPE_REPL, &VolumeExtension->Flag) && !test_bit(VOLUME_TYPE_META, &VolumeExtension->Flag)) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("Volume:%p (%wZ) was removed\n", VolumeExtension, &VolumeExtension->MountPoint);
#else
WDRBD_INFO("Volume:%p was removed\n", VolumeExtension);
#endif
}
// for replication volume.
if (test_and_clear_bit(VOLUME_TYPE_REPL, &VolumeExtension->Flag)) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("Replication volume:%p (%wZ) was removed\n", VolumeExtension, &VolumeExtension->MountPoint);
#else
WDRBD_INFO("Replication volume:%p was removed\n", VolumeExtension);
#endif
}
// for meta volume.
if (test_and_clear_bit(VOLUME_TYPE_META, &VolumeExtension->Flag)) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("Meta volume:%p (%wZ) was removed\n", VolumeExtension, &VolumeExtension->MountPoint);
#else
WDRBD_INFO("Meta volume:%p was removed\n", VolumeExtension);
#endif
}

FreeUnicodeString(&VolumeExtension->MountPoint);
Expand Down Expand Up @@ -518,9 +506,8 @@ mvolUpdateMountPointInfoByExtension(PVOLUME_EXTENSION pvext)
.Length = p->SymbolicLinkNameLength,
.MaximumLength = p->SymbolicLinkNameLength,
.Buffer = (PWCH)(otbuf + p->SymbolicLinkNameOffset) };
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("SymbolicLink num:%d %wZ\n",i,name);
#endif

WDRBD_INFO("SymbolicLink num:%d %wZ\n",i,&name);

if (MOUNTMGR_IS_DRIVE_LETTER(&name)) {

Expand Down
34 changes: 2 additions & 32 deletions wdrbd9/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ NTSTATUS FsctlFlushDismountVolume(unsigned int minor, bool bFlush)
// DW-1303 No dismount for already dismounted volume
if(pvext->PhysicalDeviceObject && pvext->PhysicalDeviceObject->Vpb) {
if( !(pvext->PhysicalDeviceObject->Vpb->Flags & VPB_MOUNTED) ) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("no dismount. volume(%wZ) already dismounted\n", &device_name);
#else
WDRBD_INFO("no dismount. volume already dismounted\n");
#endif
return STATUS_SUCCESS;
}
}
Expand Down Expand Up @@ -178,11 +174,7 @@ NTSTATUS FsctlFlushDismountVolume(unsigned int minor, bool bFlush)
WDRBD_INFO("ZwFsControlFile FSCTL_DISMOUNT_VOLUME Failed. status(0x%x)\n", status);
__leave;
}
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("volume(%wZ) dismounted\n", &device_name);
#else
WDRBD_INFO("volume dismounted\n");
#endif
}
__finally
{
Expand Down Expand Up @@ -228,11 +220,7 @@ NTSTATUS FsctlLockVolume(unsigned int minor)
// DW-1303 No lock for already dismounted volume
if(pvext->PhysicalDeviceObject && pvext->PhysicalDeviceObject->Vpb) {
if (!(pvext->PhysicalDeviceObject->Vpb->Flags & VPB_MOUNTED)) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_INFO("no lock. volume(%wZ) already dismounted\n", &device_name);
#else
WDRBD_INFO("no lock. volume already dismounted\n");
#endif
return STATUS_UNSUCCESSFUL;
}
}
Expand Down Expand Up @@ -278,11 +266,9 @@ NTSTATUS FsctlLockVolume(unsigned int minor)

pvext->LockHandle = hFile;
hFile = NULL;
#if WINVER != _WIN32_WINNT_WS08

WDRBD_INFO("volume(%wZ) locked. handle(0x%p)\n", &device_name, pvext->LockHandle);
#else
WDRBD_INFO("volume locked. handle(0x%p)\n", pvext->LockHandle);
#endif

}
__finally
{
Expand Down Expand Up @@ -1172,11 +1158,7 @@ NTSTATUS QueryMountPoint(
0); // no EA buffer size...
if (!NT_SUCCESS(status) ||
!NT_SUCCESS(iosb.Status)) {
#if WINVER != _WIN32_WINNT_WS08
WDRBD_WARN("Unable to open %wZ, error = 0x%x\n", &mmgrObjectName, status);
#else
WDRBD_WARN("Unable to open, error = 0x%x\n", status);
#endif
return status;
}

Expand Down Expand Up @@ -1617,7 +1599,6 @@ int initRegistry(__in PUNICODE_STRING RegPath_unicode)
{
RtlCopyMemory(g_ver, "DRBD", 4 * 2);
}
#if WINVER != _WIN32_WINNT_WS08
// _WIN32_V9: proc_details is removed.
WDRBD_INFO("registry_path[%wZ]\n"
"bypass_level=%d, read_filter=%d, use_volume_lock=%d, "
Expand All @@ -1630,17 +1611,6 @@ int initRegistry(__in PUNICODE_STRING RegPath_unicode)
g_daemon_tcp_port,
g_ver
);
#else
WDRBD_INFO("bypass_level=%d, read_filter=%d, use_volume_lock=%d, "
"netlink_tcp_port=%d, daemon_tcp_port=%d, ver=%ws\n",
g_bypass_level,
g_read_filter,
g_use_volume_lock,
g_netlink_tcp_port,
g_daemon_tcp_port,
g_ver
);
#endif

return 0;
}
Expand Down

0 comments on commit 35e5c70

Please sign in to comment.