pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


[patch] |RxChangeBufferingState()| can only be used with a exclusive FCB lock held
Posted by Anonymous on Fri 14th Mar 2025 12:51
raw | new post

  1. From 5b6053fb01d4a217353bea2815ec212b6e2d7912 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 12 Mar 2025 18:51:06 +0100
  4. Subject: [PATCH 2/2] sys: |RxChangeBufferingState()| can only be used with
  5.  exclusive FCB lock held
  6.  
  7. |RxChangeBufferingState()| can only be used with a exclusive FCB lock held.
  8.  
  9. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. sys/nfs41sys_driver.c    | 2 ++
  13.  sys/nfs41sys_fsctl.c     | 2 ++
  14.  sys/nfs41sys_openclose.c | 2 ++
  15.  3 files changed, 6 insertions(+)
  16.  
  17. diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
  18. index 9457ddb..57539fe 100644
  19. --- a/sys/nfs41sys_driver.c
  20. +++ b/sys/nfs41sys_driver.c
  21. @@ -906,7 +906,9 @@ void enable_caching(
  22.      if (!flag)
  23.          return;
  24.  
  25. +    (void)RxAcquireExclusiveFcbResourceInMRx(SrvOpen->pFcb);
  26.      RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  27. +    RxReleaseFcbResourceInMRx(SrvOpen->pFcb);
  28.  
  29.      ExAcquireFastMutex(&fcblistLock);
  30.      pEntry = openlist.head.Flink;
  31. diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
  32. index ede33e3..c7bf557 100644
  33. --- a/sys/nfs41sys_fsctl.c
  34. +++ b/sys/nfs41sys_fsctl.c
  35. @@ -492,7 +492,9 @@ NTSTATUS nfs41_SetZeroData(
  36.      ULONG flag = DISABLE_CACHING;
  37.      DbgP("nfs41_SetZeroData: disableing caching for file '%wZ'\n",
  38.          SrvOpen->pAlreadyPrefixedName);
  39. +    (void)RxAcquireExclusiveFcbResourceInMRx(SrvOpen->pFcb);
  40.      RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  41. +    RxReleaseFcbResourceInMRx(SrvOpen->pFcb);
  42.  
  43.      status = nfs41_UpcallCreate(NFS41_SYSOP_FSCTL_SET_ZERO_DATA,
  44.          &nfs41_fobx->sec_ctx,
  45. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  46. index 4d61e42..030f2c8 100644
  47. --- a/sys/nfs41sys_openclose.c
  48. +++ b/sys/nfs41sys_openclose.c
  49. @@ -911,7 +911,9 @@ retry_on_link:
  50.          DbgP("nfs41_Create: reopening (changed) file '%wZ'\n",
  51.              SrvOpen->pAlreadyPrefixedName);
  52.  #endif
  53. +        (void)RxAcquireExclusiveFcbResourceInMRx(SrvOpen->pFcb);
  54.          RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  55. +        RxReleaseFcbResourceInMRx(SrvOpen->pFcb);
  56.      }
  57.  
  58.      if (!nfs41_fcb->StandardInfo.Directory &&
  59. --
  60. 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