pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch for rejecting OPLOCK open, tests, misc, 2024-10-07
Posted by Anonymous on Mon 7th Oct 2024 14:37
raw | new post

  1. From af4287695d5ea6c0c339cdef7804baa2f7e06a3e Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 7 Oct 2024 11:44:13 +0200
  4. Subject: [PATCH 1/6] sys: More prefix debug output
  5.  %x-->0x%x,%p-->0x%p,%o-->0%o,NTSTATUS-->0x%x
  6.  
  7. More prefix debug output %x-->0x%x,%p-->0x%p,%o-->0%o,NTSTATUS-->0x%x
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. sys/nfs41_debug.c  | 170 +++++++++++++++++++++++++--------------------
  12.  sys/nfs41_driver.c |  29 ++++----
  13.  2 files changed, 109 insertions(+), 90 deletions(-)
  14.  
  15. diff --git a/sys/nfs41_debug.c b/sys/nfs41_debug.c
  16. index d169611..9aca146 100644
  17. --- a/sys/nfs41_debug.c
  18. +++ b/sys/nfs41_debug.c
  19. @@ -3,6 +3,7 @@
  20.   *
  21.   * Olga Kornievskaia <aglo@umich.edu>
  22.   * Casey Bodley <cbodley@umich.edu>
  23. + * Roland Mainz <roland.mainz@nrubsig.org>
  24.   *
  25.   * This library is free software; you can redistribute it and/or modify it
  26.   * under the terms of the GNU Lesser General Public License as published by
  27. @@ -50,8 +51,8 @@ ULONG __cdecl DbgP(IN PCCH fmt, ...)
  28.          RtlTimeToTimeFields(&local_time, &time_fields);
  29.  
  30.          DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
  31. -            "[%ld].[%02u:%02u:%02u.%u] %s", IoGetCurrentProcess(),
  32. -            time_fields.Hour, time_fields.Minute, time_fields.Second,
  33. +            "[%ld].[%02u:%02u:%02u.%u] %s", IoGetCurrentProcess(),
  34. +            time_fields.Hour, time_fields.Minute, time_fields.Second,
  35.              time_fields.Milliseconds, msg);
  36.  #else
  37.          DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
  38. @@ -191,7 +192,8 @@ void print_driver_state(int state)
  39.  void print_basic_info(int on, PFILE_BASIC_INFORMATION info)
  40.  {
  41.      if (!on) return;
  42. -    DbgP("BASIC_INFO: Create=%lx Access=%lx Write=%lx Change=%lx Attr=%x\n",
  43. +    DbgP("BASIC_INFO: "
  44. +        "Create=0x%lx Access=0x%lx Write=0x%lx Change=0x%lx Attr=0x%x\n",
  45.          info->CreationTime.QuadPart, info->LastAccessTime.QuadPart,
  46.          info->LastWriteTime.QuadPart, info->ChangeTime.QuadPart,
  47.          info->FileAttributes);
  48. @@ -199,7 +201,8 @@ void print_basic_info(int on, PFILE_BASIC_INFORMATION info)
  49.  void print_std_info(int on, PFILE_STANDARD_INFORMATION info)
  50.  {
  51.      if (!on) return;
  52. -    DbgP("STD_INFO: Type=%s #Links=%d Alloc=%lx EOF=%lx Delete=%d\n",
  53. +    DbgP("STD_INFO: "
  54. +        "Type='%s' #Links=%d Alloc=0x%lx EOF=0x%lx Delete=%d\n",
  55.          info->Directory?"DIR":"FILE", info->NumberOfLinks,
  56.          info->AllocationSize.QuadPart, info->EndOfFile.QuadPart,
  57.          info->DeletePending);
  58. @@ -207,8 +210,9 @@ void print_std_info(int on, PFILE_STANDARD_INFORMATION info)
  59.  
  60.  void print_ea_info(PFILE_FULL_EA_INFORMATION info)
  61.  {
  62. -    DbgP("FULL_EA_INFO: NextOffset=%d Flags=%x EaNameLength=%d "
  63. -        "ExValueLength=%x EaName=%s\n", info->NextEntryOffset, info->Flags,
  64. +    DbgP("FULL_EA_INFO: NextOffset=%d Flags=0x%x EaNameLength=%d "
  65. +        "ExValueLength=0x%x EaName='%s'\n",
  66. +        info->NextEntryOffset, info->Flags,
  67.          info->EaNameLength, info->EaValueLength, info->EaName);
  68.  #if DEBUG_EAINFO_DETAILS
  69.      if (info->EaValueLength)
  70. @@ -221,22 +225,23 @@ void print_ea_info(PFILE_FULL_EA_INFORMATION info)
  71.  void print_get_ea(int on, PFILE_GET_EA_INFORMATION info)
  72.  {
  73.      if (!on || !info) return;
  74. -    DbgP("GET_EA_INFO: NextOffset=%d EaNameLength=%d EaName=%s\n",
  75. +    DbgP("GET_EA_INFO: NextOffset=%d EaNameLength=%d EaName='%s'\n",
  76.          info->NextEntryOffset, info->EaNameLength, info->EaName);
  77.  }
  78.  
  79.  VOID print_srv_call(IN PMRX_SRV_CALL p)
  80.  {
  81. -    DbgP("PMRX_SRV_CALL %p\n", p);
  82. +    DbgP("PMRX_SRV_CALL 0x%p\n", p);
  83.  #if 0
  84.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  85. -    //DbgP("Context %p\n", p->Context);
  86. -    //DbgP("Context2 %p\n", p->Context2);
  87. -    //DbgP("pSrvCallName %wZ\n", p->pSrvCallName);
  88. -    //DbgP("pPrincipalName %wZ\n", p->pPrincipalName);
  89. -    //DbgP("PDomainName %wZ\n", p->pDomainName);
  90. +    //DbgP("Context 0x%p\n", p->Context);
  91. +    //DbgP("Context2 0x%p\n", p->Context2);
  92. +    //DbgP("pSrvCallName '%wZ'\n", p->pSrvCallName);
  93. +    //DbgP("pPrincipalName '%wZ'\n", p->pPrincipalName);
  94. +    //DbgP("PDomainName '%wZ'\n", p->pDomainName);
  95.      //DbgP("Flags %08lx\n", p->Flags);
  96. -    //DbgP("MaximumNumberOfCloseDelayedFiles %ld\n", p->MaximumNumberOfCloseDelayedFiles);
  97. +    //DbgP("MaximumNumberOfCloseDelayedFiles %ld\n",
  98. +    //    p->MaximumNumberOfCloseDelayedFiles);
  99.      //DbgP("Status %ld\n", p->Status);
  100.      DbgP("*****************\n");
  101.  #endif
  102. @@ -244,41 +249,41 @@ VOID print_srv_call(IN PMRX_SRV_CALL p)
  103.  
  104.  VOID print_net_root(IN PMRX_NET_ROOT p)
  105.  {
  106. -    DbgP("PMRX_NET_ROOT %p\n", p);
  107. +    DbgP("PMRX_NET_ROOT 0x%p\n", p);
  108.  #if 0
  109.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  110. -    DbgP("\tpSrvCall %p\n", p->pSrvCall);
  111. -    //DbgP("Context %p\n", p->Context);
  112. -    //DbgP("Context2 %p\n", p->Context2);
  113. -    //DbgP("Flags %08lx\n", p->Flags);
  114. +    DbgP("\tpSrvCall 0x%p\n", p->pSrvCall);
  115. +    //DbgP("Context 0x%p\n", p->Context);
  116. +    //DbgP("Context2 0x%p\n", p->Context2);
  117. +    //DbgP("Flags 0x%08lx\n", p->Flags);
  118.      DbgP("\tNumberOfFcbs %ld\n", p->NumberOfFcbs);
  119.      DbgP("\tNumberofSrvOpens %ld\n", p->NumberOfSrvOpens);
  120.      //DbgP("MRxNetRootState %ld\n", p->MRxNetRootState);
  121.      //DbgP("Type %ld\n", p->Type);
  122.      //DbgP("DeviceType %ld\n", p->DeviceType);
  123. -    //DbgP("pNetRootName %wZ\n", p->pNetRootName);
  124. -    //DbgP("InnerNamePrefix %wZ\n", &p->InnerNamePrefix);
  125. +    //DbgP("pNetRootName '%wZ'\n", p->pNetRootName);
  126. +    //DbgP("InnerNamePrefix '%wZ'\n", &p->InnerNamePrefix);
  127.      DbgP("*****************\n");
  128.  #endif
  129.  }
  130.  
  131.  VOID print_v_net_root(IN PMRX_V_NET_ROOT p)
  132.  {
  133. -    DbgP("PMRX_V_NET_ROOT %p\n", p);
  134. +    DbgP("PMRX_V_NET_ROOT 0x%p\n", p);
  135.  #if 0
  136.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  137. -    DbgP("\tpNetRoot %p\n", p->pNetRoot);
  138. -    //DbgP("Context %p\n", p->Context);
  139. -    //DbgP("Context2 %p\n", p->Context2);
  140. -    //DbgP("Flags %08lx\n", p->Flags);
  141. +    DbgP("\tpNetRoot 0x%p\n", p->pNetRoot);
  142. +    //DbgP("Context 0x%p\n", p->Context);
  143. +    //DbgP("Context2 0x%p\n", p->Context2);
  144. +    //DbgP("Flags 0x%08lx\n", p->Flags);
  145.      DbgP("\tNumberofOpens %ld\n", p->NumberOfOpens);
  146.      DbgP("\tNumberofFobxs %ld\n", p->NumberOfFobxs);
  147.      //DbgP("LogonId\n");
  148. -    //DbgP("pUserDomainName %wZ\n", p->pUserDomainName);
  149. -    //DbgP("pUserName %wZ\n", p->pUserName);
  150. -    //DbgP("pPassword %wZ\n", p->pPassword);
  151. +    //DbgP("pUserDomainName '%wZ'\n", p->pUserDomainName);
  152. +    //DbgP("pUserName '%wZ'\n", p->pUserName);
  153. +    //DbgP("pPassword '%wZ'\n", p->pPassword);
  154.      //DbgP("SessionId %ld\n", p->SessionId);
  155. -    //DbgP("ConstructionStatus %08lx\n", p->ConstructionStatus);
  156. +    //DbgP("ConstructionStatus 0x%08lx\n", p->ConstructionStatus);
  157.      //DbgP("IsExplicitConnection %d\n", p->IsExplicitConnection);
  158.      DbgP("*****************\n");
  159.  #endif
  160. @@ -287,18 +292,20 @@ VOID print_v_net_root(IN PMRX_V_NET_ROOT p)
  161.  void print_file_object(int on, PFILE_OBJECT file)
  162.  {
  163.      if (!on) return;  
  164. -    DbgP("FsContext %p FsContext2 %p\n", file->FsContext, file->FsContext2);
  165. +    DbgP("FsContext 0x%p FsContext2 0x%p\n",
  166. +        file->FsContext, file->FsContext2);
  167.      DbgP("DeletePending %d ReadAccess %d WriteAccess %d DeleteAccess %d\n",
  168.          file->DeletePending, file->WriteAccess, file->DeleteAccess);
  169. -    DbgP("SharedRead %d SharedWrite %d SharedDelete %d Flags %x\n",
  170. -        file->SharedRead, file->SharedWrite, file->SharedDelete, file->Flags);
  171. +    DbgP("SharedRead %d SharedWrite %d SharedDelete %d Flags 0x%x\n",
  172. +        file->SharedRead, file->SharedWrite, file->SharedDelete,
  173. +        file->Flags);
  174.  }
  175.  
  176.  void print_fo_all(int on, PRX_CONTEXT c)
  177.  {
  178.      if (!on) return;
  179.      if (c->pFcb && c->pRelevantSrvOpen)
  180. -        DbgP("OpenCount %d FCB %p SRV %p FOBX %p VNET %p NET %p\n",
  181. +        DbgP("OpenCount %d FCB 0x%p SRV 0x%p FOBX 0x%p VNET 0x%p NET 0x%p\n",
  182.              c->pFcb->OpenCount, c->pFcb, c->pRelevantSrvOpen, c->pFobx,
  183.              c->pRelevantSrvOpen->pVNetRoot, c->pFcb->pNetRoot);
  184.  }
  185. @@ -306,17 +313,18 @@ void print_fo_all(int on, PRX_CONTEXT c)
  186.  VOID print_fcb(int on, IN PMRX_FCB p)
  187.  {
  188.      if (!on) return;
  189. -    DbgP("PMRX_FCB %p OpenCount %d\n", p, p->OpenCount);
  190. +    DbgP("PMRX_FCB 0x%p OpenCount %d\n", p, p->OpenCount);
  191.  #if 0
  192.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  193. -    DbgP("\tpNetRoot %p\n", p->pNetRoot);
  194. -    //DbgP("Context %p\n", p->Context);
  195. -    //DbgP("Context2 %p\n", p->Context2);
  196. +    DbgP("\tpNetRoot 0x%p\n", p->pNetRoot);
  197. +    //DbgP("Context 0x%p\n", p->Context);
  198. +    //DbgP("Context2 0x%p\n", p->Context2);
  199.      //DbgP("FcbState %ld\n", p->FcbState);
  200.      //DbgP("UncleanCount %ld\n", p->UncleanCount);
  201.      //DbgP("UncachedUncleanCount %ld\n", p->UncachedUncleanCount);
  202.      DbgP("\tOpenCount %ld\n", p->OpenCount);
  203. -    //DbgP("OutstandingLockOperationsCount %ld\n", p->OutstandingLockOperationsCount);
  204. +    //DbgP("OutstandingLockOperationsCount %ld\n",
  205. +    //    p->OutstandingLockOperationsCount);
  206.      //DbgP("ActualAllocationLength %ull\n", p->ActualAllocationLength);
  207.      //DbgP("Attributes %ld\n", p->Attributes);
  208.      //DbgP("IsFileWritten %d\n", p->IsFileWritten);
  209. @@ -332,18 +340,18 @@ VOID print_fcb(int on, IN PMRX_FCB p)
  210.  VOID print_srv_open(int on, IN PMRX_SRV_OPEN p)
  211.  {
  212.      if (!on) return;
  213. -    DbgP("PMRX_SRV_OPEN %p\n", p);
  214. +    DbgP("PMRX_SRV_OPEN 0x%p\n", p);
  215.  #if 0
  216.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  217. -    DbgP("\tpFcb %p\n", p->pFcb);
  218. -    DbgP("\tpVNetRoot %p\n", p->pVNetRoot);
  219. -    //DbgP("Context %p\n", p->Context);
  220. -    //DbgP("Context2 %p\n", p->Context2);
  221. -    //DbgP("Flags %08lx\n", p->Flags);
  222. -    //DbgP("pAlreadyPrefixedName %wZ\n", p->pAlreadyPrefixedName);
  223. +    DbgP("\tpFcb 0x%p\n", p->pFcb);
  224. +    DbgP("\tpVNetRoot 0x%p\n", p->pVNetRoot);
  225. +    //DbgP("Context 0x%p\n", p->Context);
  226. +    //DbgP("Context2 0x%p\n", p->Context2);
  227. +    //DbgP("Flags 0x%08lx\n", p->Flags);
  228. +    //DbgP("pAlreadyPrefixedName '%wZ'\n", p->pAlreadyPrefixedName);
  229.      //DbgP("UncleanFobxCount %ld\n", p->UncleanFobxCount);
  230.      DbgP("\tOpenCount %ld\n", p->OpenCount);
  231. -    //DbgP("Key %p\n", p->Key);
  232. +    //DbgP("Key 0x%p\n", p->Key);
  233.      //DbgP("DesiredAccess\n");
  234.      //DbgP("ShareAccess %ld\n", p->ShareAccess);
  235.      //DbgP("CreateOptions %ld\n", p->CreateOptions);
  236. @@ -357,14 +365,14 @@ VOID print_srv_open(int on, IN PMRX_SRV_OPEN p)
  237.  VOID print_fobx(int on, IN PMRX_FOBX p)
  238.  {
  239.      if (!on) return;
  240. -    DbgP("PMRX_FOBX %p\n", p);
  241. +    DbgP("PMRX_FOBX 0x%p\n", p);
  242.  #if 0
  243.      DbgP("\tNodeReferenceCount %ld\n", p->NodeReferenceCount);
  244. -    DbgP("\tpSrvOpen %p\n", p->pSrvOpen);
  245. -    DbgP("\tAssociatedFileObject %p\n", p->AssociatedFileObject);
  246. -    //DbgP("Context %p\n", p->Context);
  247. -    //DbgP("Context2 %p\n", p->Context2);
  248. -    //DbgP("Flags %08lx\n", p->Flags);
  249. +    DbgP("\tpSrvOpen 0x%p\n", p->pSrvOpen);
  250. +    DbgP("\tAssociatedFileObject 0x%p\n", p->AssociatedFileObject);
  251. +    //DbgP("Context 0x%p\n", p->Context);
  252. +    //DbgP("Context2 0x%p\n", p->Context2);
  253. +    //DbgP("Flags 0x%08lx\n", p->Flags);
  254.      DbgP("*****************\n");
  255.  #endif
  256.  }
  257. @@ -373,7 +381,11 @@ VOID print_irp_flags(int on, PIRP irp)
  258.  {
  259.      if (!on) return;
  260.      if (irp->Flags)
  261. -        DbgP("IRP FLAGS: 0x%x %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n",
  262. +        DbgP("IRP FLAGS: "
  263. +            "0x%x "
  264. +            "'%s' '%s' '%s' '%s' "
  265. +            "'%s' '%s' '%s' '%s' "
  266. +            "'%s' '%s' '%s' '%s' '%s' '%s'\n",
  267.              irp->Flags,
  268.              (irp->Flags & IRP_NOCACHE)?"NOCACHE":"",
  269.              (irp->Flags & IRP_PAGING_IO)?"PAGING_IO":"",
  270. @@ -395,7 +407,7 @@ void print_irps_flags(int on, PIO_STACK_LOCATION irps)
  271.  {
  272.      if (!on) return;
  273.      if (irps->Flags)
  274. -        DbgP("IRPSP FLAGS 0x%x %s %s %s %s\n", irps->Flags,
  275. +        DbgP("IRPSP FLAGS 0x%x '%s' '%s' '%s' '%s'\n", irps->Flags,
  276.              (irps->Flags & SL_CASE_SENSITIVE)?"CASE_SENSITIVE":"",
  277.              (irps->Flags & SL_OPEN_PAGING_FILE)?"PAGING_FILE":"",
  278.              (irps->Flags & SL_FORCE_ACCESS_CHECK)?"ACCESS_CHECK":"",
  279. @@ -405,7 +417,9 @@ void print_nt_create_params(int on, NT_CREATE_PARAMETERS params)
  280.  {
  281.      if (!on) return;
  282.      if (params.FileAttributes)
  283. -        DbgP("File attributes %x: %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n",
  284. +        DbgP("File attributes 0x%x: "
  285. +            "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' "
  286. +            "'%s' '%s' '%s' '%s' '%s'\n",
  287.              params.FileAttributes,
  288.              (params.FileAttributes & FILE_ATTRIBUTE_TEMPORARY)?"TEMPFILE ":"",
  289.              (params.FileAttributes & FILE_ATTRIBUTE_READONLY)?"READONLY ":"",
  290. @@ -435,8 +449,11 @@ void print_nt_create_params(int on, NT_CREATE_PARAMETERS params)
  291.      if (params.Disposition == FILE_OVERWRITE_IF)
  292.          DbgP("Create Dispositions: FILE_OVERWRITE_IF\n");
  293.  
  294. -    DbgP("Create Attributes: 0x%x %s %s %s %s %s %s %s %s %s %s %s %s %s %s "
  295. -        "%s %s\n", params.CreateOptions,
  296. +    DbgP("Create Attributes: "
  297. +        "0x%x "
  298. +        "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' "
  299. +        "'%s' '%s' '%s' '%s' '%s' '%s' '%s'\n",
  300. +        params.CreateOptions,
  301.          (params.CreateOptions & FILE_DIRECTORY_FILE)?"DIRFILE":"",
  302.          (params.CreateOptions & FILE_NON_DIRECTORY_FILE)?"FILE":"",
  303.          (params.CreateOptions & FILE_DELETE_ON_CLOSE)?"DELETE_ON_CLOSE":"",
  304. @@ -454,12 +471,13 @@ void print_nt_create_params(int on, NT_CREATE_PARAMETERS params)
  305.          (params.CreateOptions & FILE_OPEN_FOR_BACKUP_INTENT)?"4_BACKUP":"",
  306.          (params.CreateOptions & FILE_RESERVE_OPFILTER)?"OPFILTER":"");
  307.  
  308. -    DbgP("Share Access: %s %s %s\n",
  309. +    DbgP("Share Access: '%s' '%s' '%s'\n",
  310.          (params.ShareAccess & FILE_SHARE_READ)?"READ":"",
  311.          (params.ShareAccess & FILE_SHARE_WRITE)?"WRITE":"",
  312.          (params.ShareAccess & FILE_SHARE_DELETE)?"DELETE":"");
  313.  
  314. -    DbgP("Desired Access: 0x%x %s %s %s %s %s %s %s %s %s %s %s\n",
  315. +    DbgP("Desired Access: "
  316. +        "0x%x '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'\n",
  317.          params.DesiredAccess,
  318.          (params.DesiredAccess & FILE_READ_DATA)?"READ":"",
  319.          (params.DesiredAccess & STANDARD_RIGHTS_READ)?"READ_ACL":"",
  320. @@ -568,18 +586,18 @@ void print_caching_level(int on, ULONG flag, PUNICODE_STRING name)
  321.  {
  322.      if (!on) return;
  323.      switch(flag) {
  324. -        case 0:
  325. -            DbgP("enable_caching: DISABLE_CACHING %wZ\n", name);
  326. +        case 0:
  327. +            DbgP("enable_caching: DISABLE_CACHING '%wZ'\n", name);
  328.              break;
  329.          case 1:
  330. -            DbgP("enable_caching: ENABLE_READ_CACHING %wZ\n", name);
  331. +            DbgP("enable_caching: ENABLE_READ_CACHING '%wZ'\n", name);
  332.              break;
  333.          case 2:
  334. -            DbgP("enable_caching: ENABLE_WRITE_CACHING %wZ\n", name);
  335. +            DbgP("enable_caching: ENABLE_WRITE_CACHING '%wZ'\n", name);
  336.              break;
  337.          case 3:
  338. -            DbgP("enable_caching: ENABLE_READWRITE_CACHING %wZ\n", name);
  339. -            break;  
  340. +            DbgP("enable_caching: ENABLE_READWRITE_CACHING '%wZ'\n", name);
  341. +            break;
  342.      }
  343.  }
  344.  
  345. @@ -611,7 +629,7 @@ const char *opcode2string(int opcode)
  346.  void print_acl_args(
  347.      SECURITY_INFORMATION info)
  348.  {
  349. -    DbgP("Security query: %s %s %s\n",
  350. +    DbgP("Security query: '%s' '%s' '%s'\n",
  351.          (info & OWNER_SECURITY_INFORMATION)?"OWNER":"",
  352.          (info & GROUP_SECURITY_INFORMATION)?"GROUP":"",
  353.          (info & DACL_SECURITY_INFORMATION)?"DACL":"",
  354. @@ -670,26 +688,26 @@ void print_open_error(int on, int status)
  355.      }
  356.  }
  357.  
  358. -void print_wait_status(int on, const char *prefix, NTSTATUS status,
  359. -                       const char *opcode, PVOID entry, LONGLONG xid)
  360. +void print_wait_status(int on, const char *prefix, NTSTATUS status,
  361. +    const char *opcode, PVOID entry, LONGLONG xid)
  362.  {
  363.      if (!on) return;
  364.      switch (status) {
  365.      case STATUS_SUCCESS:
  366.          if (opcode)
  367. -            DbgP("%s Got a wakeup call, finishing %s entry=%p xid=%lld\n",
  368. +            DbgP("'%s' Got a wakeup call, finishing '%s' entry=0x%p xid=%lld\n",
  369.                  prefix, opcode, entry, xid);
  370.          else
  371. -            DbgP("%s Got a wakeup call\n", prefix);
  372. +            DbgP("'%s' Got a wakeup call\n", prefix);
  373.          break;
  374.      case STATUS_USER_APC:
  375. -        DbgP("%s KeWaitForSingleObject returned STATUS_USER_APC\n", prefix);
  376. +        DbgP("'%s' KeWaitForSingleObject returned STATUS_USER_APC\n", prefix);
  377.          break;
  378.      case STATUS_ALERTED:
  379. -        DbgP("%s KeWaitForSingleObject returned STATUS_ALERTED\n", prefix);
  380. +        DbgP("'%s' KeWaitForSingleObject returned STATUS_ALERTED\n", prefix);
  381.          break;
  382.      default:
  383. -        DbgP("%s KeWaitForSingleObject returned %d\n", prefix, status);
  384. +        DbgP("'%s' KeWaitForSingleObject returned %d\n", prefix, status);
  385.      }
  386.  }
  387.  /* This is taken from toaster/func.  Rumor says this should be replaced
  388. @@ -722,9 +740,9 @@ dprintk(
  389.  
  390.          if (!NT_SUCCESS(status))
  391.              rv = DbgPrintEx(PNFS_FLTR_ID, DPFLTR_MASK | flags,
  392. -                            "RtlStringCbVPrintfA failed %x \n", status);
  393. +                            "RtlStringCbVPrintfA failed 0x%x \n", status);
  394.          else
  395. -            rv = DbgPrintEx(PNFS_FLTR_ID, DPFLTR_MASK | flags, "%s    %s: %s\n",
  396. +            rv = DbgPrintEx(PNFS_FLTR_ID, DPFLTR_MASK | flags, "'%s'    '%s': '%s'\n",
  397.                      PNFS_TRACE_TAG, func, debugMessageBuffer);
  398.      }
  399.      va_end(list);
  400. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  401. index 1214fa8..aad56bf 100644
  402. --- a/sys/nfs41_driver.c
  403. +++ b/sys/nfs41_driver.c
  404. @@ -968,9 +968,10 @@ static NTSTATUS marshal_nfs41_lock(
  405.      *len = header_len;
  406.  
  407.  #ifdef DEBUG_MARSHAL_DETAIL
  408. -    DbgP("marshal_nfs41_lock: offset=%llx length=%llx exclusive=%u "
  409. -         "blocking=%u\n", entry->u.Lock.offset, entry->u.Lock.length,
  410. -         entry->u.Lock.exclusive, entry->u.Lock.blocking);
  411. +    DbgP("marshal_nfs41_lock: "
  412. +        "offset=0x%llx length=0x%llx exclusive=%u "
  413. +        "blocking=%u\n", entry->u.Lock.offset, entry->u.Lock.length,
  414. +        entry->u.Lock.exclusive, entry->u.Lock.blocking);
  415.  #endif
  416.  out:
  417.      return status;
  418. @@ -2686,7 +2687,7 @@ static NTSTATUS nfs41_DevFcbXXXControlFile(
  419.                      status = STATUS_SUCCESS;
  420.                  } else if (status == STATUS_PENDING &&
  421.                              RxContext->PostRequest == TRUE) {
  422. -                    DbgP("RxStartMinirdr pending %08lx\n", status);
  423. +                    DbgP("RxStartMinirdr pending 0x%08lx\n", status);
  424.                      status = STATUS_MORE_PROCESSING_REQUIRED;
  425.                  }
  426.                  break;
  427. @@ -2713,7 +2714,7 @@ static NTSTATUS nfs41_DevFcbXXXControlFile(
  428.                          NFS41_START_DRIVER_STARTED);
  429.  
  430.              status = RxStopMinirdr(RxContext, &RxContext->PostRequest);
  431. -            DbgP("RxStopMinirdr status %08lx\n", status);
  432. +            DbgP("RxStopMinirdr status 0x%08lx\n", status);
  433.              if (status == STATUS_PENDING && RxContext->PostRequest == TRUE )
  434.                  status = STATUS_MORE_PROCESSING_REQUIRED;
  435.              break;
  436. @@ -2806,7 +2807,7 @@ static NTSTATUS nfs41_CreateSrvCall(
  437.          status = RxDispatchToWorkerThread(nfs41_dev, DelayedWorkQueue,
  438.              _nfs41_CreateSrvCall, pCallbackContext);
  439.          if (status != STATUS_SUCCESS) {
  440. -            print_error("RxDispatchToWorkerThread returned status %08lx\n",
  441. +            print_error("RxDispatchToWorkerThread returned status 0x%08lx\n",
  442.                  status);
  443.              pCallbackContext->Status = status;
  444.              pCallbackContext->SrvCalldownStructure->CallBack(pCallbackContext);
  445. @@ -3175,7 +3176,7 @@ static NTSTATUS nfs41_MountConfig_ParseOptions(
  446.                  if (status == STATUS_SUCCESS) {
  447.                      if (Config->createmode.mode > 0777) {
  448.                          status = STATUS_INVALID_PARAMETER;
  449. -                        print_error("mode 0o%o out of bounds\n",
  450. +                        print_error("mode 0%o out of bounds\n",
  451.                              (int)Config->createmode.mode);
  452.                      }
  453.                  }
  454. @@ -3188,7 +3189,7 @@ static NTSTATUS nfs41_MountConfig_ParseOptions(
  455.  
  456.              DbgP("nfs41_MountConfig_ParseOptions: createmode: "
  457.                  "status=0x%lx, "
  458. -                "createmode=(use_nfsv3attrsea_mode=%d, mode=0o%o\n",
  459. +                "createmode=(use_nfsv3attrsea_mode=%d, mode=0%o\n",
  460.                  (long)status,
  461.                  (int)Config->createmode.use_nfsv3attrsea_mode,
  462.                  (int)Config->createmode.mode);
  463. @@ -3605,7 +3606,7 @@ static NTSTATUS nfs41_CreateVNetRoot(
  464.          "timebasedcoherency=%d "
  465.          "timeout=%d "
  466.          "createmode.use_nfsv3attrsea_mode=%d "
  467. -        "Config->createmode.mode=0o%o "
  468. +        "Config->createmode.mode=0%o "
  469.          "}\n",
  470.          &Config->MntPt,
  471.          &Config->SrvName,
  472. @@ -4394,7 +4395,7 @@ retry_on_link:
  473.          status = RxPrepareToReparseSymbolicLink(RxContext,
  474.              entry->u.Open.symlink_embedded, &AbsPath, TRUE, &ReparseRequired);
  475.  #ifdef DEBUG_OPEN
  476. -        DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned %08lX, "
  477. +        DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned 0x%08lX, "
  478.              "FileName is '%wZ'\n", entry->u.Open.symlink_embedded,
  479.              &AbsPath, status, &RxContext->CurrentIrpSp->FileObject->FileName);
  480.  #endif
  481. @@ -5784,7 +5785,7 @@ static NTSTATUS nfs41_QuerySecurityInformation(
  482.          LARGE_INTEGER current_time;
  483.          KeQuerySystemTime(&current_time);
  484.  #ifdef DEBUG_ACL_QUERY
  485. -        DbgP("CurrentTime %lx Saved Acl time %lx\n",
  486. +        DbgP("CurrentTime 0x%lx Saved Acl time 0x%lx\n",
  487.              current_time.QuadPart, nfs41_fobx->time.QuadPart);
  488.  #endif
  489.          if (current_time.QuadPart - nfs41_fobx->time.QuadPart <= 20*1000) {        
  490. @@ -7832,7 +7833,7 @@ NTSTATUS DriverEntry(
  491.  
  492.      status = RxDriverEntry(drv, path);
  493.      if (status != STATUS_SUCCESS) {
  494. -        print_error("RxDriverEntry failed: %08lx\n", status);
  495. +        print_error("RxDriverEntry failed: 0x%08lx\n", status);
  496.          goto out;
  497.      }
  498.  
  499. @@ -7850,7 +7851,7 @@ NTSTATUS DriverEntry(
  500.                  sizeof(NFS41_DEVICE_EXTENSION),
  501.                  FILE_DEVICE_NETWORK_FILE_SYSTEM, FILE_REMOTE_DEVICE);
  502.      if (status != STATUS_SUCCESS) {
  503. -        print_error("RxRegisterMinirdr failed: %08lx\n", status);
  504. +        print_error("RxRegisterMinirdr failed: 0x%08lx\n", status);
  505.          goto out;
  506.      }
  507.      nfs41_dev->Flags |= DO_BUFFERED_IO;
  508. @@ -7867,7 +7868,7 @@ NTSTATUS DriverEntry(
  509.      DbgP("calling IoCreateSymbolicLink '%wZ' '%wZ'\n", &user_dev_name, &dev_name);
  510.      status = IoCreateSymbolicLink(&user_dev_name, &dev_name);
  511.      if (status != STATUS_SUCCESS) {
  512. -        print_error("Device name IoCreateSymbolicLink failed: %08lx\n", status);
  513. +        print_error("Device name IoCreateSymbolicLink failed: 0x%08lx\n", status);
  514.          goto out_unregister;
  515.      }
  516.  
  517. --
  518. 2.45.1
  519.  
  520. From 9b60e347107913652d25dfd23283a499150bbc9a Mon Sep 17 00:00:00 2001
  521. From: Roland Mainz <roland.mainz@nrubsig.org>
  522. Date: Mon, 7 Oct 2024 13:03:02 +0200
  523. Subject: [PATCH 2/6] daemon,include,sys: Add |FILE_OPEN_REQUIRING_OPLOCK|,
  524.  |FILE_DISALLOW_EXCLUSIVE|, |FILE_SESSION_AWARE| flags
  525.  
  526. Add |FILE_OPEN_REQUIRING_OPLOCK|, |FILE_DISALLOW_EXCLUSIVE|, and
  527. |FILE_SESSION_AWARE| flags
  528.  
  529. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  530. ---
  531. daemon/daemon_debug.c | 8 ++++++++
  532.  include/from_kernel.h | 4 ++++
  533.  sys/nfs41_debug.c     | 4 +++-
  534.  3 files changed, 15 insertions(+), 1 deletion(-)
  535.  
  536. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  537. index fb155ed..8f58414 100644
  538. --- a/daemon/daemon_debug.c
  539. +++ b/daemon/daemon_debug.c
  540. @@ -273,6 +273,14 @@ void print_create_attributes(int level, DWORD create_opts) {
  541.          fprintf(dlog_file, "OPEN_BY_FILE_ID ");
  542.      if (create_opts & FILE_OPEN_FOR_BACKUP_INTENT)
  543.          fprintf(dlog_file, "OPEN_FOR_BACKUP_INTENT ");
  544. +    if (create_opts & FILE_NO_COMPRESSION)
  545. +        fprintf(dlog_file, "NO_COMPRESSION ");
  546. +    if (create_opts & FILE_OPEN_REQUIRING_OPLOCK)
  547. +        fprintf(dlog_file, "OPEN_REQUIRING_OPLOCK ");
  548. +    if (create_opts & FILE_DISALLOW_EXCLUSIVE)
  549. +        fprintf(dlog_file, "DISALLOW_EXCLUSIVE ");
  550. +    if (create_opts & FILE_SESSION_AWARE)
  551. +        fprintf(dlog_file, "SESSION_AWARE ");
  552.      if (create_opts & FILE_RESERVE_OPFILTER)
  553.          fprintf(dlog_file, "RESERVE_OPFILTER");
  554.      fprintf(dlog_file, "\n");
  555. diff --git a/include/from_kernel.h b/include/from_kernel.h
  556. index 8cd6c8b..b661c6b 100644
  557. --- a/include/from_kernel.h
  558. +++ b/include/from_kernel.h
  559. @@ -42,6 +42,10 @@
  560.  #define FILE_OPEN_FOR_BACKUP_INTENT             0x00004000
  561.  #define FILE_NO_COMPRESSION                     0x00008000
  562.  
  563. +#define FILE_OPEN_REQUIRING_OPLOCK              0x00010000
  564. +#define FILE_DISALLOW_EXCLUSIVE                 0x00020000
  565. +#define FILE_SESSION_AWARE                      0x00040000
  566. +
  567.  #define FILE_RESERVE_OPFILTER                   0x00100000
  568.  #define FILE_OPEN_REPARSE_POINT                 0x00200000
  569.  #define FILE_OPEN_NO_RECALL                     0x00400000
  570. diff --git a/sys/nfs41_debug.c b/sys/nfs41_debug.c
  571. index 9aca146..603f397 100644
  572. --- a/sys/nfs41_debug.c
  573. +++ b/sys/nfs41_debug.c
  574. @@ -452,7 +452,7 @@ void print_nt_create_params(int on, NT_CREATE_PARAMETERS params)
  575.      DbgP("Create Attributes: "
  576.          "0x%x "
  577.          "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' "
  578. -        "'%s' '%s' '%s' '%s' '%s' '%s' '%s'\n",
  579. +        "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'\n",
  580.          params.CreateOptions,
  581.          (params.CreateOptions & FILE_DIRECTORY_FILE)?"DIRFILE":"",
  582.          (params.CreateOptions & FILE_NON_DIRECTORY_FILE)?"FILE":"",
  583. @@ -469,6 +469,8 @@ void print_nt_create_params(int on, NT_CREATE_PARAMETERS params)
  584.          (params.CreateOptions & FILE_OPEN_REPARSE_POINT)?"OPEN_REPARSE":"",
  585.          (params.CreateOptions & FILE_OPEN_BY_FILE_ID)?"BY_ID":"",
  586.          (params.CreateOptions & FILE_OPEN_FOR_BACKUP_INTENT)?"4_BACKUP":"",
  587. +        (params.CreateOptions & FILE_OPEN_REQUIRING_OPLOCK)?"REQUIRING_OPLOCK":"",
  588. +        (params.CreateOptions & FILE_DISALLOW_EXCLUSIVE)?"DISALLOW_EXCLUSIVE":"",
  589.          (params.CreateOptions & FILE_RESERVE_OPFILTER)?"OPFILTER":"");
  590.  
  591.      DbgP("Share Access: '%s' '%s' '%s'\n",
  592. --
  593. 2.45.1
  594.  
  595. From ac84343c048b62a50e6075849ec833b5b2a2f18e Mon Sep 17 00:00:00 2001
  596. From: Roland Mainz <roland.mainz@nrubsig.org>
  597. Date: Mon, 7 Oct 2024 13:24:06 +0200
  598. Subject: [PATCH 3/6] daemon: Add |EASSERT_MSG()| for unsupported create
  599.  opts+reject |FILE_OPEN_REQUIRING_OPLOCK|
  600.  
  601. Add |EASSERT_MSG()| for unsupported create opts (i.e.
  602. |FILE_COMPLETE_IF_OPLOCKED|,  |FILE_OPEN_BY_FILE_ID|,
  603. |FILE_OPEN_REQUIRING_OPLOCK|, |FILE_DISALLOW_EXCLUSIVE|, and
  604. |FILE_RESERVE_OPFILTER|) and reject open with
  605. |FILE_OPEN_REQUIRING_OPLOCK|.
  606.  
  607. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  608. ---
  609. daemon/open.c | 21 +++++++++++++++++++++
  610.  1 file changed, 21 insertions(+)
  611.  
  612. diff --git a/daemon/open.c b/daemon/open.c
  613. index 36f4cad..bdd6515 100644
  614. --- a/daemon/open.c
  615. +++ b/daemon/open.c
  616. @@ -613,6 +613,27 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  617.      nfs41_open_state *state;
  618.      nfs41_file_info info = { 0 };
  619.  
  620. +    EASSERT_MSG(!(args->create_opts & FILE_COMPLETE_IF_OPLOCKED),
  621. +        ("handle_open: file='%s': "
  622. +        "FILE_COMPLETE_IF_OPLOCKED not supported\n", args->path));
  623. +    EASSERT_MSG(!(args->create_opts & FILE_OPEN_BY_FILE_ID),
  624. +        ("handle_open: file='%s': "
  625. +        "FILE_OPEN_BY_FILE_ID not supported\n", args->path));
  626. +    EASSERT_MSG(!(args->create_opts & FILE_OPEN_REQUIRING_OPLOCK),
  627. +        ("handle_open: file='%s': "
  628. +        "FILE_OPEN_REQUIRING_OPLOCK not supported\n", args->path));
  629. +    EASSERT_MSG(!(args->create_opts & FILE_DISALLOW_EXCLUSIVE),
  630. +        ("handle_open: file='%s': "
  631. +        "FILE_DISALLOW_EXCLUSIVE not supported\n", args->path));
  632. +    EASSERT_MSG(!(args->create_opts & FILE_RESERVE_OPFILTER),
  633. +        ("handle_open: file='%s': "
  634. +        "FILE_RESERVE_OPFILTER not supported\n", args->path));
  635. +
  636. +    if (args->create_opts & FILE_OPEN_REQUIRING_OPLOCK) {
  637. +        status = STATUS_INVALID_PARAMETER;
  638. +        goto out;
  639. +    }
  640. +
  641.      status = create_open_state(args->path, args->open_owner_id, &state);
  642.      if (status) {
  643.          eprintf("create_open_state(%d) failed with %d\n",
  644. --
  645. 2.45.1
  646.  
  647. From 0749af2fc6152cc12ef9dd68dff3ac7464aebd4c Mon Sep 17 00:00:00 2001
  648. From: Roland Mainz <roland.mainz@nrubsig.org>
  649. Date: Mon, 7 Oct 2024 13:54:52 +0200
  650. Subject: [PATCH 4/6] daemon,sys: Reject |FILE_OPEN_REQUIRING_OPLOCK| already
  651.  in the kernel
  652.  
  653. Reject |FILE_OPEN_REQUIRING_OPLOCK| already in the kernel
  654.  
  655. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  656. ---
  657. daemon/open.c      | 9 ++++-----
  658.  sys/nfs41_driver.c | 6 ++++++
  659.  2 files changed, 10 insertions(+), 5 deletions(-)
  660.  
  661. diff --git a/daemon/open.c b/daemon/open.c
  662. index bdd6515..28bb97a 100644
  663. --- a/daemon/open.c
  664. +++ b/daemon/open.c
  665. @@ -619,6 +619,10 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  666.      EASSERT_MSG(!(args->create_opts & FILE_OPEN_BY_FILE_ID),
  667.          ("handle_open: file='%s': "
  668.          "FILE_OPEN_BY_FILE_ID not supported\n", args->path));
  669. +    /*
  670. +     * Kernel rejects |FILE_OPEN_REQUIRING_OPLOCK|, we just use
  671. +     * this here as safeguard
  672. +     */
  673.      EASSERT_MSG(!(args->create_opts & FILE_OPEN_REQUIRING_OPLOCK),
  674.          ("handle_open: file='%s': "
  675.          "FILE_OPEN_REQUIRING_OPLOCK not supported\n", args->path));
  676. @@ -629,11 +633,6 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  677.          ("handle_open: file='%s': "
  678.          "FILE_RESERVE_OPFILTER not supported\n", args->path));
  679.  
  680. -    if (args->create_opts & FILE_OPEN_REQUIRING_OPLOCK) {
  681. -        status = STATUS_INVALID_PARAMETER;
  682. -        goto out;
  683. -    }
  684. -
  685.      status = create_open_state(args->path, args->open_owner_id, &state);
  686.      if (status) {
  687.          eprintf("create_open_state(%d) failed with %d\n",
  688. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  689. index aad56bf..e1ad810 100644
  690. --- a/sys/nfs41_driver.c
  691. +++ b/sys/nfs41_driver.c
  692. @@ -4196,6 +4196,12 @@ static NTSTATUS check_nfs41_create_args(
  693.          goto out;
  694.      }
  695.  
  696. +    /* We do not support oplocks (yet) */
  697. +    if (params->CreateOptions & FILE_OPEN_REQUIRING_OPLOCK) {
  698. +        status = STATUS_INVALID_PARAMETER;
  699. +        goto out;
  700. +    }
  701. +
  702.      if (!areOpenParamsValid(params)) {
  703.          status = STATUS_INVALID_PARAMETER;
  704.          goto out;
  705. --
  706. 2.45.1
  707.  
  708. From d205637778f218a7ac17fbebd8b06fc4fdbabe0d Mon Sep 17 00:00:00 2001
  709. From: Roland Mainz <roland.mainz@nrubsig.org>
  710. Date: Mon, 7 Oct 2024 14:01:56 +0200
  711. Subject: [PATCH 5/6] tests: Add "msnfs41client" target to nfsbuildtest.ksh93
  712.  
  713. Add "msnfs41client" target to nfsbuildtest.ksh93
  714.  
  715. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  716. ---
  717. tests/nfsbuildtest/nfsbuildtest.ksh93 | 109 ++++++++++++++++++++++++++
  718.  1 file changed, 109 insertions(+)
  719.  
  720. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  721. index 4ea102b..ecb9681 100644
  722. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  723. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  724. @@ -317,6 +317,103 @@ function bash_clean
  725.         return 0
  726.  }
  727.  
  728. +function msnfs41client_createcache
  729. +{
  730. +       set -o xtrace
  731. +       set -o errexit
  732. +       set -o nounset
  733. +
  734. +       mkdir -p 'gitbundles'
  735. +       rm -f 'gitbundles/ms-nfs41-client.bundle'
  736. +
  737. +       git -c checkout.workers=16 clone 'https://github.com/kofemann/ms-nfs41-client.git'
  738. +       cd 'ms-nfs41-client'
  739. +       git config --global --add safe.directory "$PWD"
  740. +       git bundle create '../gitbundles/ms-nfs41-client.bundle' --all
  741. +       git config --global --unset safe.directory "$PWD"
  742. +       cd ..
  743. +       rm -Rf 'ms-nfs41-client'
  744. +
  745. +       return 0
  746. +}
  747. +
  748. +
  749. +function msnfs41client_build
  750. +{
  751. +       set -o xtrace
  752. +       set -o errexit
  753. +       set -o nounset
  754. +
  755. +       #
  756. +       # build config
  757. +       #
  758. +       typeset config_cp_p_function_not_implemented_workaround=false
  759. +
  760. +       compound gitdata=(
  761. +               typeset url='https://github.com/kofemann/ms-nfs41-client.git'
  762. +               # use fixed git tag, so build times are compareable
  763. +               typeset tag='master'
  764. +       )
  765. +
  766. +       #
  767. +       # temp dir setup
  768. +       #
  769. +
  770. +       # fixme: Does not work with NFSv4.1 filesystem from exported Linux tmpfs - why ?
  771. +       #tmpdir='/cygdrive/m/tmpdir'
  772. +       #mkdir -p "$tmpdir"
  773. +       #chmod a=rwxt "$tmpdir"
  774. +       #if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  775. +       #       export TMPDIR="$tmpdir"
  776. +       #fi
  777. +
  778. +       #
  779. +       # print user info
  780. +       #
  781. +       id -a
  782. +       pwd
  783. +
  784. +       #
  785. +       # source checkout
  786. +       #
  787. +
  788. +       if [[ -f '../gitbundles/ms-nfs41-client.bundle' ]] ; then
  789. +               # Use local bundle as cache,
  790. +               # so build times only depend on local filesystem performance
  791. +               # and not HTTPS speed
  792. +               time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch '../gitbundles/ms-nfs41-client.bundle'
  793. +       else
  794. +               time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch "${gitdata.url}"
  795. +       fi
  796. +
  797. +       cd "$PWD/ms-nfs41-client/"
  798. +
  799. +       #
  800. +       # patch sources and configure build
  801. +       #
  802. +
  803. +       #
  804. +       # build ms-nfs41-client
  805. +       #
  806. +       export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
  807. +       time make -j1 -f cygwin/Makefile bintarball
  808. +       echo $?
  809. +
  810. +       echo "#Done."
  811. +       return 0
  812. +}
  813. +
  814. +
  815. +function msnfs41client_clean
  816. +{
  817. +       set -o xtrace
  818. +       set -o errexit
  819. +       set -o nounset
  820. +
  821. +       rm -Rf 'ms-nfs41-client'
  822. +       return 0
  823. +}
  824. +
  825.  builtin id
  826.  builtin mkdir
  827.  
  828. @@ -350,6 +447,18 @@ function main
  829.                         bash_clean
  830.                         return $?
  831.                         ;;
  832. +               'msnfs41client_createcache')
  833. +                       msnfs41client_createcache
  834. +                       return $?
  835. +                       ;;
  836. +               'msnfs41client_build')
  837. +                       msnfs41client_build
  838. +                       return $?
  839. +                       ;;
  840. +               'msnfs41client_clean')
  841. +                       msnfs41client_clean
  842. +                       return $?
  843. +                       ;;
  844.                 *)
  845.                         print -u2 -f $"%s: Unknown %q/%q combination." \
  846.                                 "$0" "${target}" "${subcmd}"
  847. --
  848. 2.45.1
  849.  
  850. From 21d8f3032ceba9b543079922942787336bc95384 Mon Sep 17 00:00:00 2001
  851. From: Roland Mainz <roland.mainz@nrubsig.org>
  852. Date: Mon, 7 Oct 2024 14:04:50 +0200
  853. Subject: [PATCH 6/6] tests: Fix bundle paths in nfsbuildtest.ksh93
  854.  
  855. Fix bundle paths in nfsbuildtest.ksh93
  856.  
  857. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  858. ---
  859. tests/nfsbuildtest/nfsbuildtest.ksh93 | 12 ++++++------
  860.  1 file changed, 6 insertions(+), 6 deletions(-)
  861.  
  862. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  863. index ecb9681..e24618e 100644
  864. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  865. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  866. @@ -26,8 +26,8 @@ function gcc_createcache
  867.         set -o errexit
  868.         set -o nounset
  869.  
  870. -       mkdir -p 'gitbundles'
  871. -       rm -f 'gitbundles/gcc.bundle'
  872. +       mkdir -p '../gitbundles'
  873. +       rm -f '../gitbundles/gcc.bundle'
  874.  
  875.         git -c checkout.workers=16 clone git://repo.or.cz/gcc.git
  876.         cd gcc
  877. @@ -180,8 +180,8 @@ function bash_createcache
  878.         set -o errexit
  879.         set -o nounset
  880.  
  881. -       mkdir -p 'gitbundles'
  882. -       rm -f 'gitbundles/bash.bundle'
  883. +       mkdir -p '../gitbundles'
  884. +       rm -f '../gitbundles/bash.bundle'
  885.  
  886.         git -c checkout.workers=16 clone 'https://github.com/bminor/bash.git'
  887.         cd bash
  888. @@ -323,8 +323,8 @@ function msnfs41client_createcache
  889.         set -o errexit
  890.         set -o nounset
  891.  
  892. -       mkdir -p 'gitbundles'
  893. -       rm -f 'gitbundles/ms-nfs41-client.bundle'
  894. +       mkdir -p '../gitbundles'
  895. +       rm -f '../gitbundles/ms-nfs41-client.bundle'
  896.  
  897.         git -c checkout.workers=16 clone 'https://github.com/kofemann/ms-nfs41-client.git'
  898.         cd 'ms-nfs41-client'
  899. --
  900. 2.45.1

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