pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for test NFS server setup for Linux+misc, 2025-06-07
Posted by Anonymous on Sat 7th Jun 2025 17:18
raw | new post

  1. From 23759a971008ee3f6dd0579a9a768be3ca9c5ba7 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Sat, 7 Jun 2025 16:32:07 +0200
  4. Subject: [PATCH 1/2] tests: Document Linux NFS server setup
  5.  
  6. Document Linux NFS server setup, with XFS and FAT32 test
  7. filesystems.
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. tests/nfs_server_setup.txt | 57 ++++++++++++++++++++++++++++++++++++--
  12.  1 file changed, 54 insertions(+), 3 deletions(-)
  13.  
  14. diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
  15. index b9e2267..0e7393f 100644
  16. --- a/tests/nfs_server_setup.txt
  17. +++ b/tests/nfs_server_setup.txt
  18. @@ -4,12 +4,63 @@
  19.  
  20.  #
  21.  # TODO:
  22. -# - Debian Linux NFSv4.2 server setup
  23. -# - Solaris 11.4 NFSv4.1 server setup
  24. -# - Illumos 11.4 NFSv4.1 server setup
  25.  # - FreeBSD NFSv4.1 server setup
  26.  #
  27.  
  28. +
  29. +#
  30. +# Debian Linux "Bullseye" NFSv4.2 server setup
  31. +#
  32. +
  33. +##### 1. Setup
  34. +---- snip ----
  35. +# install packages
  36. +apt-get install nfs-kernel-server nfs-common nfs4-acl-tools autofs
  37. +
  38. +# turn idmapper on, even for AUTH_SYS
  39. +{
  40. +        printf "[General]\n"
  41. +        printf "Domain = GLOBAL.LOC\n"
  42. +} >>'/etc/idmapd.conf'
  43. +printf "options nfsd nfs4_disable_idmapping=N\noptions nfs nfs4_disable_idmapping=N\n" >>'/etc/modprobe.d/nfs.conf'
  44. +printf "NEED_IDMAPD=yes\n" >>'/etc/default/nfs-common'
  45. +
  46. +# put an export in '/etc/exports'
  47. +
  48. +# start NFS server
  49. +service nfs-server start
  50. +---- snip ----
  51. +
  52. +
  53. +##### 2. Setup a 16GB XFS filesystem with block cloning support
  54. +---- snip ----
  55. +time dd if=/dev/zero of=/bigdisk/xfstestfs001.img bs=$((1024*1024)) count=$((16*1024))
  56. +mkfs.xfs -m reflink=1 /bigdisk/xfstestfs001.img
  57. +mkdir /xfstestfs001
  58. +chmod a+rwxt /xfstestfs001
  59. +echo '/bigdisk/xfstestfs001.img /xfstestfs001 xfs loop 0 0' >>'/etc/fstab'
  60. +#mount -o loop /bigdisk/xfstestfs001.img /xfstestfs001
  61. +echo '/xfstestfs001 *(sec=sys,rw,async,insecure,no_root_squash,fsid=2172423)' >>'/etc/exports'
  62. +mount /xfstestfs001
  63. +service nfs-server restart
  64. +---- snip ----
  65. +
  66. +
  67. +##### 3. Setup a 16GB DOS FAT32 filesystem for testing:
  68. +---- snip ----
  69. +dd if='/dev/zero' of='/bigdisk/fat32_image.img' bs=$((1024*1024)) count=$((16*1024))
  70. +mkfs.fat -F 32 '/bigdisk/fat32_image.img'
  71. +mkdir /fat32_mount
  72. +chmod -R a+rwx /fat32_mount
  73. +chown 65534:65534 /fat32_mount
  74. +#mount -o loop,uid=65534,gid=65534 /bigdisk/fat32_image.img /fat32_mount
  75. +echo '/bigdisk/fat32_image.img /fat32_mount fat loop,uid=65534,gid=65534 0 0' >>'/etc/fstab'
  76. +mount /fat32_mount
  77. +echo '/fat32_mount *(sec=sys,rw,async,insecure,all_squash,anonuid=65534,anongid=65534,fsid=5272429)' >>'/etc/exports'
  78. +service nfs-server restart
  79. +---- snip ----
  80. +
  81. +
  82.  #
  83.  # Windows Server 2019 NFSv4.1 server setup
  84.  #
  85. --
  86. 2.45.1
  87.  
  88. From 24091cfe93d8c66d07ef46825b69625d070b102c Mon Sep 17 00:00:00 2001
  89. From: Roland Mainz <roland.mainz@nrubsig.org>
  90. Date: Sat, 7 Jun 2025 17:36:44 +0200
  91. Subject: [PATCH 2/2] daemon: |nfs_file_info_to_attributes()| should only use
  92.  |mode| if it is a valid attribute
  93.  
  94. |nfs_file_info_to_attributes()| should only use |mode| if it is a valid attribute
  95.  
  96. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  97. ---
  98. daemon/fileinfoutil.c | 6 ++++--
  99.  1 file changed, 4 insertions(+), 2 deletions(-)
  100.  
  101. diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
  102. index f907b38..540994c 100644
  103. --- a/daemon/fileinfoutil.c
  104. +++ b/daemon/fileinfoutil.c
  105. @@ -73,8 +73,10 @@ ULONG nfs_file_info_to_attributes(
  106.      }
  107.  
  108.      EASSERT(bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_MODE));
  109. -    if (info->mode == 0444) /* XXX: 0444 for READONLY */
  110. -        attrs |= FILE_ATTRIBUTE_READONLY;
  111. +    if (bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_MODE)) {
  112. +        if (info->mode == 0444) /* XXX: 0444 for READONLY */
  113. +            attrs |= FILE_ATTRIBUTE_READONLY;
  114. +    }
  115.  
  116.      if (info->hidden)
  117.          attrs |= FILE_ATTRIBUTE_HIDDEN;
  118. --
  119. 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