pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for |FsRtlCopyRead2()| asserts, drmemory paths and libtirpc locking, 2024-10-28
Posted by Anonymous on Mon 28th Oct 2024 19:55
raw | new post

  1. From 585541047e7b0fe9f6225e4a808ee23b52f9830d Mon Sep 17 00:00:00 2001
  2. From: Dan Shelton <dan.f.shelton@gmail.com>
  3. Date: Mon, 28 Oct 2024 15:50:25 +0100
  4. Subject: [PATCH 1/3] sys: Fix bogus ASSERT() trips in FsRtlCopyRead2()
  5.  
  6. Fix bogus ASSERT() trips in FsRtlCopyRead2(), just testing
  7. for (IoStatus->Status == STATUS_END_OF_FILE) is wrong.
  8. Also add same ASSERT() to CcCopyRead() code path.
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. sys/copysup.c | 9 ++++++++-
  13.  1 file changed, 8 insertions(+), 1 deletion(-)
  14.  
  15. diff --git a/sys/copysup.c b/sys/copysup.c
  16. index a14f778..ece3984 100644
  17. --- a/sys/copysup.c
  18. +++ b/sys/copysup.c
  19. @@ -164,6 +164,11 @@ BOOLEAN FsRtlCopyRead2(
  20.                  IoStatus);
  21.  
  22.              FObj->Flags |= FO_FILE_FAST_IO_READ;
  23. +
  24. +            ASSERT((!retval) ||
  25. +                (IoStatus->Status == STATUS_END_OF_FILE) ||
  26. +                (((ULONGLONG)FileOffset->QuadPart + IoStatus->Information) <=
  27. +                    (ULONGLONG)fo_fcb->FileSize.QuadPart));
  28.          }
  29.          else {
  30.              CcFastCopyRead(FObj,
  31. @@ -175,7 +180,9 @@ BOOLEAN FsRtlCopyRead2(
  32.  
  33.              FObj->Flags |= FO_FILE_FAST_IO_READ;
  34.  
  35. -            ASSERT(IoStatus->Status == STATUS_END_OF_FILE);
  36. +            ASSERT((IoStatus->Status == STATUS_END_OF_FILE) ||
  37. +                ((FileOffset->LowPart + IoStatus->Information) <=
  38. +                    fo_fcb->FileSize.LowPart));
  39.          }
  40.  
  41.          if (retval) {
  42. --
  43. 2.45.1
  44.  
  45. From 6fefe520416b5c1221b1620698359e7c9f00a466 Mon Sep 17 00:00:00 2001
  46. From: Roland Mainz <roland.mainz@nrubsig.org>
  47. Date: Mon, 28 Oct 2024 16:09:16 +0100
  48. Subject: [PATCH 2/3] cygwin: msnfs41client should always use the full path to
  49.  nfsd for DrMemory
  50.  
  51. msnfs41client.bash should always use the full path to nfsd.exe for
  52. DrMemory
  53.  
  54. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  55. ---
  56. cygwin/devel/msnfs41client.bash | 6 ++++--
  57.  1 file changed, 4 insertions(+), 2 deletions(-)
  58.  
  59. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  60. index 415a2e9..f0a110c 100755
  61. --- a/cygwin/devel/msnfs41client.bash
  62. +++ b/cygwin/devel/msnfs41client.bash
  63. @@ -455,7 +455,8 @@ function nfsclient_rundeamon
  64.                                 # no symbol cache, user "SYSTEM" cannot write data to cache
  65.                                 '-no_use_symcache'
  66.                                 '--'
  67. -                               "${nfsd_args[@]}"
  68. +                               "$(cygpath -w "$(which "${nfsd_args[0]}")")"
  69. +                               "${nfsd_args[@]:1}"
  70.                                 '--crtdbgmem' 'none'
  71.                         )
  72.  
  73. @@ -575,7 +576,8 @@ function nfsclient_system_rundeamon
  74.                                 # no symbol cache, user "SYSTEM" cannot write data to cache
  75.                                 '-no_use_symcache'
  76.                                 '--'
  77. -                               "${nfsd_args[@]}"
  78. +                               "$(cygpath -w "$(which "${nfsd_args[0]}")")"
  79. +                               "${nfsd_args[@]:1}"
  80.                                 '--crtdbgmem' 'none'
  81.                         )
  82.  
  83. --
  84. 2.45.1
  85.  
  86. From 62a41205350865e31c25a0fea367501844907ec6 Mon Sep 17 00:00:00 2001
  87. From: Roland Mainz <roland.mainz@nrubsig.org>
  88. Date: Mon, 28 Oct 2024 20:19:05 +0100
  89. Subject: [PATCH 3/3] libtirpc: Fix locking in |authnone_marshal()|
  90.  
  91. Fix locking in |authnone_marshal()|, backported from
  92. libtirpc 1.3.6.
  93.  
  94. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  95. ---
  96. libtirpc/src/auth_none.c | 17 ++++++-----------
  97.  1 file changed, 6 insertions(+), 11 deletions(-)
  98.  
  99. diff --git a/libtirpc/src/auth_none.c b/libtirpc/src/auth_none.c
  100. index f013240..ef15b71 100644
  101. --- a/libtirpc/src/auth_none.c
  102. +++ b/libtirpc/src/auth_none.c
  103. @@ -133,24 +133,19 @@ static bool_t
  104.  authnone_marshal(AUTH *client, XDR *xdrs, u_int *seq)
  105.  {
  106.         struct authnone_private *ap;
  107. -       bool_t dummy;
  108. +       bool_t rv = FALSE;
  109.         extern mutex_t authnone_lock;
  110.  
  111.         assert(xdrs != NULL);
  112.  
  113. +       mutex_lock(&authnone_lock);
  114.         ap = authnone_private;
  115. -       if (ap == NULL) {
  116. -#if 0 /* gisburn: Disabled, causes mutex over-unlock */
  117. -               mutex_unlock(&authnone_lock);
  118. -#endif
  119. -               return (FALSE);
  120. +       if (ap) {
  121. +               rv = (*xdrs->x_ops->x_putbytes)(xdrs, ap->marshalled_client,
  122. +                                               ap->mcnt);
  123.         }
  124. -       dummy = (*xdrs->x_ops->x_putbytes)(xdrs,
  125. -           ap->marshalled_client, ap->mcnt);
  126. -#if 0 /* gisburn: Disabled, causes mutex over-unlock */
  127.         mutex_unlock(&authnone_lock);
  128. -#endif
  129. -       return (dummy);
  130. +       return (rv);
  131.  }
  132.  
  133.  /* All these unused parameters are required to keep ANSI-C from grumbling */
  134. --
  135. 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