pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


Mount-DiskImage experiments
Posted by Anonymous on Sat 16th Aug 2025 13:43
raw | new post
modification of post by Anonymous (view diff)

  1. # ---- snip ----
  2. # $ powershell -Command 'Mount-DiskImage -ImagePath "\\10.49.202.230@2049\nfs4\xfstestfs001\test2\vhdtest\v2.img"'
  3. # Mount-DiskImage : Der angeforderte Vorgang konnte aufgrund einer Dateisystemeinschränkung nicht abgeschlossen werden.
  4. # In Zeile:1 Zeichen:1
  5. # + Mount-DiskImage -ImagePath L:\download\debian-12.4.0-amd64-DVD-1.iso
  6. # + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #     + CategoryInfo          : NotSpecified: (MSFT_DiskImage:ROOT/Microsoft/.../MSFT_DiskImage) [Mount-DiskImage], CimException
  8. #     + FullyQualifiedErrorId : HRESULT 0x80070299,Mount-DiskImage
  9. # ---- snip ----
  10.  
  11. diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
  12. index 2556c87..925f537 100644
  13. --- a/daemon/fileinfoutil.c
  14. +++ b/daemon/fileinfoutil.c
  15. @@ -221,7 +221,7 @@ void nfs_to_remote_protocol_info(
  16.  
  17.      rpi_out->StructureVersion = 4;
  18.      rpi_out->StructureSize = sizeof(FILE_REMOTE_PROTOCOL_INFORMATION);
  19. -    rpi_out->Protocol = WNNC_NET_RDR2SAMPLE; /* FIXME! */
  20. +    rpi_out->Protocol = WNNC_NET_SMB; // WNNC_NET_RDR2SAMPLE; /* FIXME! */
  21.  
  22.      /* ToDo: Add pNFS info */
  23.      rpi_out->ProtocolMajorVersion = 4;
  24. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  25. index eb8a938..92cfeac 100644
  26. --- a/daemon/nfs41_superblock.c
  27. +++ b/daemon/nfs41_superblock.c
  28. @@ -194,6 +194,7 @@ void nfs41_superblock_fs_attributes(
  29.      FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_SPARSE_FILES;
  30.      /* NFSv4 protocol uses Unicode by default */
  31.      FsAttrs->FileSystemAttributes |= FILE_UNICODE_ON_DISK;
  32. +    FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_OBJECT_IDS;
  33.  
  34.      /* We support |FileCaseSensitiveInformation| to query each dir */
  35.      FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_CASE_SENSITIVE_DIRS;
  36. @@ -218,8 +219,8 @@ void nfs41_superblock_fs_attributes(
  37.  
  38.      /* let the driver fill in FileSystemName */
  39.  #if ((NFS41_DRIVER_DEBUG_FS_NAME) == 1)
  40. -    (void)wcscpy(FsAttrs->FileSystemName, L"NFS");
  41. -    FsAttrs->FileSystemNameLength = 3*sizeof(wchar_t);
  42. +    (void)wcscpy(FsAttrs->FileSystemName, L"NTFS");
  43. +    FsAttrs->FileSystemNameLength = 4*sizeof(wchar_t);
  44.  #elif  ((NFS41_DRIVER_DEBUG_FS_NAME) == 2)
  45.      (void)wcscpy(FsAttrs->FileSystemName, L"DEBUG-NFS41");
  46.      FsAttrs->FileSystemNameLength = 11*sizeof(wchar_t);
  47. diff --git a/daemon/volume.c b/daemon/volume.c
  48. index dbb2431..e836d74 100644
  49. --- a/daemon/volume.c
  50. +++ b/daemon/volume.c
  51. @@ -36,7 +36,7 @@
  52.  /* windows volume queries want size in 'units', so we have to
  53.   * convert the nfs space_* attributes from bytes to units */
  54.  #define SECTORS_PER_UNIT    8
  55. -#define BYTES_PER_SECTOR    1024
  56. +#define BYTES_PER_SECTOR    512
  57.  #define BYTES_PER_UNIT      (SECTORS_PER_UNIT * BYTES_PER_SECTOR)
  58.  
  59.  #define TO_UNITS(bytes) (bytes / BYTES_PER_UNIT)
  60. diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
  61. index c1a3f2b..972792c 100644
  62. --- a/sys/nfs41sys_fsctl.c
  63. +++ b/sys/nfs41sys_fsctl.c
  64. @@ -895,6 +895,24 @@ NTSTATUS nfs41_FsCtl(
  65.      case FSCTL_DUPLICATE_EXTENTS_TO_FILE:
  66.          status = nfs41_DuplicateData(RxContext);
  67.          break;
  68. +    case FSCTL_CREATE_OR_GET_OBJECT_ID:
  69. +    case FSCTL_GET_OBJECT_ID:
  70. +        __notnull XXCTL_LOWIO_COMPONENT *FsCtl =
  71. +            &RxContext->LowIoContext.ParamsFor.FsCtl;
  72. +        __notnull PNFS41_FCB nfs41_fcb = NFS41GetFcbExtension(RxContext->pFcb);
  73. +        __notnull PFILE_OBJECTID_BUFFER objidbuf =
  74. +            (PFILE_OBJECTID_BUFFER)FsCtl->pOutputBuffer;
  75. +        if (objidbuf) {
  76. +            ULONGLONG xor_fsid = nfs41_fcb->fsid_major ^ nfs41_fcb->fsid_minor;
  77. +            (void)memset(objidbuf, 0, sizeof(FILE_OBJECTID_BUFFER));
  78. +            (void)memcpy(&objidbuf->ObjectId[0], &nfs41_fcb->fileid, sizeof(ULONGLONG));
  79. +            (void)memcpy(&objidbuf->ObjectId[8], &xor_fsid, sizeof(ULONGLONG));
  80. +            status = STATUS_SUCCESS;
  81. +        }
  82. +        else {
  83. +            status = STATUS_INVALID_USER_BUFFER;
  84. +        }
  85. +        break;
  86.      default:
  87.          break;
  88.      }
  89. diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
  90. index e663d0b..9919556 100644
  91. --- a/sys/nfs41sys_volinfo.c
  92. +++ b/sys/nfs41sys_volinfo.c
  93. @@ -182,6 +182,26 @@ NTSTATUS nfs41_QueryVolumeInformation(
  94.          status = STATUS_SUCCESS;
  95.          goto out;
  96.      }
  97. +    case FileFsObjectIdInformation:
  98. +    {
  99. +        PFILE_FS_OBJECTID_INFORMATION pObjIdInfo = RxContext->Info.Buffer;
  100. +
  101. +        SizeUsed = sizeof(FILE_FS_OBJECTID_INFORMATION);
  102. +        if (RemainingLength < SizeUsed) {
  103. +            status = STATUS_BUFFER_TOO_SMALL;
  104. +            RxContext->InformationToReturn = SizeUsed;
  105. +            goto out;
  106. +        }
  107. +
  108. +        (void)memset(pObjIdInfo, 0, sizeof(FILE_FS_OBJECTID_INFORMATION));
  109. +        const ULONGLONG nfs41GUID = 0xDEADBEEF;
  110. +        (void)memcpy(&pObjIdInfo->ObjectId[0], &nfs41GUID, sizeof(ULONGLONG));
  111. +
  112. +        RxContext->Info.LengthRemaining -= SizeUsed;
  113. +        status = STATUS_SUCCESS;
  114. +        goto out;
  115. +    }
  116. +
  117.  
  118.      case FileFsAttributeInformation:
  119.      case FileFsSizeInformation:

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at