pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


posixext20250723backup_002.patch
Posted by Anonymous on Wed 23rd Jul 2025 17:41
raw | new post

  1. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  2. index 977a4c1..f547e7c 100644
  3. --- a/daemon/nfs41_superblock.c
  4. +++ b/daemon/nfs41_superblock.c
  5. @@ -192,6 +192,9 @@ void nfs41_superblock_fs_attributes(
  6.  
  7.      FsAttrs->FileSystemAttributes = 0;
  8.      FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_SPARSE_FILES;
  9. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  10. +    FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_POSIX_UNLINK_RENAME;
  11. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  12.      /* NFSv4 protocol uses Unicode by default */
  13.      FsAttrs->FileSystemAttributes |= FILE_UNICODE_ON_DISK;
  14.  
  15. diff --git a/daemon/setattr.c b/daemon/setattr.c
  16. index 322e934..53fdbf7 100644
  17. --- a/daemon/setattr.c
  18. +++ b/daemon/setattr.c
  19. @@ -25,6 +25,7 @@
  20.  #include <stdio.h>
  21.  #include <strsafe.h>
  22.  
  23. +#include "nfs41_build_features.h"
  24.  #include "from_kernel.h"
  25.  #include "nfs41_ops.h"
  26.  #include "delegation.h"
  27. @@ -188,7 +189,31 @@ static int handle_nfs41_remove(void *daemon_context, setattr_upcall_args *args)
  28.  {
  29.      nfs41_open_state *state = args->state;
  30.      int status;
  31. -
  32. +    bool posixsemantics;
  33. +
  34. +    switch (args->set_class) {
  35. +        case FileDispositionInformation:
  36. +            posixsemantics = false;
  37. +            break;
  38. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  39. +        case FileDispositionInformationEx:
  40. +            posixsemantics =
  41. +                (((PFILE_DISPOSITION_INFORMATION_EX)args->buf)->Flags &
  42. +                    FILE_DISPOSITION_POSIX_SEMANTICS)?true:false;
  43. +            break;
  44. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  45. +        default:
  46. +            eprintf("handle_nfs41_link: unhandled set_class=%d\n",
  47. +                (int)args->set_class);
  48. +            status = ERROR_NOT_SUPPORTED;
  49. +            goto out;
  50. +    }
  51. +
  52. +    DPRINTF(0, ("handle_nfs41_remove(): "
  53. +        "class=%d posix_semantics=%d\n",
  54. +        (int)args->set_class,
  55. +        (int)posixsemantics));
  56. +
  57.      /* break any delegations and truncate before REMOVE */
  58.      nfs41_delegation_return(state->session, &state->file,
  59.          OPEN_DELEGATE_WRITE, TRUE);
  60. @@ -200,7 +225,10 @@ static int handle_nfs41_remove(void *daemon_context, setattr_upcall_args *args)
  61.              nfs_error_string(status)));
  62.      }
  63.  
  64. -    return nfs_to_windows_error(status, ERROR_ACCESS_DENIED);
  65. +    status = nfs_to_windows_error(status, ERROR_ACCESS_DENIED);
  66. +
  67. +out:
  68. +    return status;
  69.  }
  70.  
  71.  static void open_state_rename(
  72. @@ -302,14 +330,42 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  73.      nfs41_open_state *state = args->state;
  74.      nfs41_session *dst_session;
  75.      PFILE_RENAME_INFO rename = (PFILE_RENAME_INFO)args->buf;
  76. +    bool replaceifexists;
  77. +    bool posixsemantics;
  78.      nfs41_abs_path dst_path = { 0 };
  79.      nfs41_path_fh dst_dir, dst;
  80.      nfs41_component dst_name, *src_name;
  81.      uint32_t depth = 0;
  82.      int status;
  83. -
  84. -    src_name = &state->file.name;
  85. -
  86. +
  87. +    switch (args->set_class) {
  88. +        case FileRenameInformation:
  89. +            replaceifexists = rename->ReplaceIfExists?true:false;
  90. +            posixsemantics = false;
  91. +            break;
  92. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  93. +        case FileRenameInformationEx:
  94. +            replaceifexists =
  95. +                (rename->Flags & FILE_RENAME_REPLACE_IF_EXISTS)?true:false;
  96. +            posixsemantics =
  97. +                (rename->Flags & FILE_RENAME_POSIX_SEMANTICS)?true:false;
  98. +            break;
  99. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  100. +        default:
  101. +            eprintf("handle_nfs41_rename: unhandled set_class=%d\n",
  102. +                (int)args->set_class);
  103. +            status = ERROR_NOT_SUPPORTED;
  104. +            goto out;
  105. +    }
  106. +
  107. +    src_name = &state->file.name;
  108. +
  109. +    DPRINTF(0, ("handle_nfs41_rename(): "
  110. +        "class=%d replaceifexists=%d posix_semantics=%d\n",
  111. +        (int)args->set_class,
  112. +        (int)replaceifexists,
  113. +        (int)posixsemantics));
  114. +
  115.      if (rename->FileNameLength == 0) {
  116.          /* start from state->path instead of args->path, in case we got
  117.           * the file from a referred server */
  118. @@ -439,7 +495,7 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  119.      last_component(dst_path.path, dst_name.name, &dst_dir.name);
  120.  
  121.      if (status == NO_ERROR) {
  122. -        if (!rename->ReplaceIfExists) {
  123. +        if (!replaceifexists) {
  124.              status = ERROR_FILE_EXISTS;
  125.              goto out;
  126.          }
  127. @@ -459,16 +515,22 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  128.          status = ERROR_NOT_SAME_DEVICE;
  129.          goto out;
  130.      }
  131. -
  132. -    status = is_dst_name_opened(&dst_path, dst_session);
  133. -    if (status) {
  134. -        /* AGLO: 03/21/2011: we can't handle rename of a file with a filename
  135. -         * that is currently opened by this client
  136. -         */
  137. -        eprintf("handle_nfs41_rename: '%s' is opened\n", dst_path.path);
  138. -        status = ERROR_FILE_EXISTS;
  139. -        goto out;
  140. +
  141. +#if 0 /* disabled to test MariaDB */
  142. +    if (!posixsemantics) {
  143. +        status = is_dst_name_opened(&dst_path, dst_session);
  144. +        if (status) {
  145. +            /*
  146. +             * AGLO: 03/21/2011: we can't handle rename of a file with a
  147. +             * filename that is currently opened by this client
  148. +             */
  149. +            eprintf("handle_nfs41_rename: destination '%s' is opened\n",
  150. +                dst_path.path);
  151. +            status = ERROR_FILE_EXISTS;
  152. +            goto out;
  153. +        }
  154.      }
  155. +#endif
  156.  
  157.      /* break any delegations on the source file */
  158.      nfs41_delegation_return(state->session, &state->file,
  159. @@ -551,6 +613,8 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  160.  {
  161.      nfs41_open_state *state = args->state;
  162.      PFILE_LINK_INFORMATION link = (PFILE_LINK_INFORMATION)args->buf;
  163. +    bool replaceifexists;
  164. +    bool posixsemantics;
  165.      nfs41_session *dst_session;
  166.      nfs41_abs_path dst_path = { 0 };
  167.      nfs41_path_fh dst_dir, dst;
  168. @@ -563,6 +627,32 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  169.  
  170.      EASSERT((link->FileNameLength%sizeof(WCHAR)) == 0);
  171.  
  172. +    switch (args->set_class) {
  173. +        case FileLinkInformation:
  174. +            replaceifexists = link->ReplaceIfExists?true:false;
  175. +            posixsemantics = false;
  176. +            break;
  177. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  178. +        case FileLinkInformationEx:
  179. +            replaceifexists =
  180. +                (link->Flags & FILE_LINK_REPLACE_IF_EXISTS)?true:false;
  181. +            posixsemantics =
  182. +                (link->Flags & FILE_LINK_POSIX_SEMANTICS)?true:false;
  183. +            break;
  184. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  185. +        default:
  186. +            eprintf("handle_nfs41_link: unhandled set_class=%d\n",
  187. +                (int)args->set_class);
  188. +            status = ERROR_NOT_SUPPORTED;
  189. +            goto out;
  190. +    }
  191. +
  192. +    DPRINTF(0, ("handle_nfs41_link(): "
  193. +        "class=%d replaceifexists=%d posix_semantics=%d\n",
  194. +        (int)args->set_class,
  195. +        (int)replaceifexists,
  196. +        (int)posixsemantics));
  197. +
  198.      dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8,
  199.          WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  200.          link->FileName, link->FileNameLength/sizeof(WCHAR),
  201. @@ -607,7 +697,7 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  202.      last_component(dst_path.path, dst_name.name, &dst_dir.name);
  203.  
  204.      if (status == NO_ERROR) {
  205. -        if (!link->ReplaceIfExists) {
  206. +        if (!replaceifexists) {
  207.              status = ERROR_FILE_EXISTS;
  208.              goto out;
  209.          }
  210. @@ -670,16 +760,25 @@ static int handle_setattr(void *daemon_context, nfs41_upcall *upcall)
  211.          status = handle_nfs41_setattr_basicinfo(daemon_context, args);
  212.          break;
  213.      case FileDispositionInformation:
  214. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  215. +    case FileDispositionInformationEx:
  216. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  217.          status = handle_nfs41_remove(daemon_context, args);
  218.          break;
  219.      case FileRenameInformation:
  220. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  221. +    case FileRenameInformationEx:
  222. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  223.          status = handle_nfs41_rename(daemon_context, args);
  224.          break;
  225.      case FileAllocationInformation:
  226. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  227.      case FileEndOfFileInformation:
  228. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  229.          status = handle_nfs41_set_size(daemon_context, args);
  230.          break;
  231.      case FileLinkInformation:
  232. +    case FileLinkInformationEx:
  233.          status = handle_nfs41_link(daemon_context, args);
  234.          break;
  235.      default:
  236. diff --git a/include/from_kernel.h b/include/from_kernel.h
  237. index 7a305bc..96d4b32 100644
  238. --- a/include/from_kernel.h
  239. +++ b/include/from_kernel.h
  240. @@ -153,6 +153,19 @@ typedef struct _FILE_NAMES_INFORMATION {
  241.      WCHAR FileName[1];
  242.  } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
  243.  
  244. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  245. +typedef struct _FILE_DISPOSITION_INFORMATION_EX {
  246. +    ULONG Flags;
  247. +} FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX;
  248. +
  249. +#define FILE_DISPOSITION_DO_NOT_DELETE                  0x00000000
  250. +#define FILE_DISPOSITION_DELETE                         0x00000001
  251. +#define FILE_DISPOSITION_POSIX_SEMANTICS                0x00000002
  252. +#define FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK      0x00000004
  253. +#define FILE_DISPOSITION_ON_CLOSE                       0x00000008
  254. +#define FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE      0x00000010
  255. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  256. +
  257.  typedef struct _FILE_DIRECTORY_INFORMATION {
  258.      ULONG NextEntryOffset;
  259.      ULONG FileIndex;
  260. @@ -269,13 +282,57 @@ typedef struct _FILE_ID_EXTD_BOTH_DIR_INFORMATION {
  261.      WCHAR FileName[1];
  262.  } FILE_ID_EXTD_BOTH_DIR_INFORMATION, *PFILE_ID_EXTD_BOTH_DIR_INFORMATION;
  263.  
  264. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  265. +#define FILE_RENAME_REPLACE_IF_EXISTS                       0x00000001
  266. +#define FILE_RENAME_POSIX_SEMANTICS                         0x00000002
  267. +#define FILE_RENAME_SUPPRESS_PIN_STATE_INHERITANCE          0x00000004
  268. +#define FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE    0x00000008
  269. +#define FILE_RENAME_NO_INCREASE_AVAILABLE_SPACE             0x00000010
  270. +#define FILE_RENAME_NO_DECREASE_AVAILABLE_SPACE             0x00000020
  271. +#define FILE_RENAME_PRESERVE_AVAILABLE_SPACE                0x00000030
  272. +#define FILE_RENAME_IGNORE_READONLY_ATTRIBUTE               0x00000040
  273. +#define FILE_RENAME_FORCE_RESIZE_TARGET_SR                  0x00000080
  274. +#define FILE_RENAME_FORCE_RESIZE_SOURCE_SR                  0x00000100
  275. +#define FILE_RENAME_FORCE_RESIZE_SR                         0x00000180
  276. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  277. +
  278.  typedef struct _FILE_LINK_INFORMATION {
  279. -    BOOLEAN ReplaceIfExists;
  280. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  281. +#ifdef _MSC_VER
  282. +#pragma warning( push )
  283. +/*
  284. + * C4201: "nonstandard extension used: nameless struct/union"
  285. + */
  286. +#pragma warning (disable : 4201)
  287. +#endif /* _MSC_VER */
  288. +    union {
  289. +        BOOLEAN ReplaceIfExists;  /* class==FileLinkInformation */
  290. +        ULONG Flags;              /* class==FileLinkInformationEx */
  291. +    };
  292. +#ifdef _MSC_VER
  293. +#pragma warning( pop )
  294. +#endif /* _MSC_VER */
  295. +#else
  296. +    BOOLEAN ReplaceIfExists;  /* class==FileLinkInformation */
  297. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  298.      HANDLE RootDirectory;
  299.      ULONG FileNameLength;
  300.      WCHAR FileName[1];
  301.  } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
  302.  
  303. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  304. +#define FILE_LINK_REPLACE_IF_EXISTS                         0x00000001
  305. +#define FILE_LINK_POSIX_SEMANTICS                           0x00000002
  306. +#define FILE_LINK_SUPPRESS_STORAGE_RESERVE_INHERITANCE      0x00000008
  307. +#define FILE_LINK_NO_INCREASE_AVAILABLE_SPACE               0x00000010
  308. +#define FILE_LINK_NO_DECREASE_AVAILABLE_SPACE               0x00000020
  309. +#define FILE_LINK_PRESERVE_AVAILABLE_SPACE                  0x00000030
  310. +#define FILE_LINK_IGNORE_READONLY_ATTRIBUTE                 0x00000040
  311. +#define FILE_LINK_FORCE_RESIZE_TARGET_SR                    0x00000080
  312. +#define FILE_LINK_FORCE_RESIZE_SOURCE_SR                    0x00000100
  313. +#define FILE_LINK_FORCE_RESIZE_SR                           0x00000180
  314. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  315. +
  316.  typedef struct _FILE_EA_INFORMATION {
  317.      ULONG EaSize;
  318.  } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
  319. diff --git a/nfs41_build_features.h b/nfs41_build_features.h
  320. index 38f6372..5a65953 100644
  321. --- a/nfs41_build_features.h
  322. +++ b/nfs41_build_features.h
  323. @@ -236,4 +236,12 @@
  324.   */
  325.  #define NFS41_DRIVER_HACK_LOCKING_STORAGE32_RANGELOCK_PROBING 1
  326.  
  327. +/*
  328. + * |NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES| - enable
  329. + * support for |FileDispositionInformationEx|, |FileRenameInformationEx|
  330. + * and |FileLinkInformationEx|, assuming the platforms rdbsslib.lib
  331. + * supports them
  332. + */
  333. +#define NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES 1
  334. +
  335.  #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
  336. diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
  337. index d7dc5e7..b175695 100644
  338. --- a/sys/nfs41sys_fileinfo.c
  339. +++ b/sys/nfs41sys_fileinfo.c
  340. @@ -573,6 +573,9 @@ NTSTATUS check_nfs41_setattr_args(
  341.  
  342.      switch (InfoClass) {
  343.      case FileRenameInformation:
  344. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  345. +    case FileRenameInformationEx:
  346. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  347.      {
  348.          PFILE_RENAME_INFORMATION rinfo =
  349.              (PFILE_RENAME_INFORMATION)RxContext->Info.Buffer;
  350. @@ -592,6 +595,9 @@ NTSTATUS check_nfs41_setattr_args(
  351.          break;
  352.      }
  353.      case FileLinkInformation:
  354. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  355. +    case FileLinkInformationEx:
  356. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  357.      {
  358.          PFILE_LINK_INFORMATION linfo =
  359.              (PFILE_LINK_INFORMATION)RxContext->Info.Buffer;
  360. @@ -621,6 +627,19 @@ NTSTATUS check_nfs41_setattr_args(
  361.          }
  362.          break;
  363.      }
  364. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  365. +    case FileDispositionInformationEx:
  366. +    {
  367. +        PFILE_DISPOSITION_INFORMATION_EX dinfo =
  368. +            (PFILE_DISPOSITION_INFORMATION_EX)RxContext->Info.Buffer;
  369. +        __notnull PNFS41_FCB nfs41_fcb = NFS41GetFcbExtension(RxContext->pFcb);
  370. +        if ((dinfo->Flags & FILE_DISPOSITION_DELETE) && nfs41_fcb->DeletePending) {
  371. +            status = STATUS_DELETE_PENDING;
  372. +            goto out;
  373. +        }
  374. +        break;
  375. +    }
  376. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  377.      case FileBasicInformation:
  378.      case FileAllocationInformation:
  379.      case FileEndOfFileInformation:
  380. @@ -694,6 +713,46 @@ NTSTATUS nfs41_SetFileInformation(
  381.              status = STATUS_SUCCESS;
  382.              goto out;
  383.          }
  384. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  385. +    case FileDispositionInformationEx:
  386. +        {
  387. +            PFILE_DISPOSITION_INFORMATION_EX dinfo =
  388. +                (PFILE_DISPOSITION_INFORMATION_EX)RxContext->Info.Buffer;
  389. +            if (dinfo->Flags & FILE_DISPOSITION_DELETE) {
  390. +                nfs41_fcb->DeletePending = TRUE;
  391. +
  392. +                /* we can delete directories right away */
  393. +                if (nfs41_fcb->StandardInfo.Directory)
  394. +                    break;
  395. +
  396. +                /* delete immediately if POSIX semantics are requested */
  397. +                if (dinfo->Flags & FILE_DISPOSITION_POSIX_SEMANTICS)
  398. +                    break;
  399. +
  400. +                nfs41_fcb->StandardInfo.DeletePending = TRUE;
  401. +                if (RxContext->pFcb->OpenCount > 1) {
  402. +                    rinfo.ReplaceIfExists = 0;
  403. +                    rinfo.RootDirectory = INVALID_HANDLE_VALUE;
  404. +                    rinfo.FileNameLength = 0;
  405. +                    rinfo.FileName[0] = L'\0';
  406. +                    InfoClass = FileRenameInformation;
  407. +                    nfs41_fcb->Renamed = TRUE;
  408. +                    break;
  409. +                }
  410. +            }
  411. +            if (dinfo->Flags & FILE_DISPOSITION_DO_NOT_DELETE) {
  412. +                /* section 4.3.3 of [FSBO]
  413. +                 * "file system behavior in the microsoft windows environment"
  414. +                 */
  415. +                if (nfs41_fcb->DeletePending) {
  416. +                    nfs41_fcb->DeletePending = FALSE;
  417. +                    nfs41_fcb->StandardInfo.DeletePending = 0;
  418. +                }
  419. +            }
  420. +            status = STATUS_SUCCESS;
  421. +            goto out;
  422. +        }
  423. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  424.      case FileAllocationInformation:
  425.          {
  426.              PFILE_ALLOCATION_INFORMATION info =
  427. @@ -711,6 +770,9 @@ NTSTATUS nfs41_SetFileInformation(
  428.              break;
  429.          }
  430.      case FileRenameInformation:
  431. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  432. +    case FileRenameInformationEx:
  433. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  434.          {
  435.              /* noop if filename and destination are the same */
  436.              PFILE_RENAME_INFORMATION prinfo =
  437. @@ -734,8 +796,16 @@ NTSTATUS nfs41_SetFileInformation(
  438.  
  439.      /* original irp has infoclass for remove but we need to rename instead,
  440.       * thus we changed the local variable infoclass */
  441. -    if (RxContext->Info.FileInformationClass == FileDispositionInformation &&
  442. -            InfoClass == FileRenameInformation) {
  443. +#ifdef NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES
  444. +    if (((RxContext->Info.FileInformationClass == FileDispositionInformation) ||
  445. +        (RxContext->Info.FileInformationClass == FileDispositionInformationEx)) &&
  446. +        ((InfoClass == FileRenameInformation) ||
  447. +        (InfoClass == FileRenameInformationEx)))
  448. +#else
  449. +    if ((RxContext->Info.FileInformationClass == FileDispositionInformation) &&
  450. +        (InfoClass == FileRenameInformation))
  451. +#endif /* NFS41_DRIVER_RDR_SUPPORTS_POSIX_FILEINFORMATINO_CLASSES */
  452. +        {
  453.          entry->buf = &rinfo;
  454.          entry->buf_len = sizeof(rinfo);
  455.      } else {

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