mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* nfs mount failed with ipv6 addr
@ 2025-05-21 14:11 Yan, Haixiao (CN)
  2025-05-21 15:03 ` Chuck Lever
  2025-05-21 23:32 ` NeilBrown
  0 siblings, 2 replies; 10+ messages in thread
From: Yan, Haixiao (CN) @ 2025-05-21 14:11 UTC (permalink / raw)
  To: chuck.lever; +Cc: stable, linux-kernel

On linux-5.10.y, my testcase run failed:

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
mount.nfs: requested NFS version or transport protocol is not supported

The first bad commit is:

commit 7229200f68662660bb4d55f19247eaf3c79a4217
Author: Chuck Lever <chuck.lever@oracle.com>
Date:   Mon Jun 3 10:35:02 2024 -0400

   nfsd: don't allow nfsd threads to be signalled.

   [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]


Here is the test log:

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
mke2fs 1.46.1 (9-Feb-2021)
Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
Superblock backups stored on blocks:
	8193, 24577, 40961, 57345, 73729

Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
stopping mountd: done
stopping nfsd: ..........failed
  using signal 9:
..........failed
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/mnt/nfs_root".
   Assuming default behaviour ('no_subtree_check').
   NOTE: this default has changed since nfs-utils version 1.0.x

starting 8 nfsd kernel threads: done
starting mountd: done
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/mnt/nfs_root".
   Assuming default behaviour ('no_subtree_check').
   NOTE: this default has changed since nfs-utils version 1.0.x
root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo hello > /mnt/nfs_root/hello.txt

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/v6

root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
mount.nfs: requested NFS version or transport protocol is not supported

Thanks,
Haixiao


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-21 14:11 nfs mount failed with ipv6 addr Yan, Haixiao (CN)
@ 2025-05-21 15:03 ` Chuck Lever
  2025-05-21 23:32 ` NeilBrown
  1 sibling, 0 replies; 10+ messages in thread
From: Chuck Lever @ 2025-05-21 15:03 UTC (permalink / raw)
  To: Yan, Haixiao (CN)
  Cc: stable, linux-kernel, Neil Brown, Linux NFS Mailing List

On 5/21/25 10:11 AM, Yan, Haixiao (CN) wrote:
> On linux-5.10.y, my testcase run failed:
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -
> t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> mount.nfs: requested NFS version or transport protocol is not supported
> 
> The first bad commit is:
> 
> commit 7229200f68662660bb4d55f19247eaf3c79a4217
> Author: Chuck Lever <chuck.lever@oracle.com>
> Date:   Mon Jun 3 10:35:02 2024 -0400
> 
>   nfsd: don't allow nfsd threads to be signalled.
> 
>   [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]

commit 3903902401451b1cd9d797a8c79769eb26ac7fe5
Author:     NeilBrown <neilb@suse.de>
AuthorDate: Tue Jul 18 16:38:08 2023 +1000
Commit:     Chuck Lever <chuck.lever@oracle.com>
CommitDate: Tue Aug 29 17:45:22 2023 -0400

    nfsd: don't allow nfsd threads to be signalled.

Adding Neil and the linux-nfs@ list ...


> Here is the test log:
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/
> dev/zero of=/tmp/nfs.img bs=1M count=100
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /
> tmp/nfs.img
> mke2fs 1.46.1 (9-Feb-2021)
> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b            
> \b\b\b\b\b\b\b\b\b\b\b\b\bdone
> Creating filesystem with 102400 1k blocks and 25688 inodes
> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
> Superblock backups stored on blocks:
>     8193, 24577, 40961, 57345, 73729
> 
> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> Writing superblocks and filesystem accounting information: 
> 0/13\b\b\b\b\b     \b\b\b\b\bdone
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /
> tmp/nfs.img /mnt
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /
> mnt/nfs_root
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /
> etc/exports
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/
> mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/
> wr-test/bin/svcwp.sh nfsserver restart
> stopping mountd: done
> stopping nfsd: ..........failed
>  using signal 9:
> ..........failed
> exportfs: /etc/exports [1]: Neither 'subtree_check' or
> 'no_subtree_check' specified for export "*:/mnt/nfs_root".
>   Assuming default behaviour ('no_subtree_check').
>   NOTE: this default has changed since nfs-utils version 1.0.x
> 
> starting 8 nfsd kernel threads: done
> starting mountd: done
> exportfs: /etc/exports [1]: Neither 'subtree_check' or
> 'no_subtree_check' specified for export "*:/mnt/nfs_root".
>   Assuming default behaviour ('no_subtree_check').
>   NOTE: this default has changed since nfs-utils version 1.0.x
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo
> hello > /mnt/nfs_root/hello.txt
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /
> mnt/v6
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -
> t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> mount.nfs: requested NFS version or transport protocol is not supported
> 
> Thanks,
> Haixiao
> 

I am not able to reproduce this behavior:

[root@pynfs-nfsd ~]# mount -v -o vers=3 [::1]:/export/pynfs-4.0 /mnt
mount.nfs: timeout set for Wed May 21 10:55:59 2025
mount.nfs: trying text-based options 'vers=3,addr=::1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying ::1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying ::1 prog 100005 vers 3 prot UDP port 20048
[root@pynfs-nfsd ~]# nfsstat -m
/mnt from [::1]:/export/pynfs-4.0
 Flags:
rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,timeo=600,retrans=2,sec=sys,mountaddr=::1,mountvers=3,mountport=20048,mountproto=udp6,local_lock=none,addr=::1

[root@pynfs-nfsd ~]# uname -r
5.10.237-g024a4a45fdf8
[root@pynfs-nfsd ~]# cat /etc/redhat-release
Fedora release 33 (Thirty Three)
[root@pynfs-nfsd ~]#

Maybe I missed something.


-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-21 14:11 nfs mount failed with ipv6 addr Yan, Haixiao (CN)
  2025-05-21 15:03 ` Chuck Lever
@ 2025-05-21 23:32 ` NeilBrown
  2025-05-22  4:35   ` Haixiao Yan
  1 sibling, 1 reply; 10+ messages in thread
From: NeilBrown @ 2025-05-21 23:32 UTC (permalink / raw)
  To: Yan, Haixiao (CN); +Cc: chuck.lever, stable, linux-kernel

On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
> On linux-5.10.y, my testcase run failed:
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> mount.nfs: requested NFS version or transport protocol is not supported
> 
> The first bad commit is:
> 
> commit 7229200f68662660bb4d55f19247eaf3c79a4217
> Author: Chuck Lever <chuck.lever@oracle.com>
> Date:   Mon Jun 3 10:35:02 2024 -0400
> 
>    nfsd: don't allow nfsd threads to be signalled.
> 
>    [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
> 
> 
> Here is the test log:
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
> mke2fs 1.46.1 (9-Feb-2021)
> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
> Creating filesystem with 102400 1k blocks and 25688 inodes
> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
> Superblock backups stored on blocks:
> 	8193, 24577, 40961, 57345, 73729
> 
> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
> 
> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
> stopping mountd: done
> stopping nfsd: ..........failed
>   using signal 9:
> ..........failed

What does your "nfsserver" script do to try to stop/restart the nfsd?
For a very long time the approved way to stop nfsd has been to run
"rpc.nfsd 0".  My guess is that whatever script you are using still
trying to send a signal to nfsd.  That no longer works.

Unfortunately the various sysv-init scripts for starting/stopping nfsd
have never been part of nfs-utils so we were not able to update them.
nfs-utils *does* contain systemd unit files for sites which use systemd.

If you have a non-systemd way of starting/stopping nfsd, we would be
happy to make the relevant scripts part of nfs-utils so that we can
ensure they stay up to date.

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-21 23:32 ` NeilBrown
@ 2025-05-22  4:35   ` Haixiao Yan
  2025-05-22 23:21     ` NeilBrown
  0 siblings, 1 reply; 10+ messages in thread
From: Haixiao Yan @ 2025-05-22  4:35 UTC (permalink / raw)
  To: NeilBrown; +Cc: chuck.lever, stable, linux-kernel


On 2025/5/22 07:32, NeilBrown wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
>> On linux-5.10.y, my testcase run failed:
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
>> mount.nfs: requested NFS version or transport protocol is not supported
>>
>> The first bad commit is:
>>
>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
>> Author: Chuck Lever <chuck.lever@oracle.com>
>> Date:   Mon Jun 3 10:35:02 2024 -0400
>>
>>     nfsd: don't allow nfsd threads to be signalled.
>>
>>     [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
>>
>>
>> Here is the test log:
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
>> 100+0 records in
>> 100+0 records out
>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
>> mke2fs 1.46.1 (9-Feb-2021)
>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
>> Creating filesystem with 102400 1k blocks and 25688 inodes
>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
>> Superblock backups stored on blocks:
>>        8193, 24577, 40961, 57345, 73729
>>
>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
>>
>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
>> stopping mountd: done
>> stopping nfsd: ..........failed
>>    using signal 9:
>> ..........failed
> What does your "nfsserver" script do to try to stop/restart the nfsd?
> For a very long time the approved way to stop nfsd has been to run
> "rpc.nfsd 0".  My guess is that whatever script you are using still
> trying to send a signal to nfsd.  That no longer works.
>
> Unfortunately the various sysv-init scripts for starting/stopping nfsd
> have never been part of nfs-utils so we were not able to update them.
> nfs-utils *does* contain systemd unit files for sites which use systemd.
>
> If you have a non-systemd way of starting/stopping nfsd, we would be
> happy to make the relevant scripts part of nfs-utils so that we can
> ensure they stay up to date.

Actually, we use  service nfsserver restart  =>
/etc/init.d/nfsserver =>

stop_nfsd(){
     # WARNING: this kills any process with the executable
     # name 'nfsd'.
     echo -n 'stopping nfsd: '
     start-stop-daemon --stop --quiet --signal 1 --name nfsd
     if delay_nfsd || {
         echo failed
         echo ' using signal 9: '
         start-stop-daemon --stop --quiet --signal 9 --name nfsd
         delay_nfsd
     }
     then
         echo done
     else
         echo failed
     fi
}

Thanks,

Haixiao

> Thanks,
> NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-22  4:35   ` Haixiao Yan
@ 2025-05-22 23:21     ` NeilBrown
  2025-05-23  6:52       ` Yan, Haixiao (CN)
  0 siblings, 1 reply; 10+ messages in thread
From: NeilBrown @ 2025-05-22 23:21 UTC (permalink / raw)
  To: Haixiao Yan; +Cc: chuck.lever, stable, linux-kernel

On Thu, 22 May 2025, Haixiao Yan wrote:
> On 2025/5/22 07:32, NeilBrown wrote:
> > CAUTION: This email comes from a non Wind River email account!
> > Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> > On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
> >> On linux-5.10.y, my testcase run failed:
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> >> mount.nfs: requested NFS version or transport protocol is not supported
> >>
> >> The first bad commit is:
> >>
> >> commit 7229200f68662660bb4d55f19247eaf3c79a4217
> >> Author: Chuck Lever <chuck.lever@oracle.com>
> >> Date:   Mon Jun 3 10:35:02 2024 -0400
> >>
> >>     nfsd: don't allow nfsd threads to be signalled.
> >>
> >>     [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
> >>
> >>
> >> Here is the test log:
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
> >> 100+0 records in
> >> 100+0 records out
> >> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
> >> mke2fs 1.46.1 (9-Feb-2021)
> >> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
> >> Creating filesystem with 102400 1k blocks and 25688 inodes
> >> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
> >> Superblock backups stored on blocks:
> >>        8193, 24577, 40961, 57345, 73729
> >>
> >> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
> >>
> >> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
> >> stopping mountd: done
> >> stopping nfsd: ..........failed
> >>    using signal 9:
> >> ..........failed
> > What does your "nfsserver" script do to try to stop/restart the nfsd?
> > For a very long time the approved way to stop nfsd has been to run
> > "rpc.nfsd 0".  My guess is that whatever script you are using still
> > trying to send a signal to nfsd.  That no longer works.
> >
> > Unfortunately the various sysv-init scripts for starting/stopping nfsd
> > have never been part of nfs-utils so we were not able to update them.
> > nfs-utils *does* contain systemd unit files for sites which use systemd.
> >
> > If you have a non-systemd way of starting/stopping nfsd, we would be
> > happy to make the relevant scripts part of nfs-utils so that we can
> > ensure they stay up to date.
> 
> Actually, we use  service nfsserver restart  =>
> /etc/init.d/nfsserver =>
> 
> stop_nfsd(){
>      # WARNING: this kills any process with the executable
>      # name 'nfsd'.
>      echo -n 'stopping nfsd: '
>      start-stop-daemon --stop --quiet --signal 1 --name nfsd
>      if delay_nfsd || {
>          echo failed
>          echo ' using signal 9: '
>          start-stop-daemon --stop --quiet --signal 9 --name nfsd
>          delay_nfsd
>      }
>      then
>          echo done
>      else
>          echo failed
>      fi
The above should all be changed to
   echo -n 'stopping nfsd: '
   rpc.nfsd 0
   echo done

or similar.  What distro are you using?

I can't see how this would affect your problem with IPv6 but it would be
nice if you could confirm that IPv6 still doesn't work even after
changing the above.
What version of nfs-utils are you using?
Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?

NeilBrown


> }
> 
> Thanks,
> 
> Haixiao
> 
> > Thanks,
> > NeilBrown
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-22 23:21     ` NeilBrown
@ 2025-05-23  6:52       ` Yan, Haixiao (CN)
  2025-05-23  7:42         ` NeilBrown
  0 siblings, 1 reply; 10+ messages in thread
From: Yan, Haixiao (CN) @ 2025-05-23  6:52 UTC (permalink / raw)
  To: NeilBrown; +Cc: chuck.lever, stable, linux-kernel


On 5/23/2025 7:21 AM, NeilBrown wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Thu, 22 May 2025, Haixiao Yan wrote:
>> On 2025/5/22 07:32, NeilBrown wrote:
>>> CAUTION: This email comes from a non Wind River email account!
>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>
>>> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
>>>> On linux-5.10.y, my testcase run failed:
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
>>>> mount.nfs: requested NFS version or transport protocol is not supported
>>>>
>>>> The first bad commit is:
>>>>
>>>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
>>>> Author: Chuck Lever <chuck.lever@oracle.com>
>>>> Date:   Mon Jun 3 10:35:02 2024 -0400
>>>>
>>>>      nfsd: don't allow nfsd threads to be signalled.
>>>>
>>>>      [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
>>>>
>>>>
>>>> Here is the test log:
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
>>>> 100+0 records in
>>>> 100+0 records out
>>>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
>>>> mke2fs 1.46.1 (9-Feb-2021)
>>>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
>>>> Creating filesystem with 102400 1k blocks and 25688 inodes
>>>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
>>>> Superblock backups stored on blocks:
>>>>         8193, 24577, 40961, 57345, 73729
>>>>
>>>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
>>>>
>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
>>>> stopping mountd: done
>>>> stopping nfsd: ..........failed
>>>>     using signal 9:
>>>> ..........failed
>>> What does your "nfsserver" script do to try to stop/restart the nfsd?
>>> For a very long time the approved way to stop nfsd has been to run
>>> "rpc.nfsd 0".  My guess is that whatever script you are using still
>>> trying to send a signal to nfsd.  That no longer works.
>>>
>>> Unfortunately the various sysv-init scripts for starting/stopping nfsd
>>> have never been part of nfs-utils so we were not able to update them.
>>> nfs-utils *does* contain systemd unit files for sites which use systemd.
>>>
>>> If you have a non-systemd way of starting/stopping nfsd, we would be
>>> happy to make the relevant scripts part of nfs-utils so that we can
>>> ensure they stay up to date.
>> Actually, we use  service nfsserver restart  =>
>> /etc/init.d/nfsserver =>
>>
>> stop_nfsd(){
>>       # WARNING: this kills any process with the executable
>>       # name 'nfsd'.
>>       echo -n 'stopping nfsd: '
>>       start-stop-daemon --stop --quiet --signal 1 --name nfsd
>>       if delay_nfsd || {
>>           echo failed
>>           echo ' using signal 9: '
>>           start-stop-daemon --stop --quiet --signal 9 --name nfsd
>>           delay_nfsd
>>       }
>>       then
>>           echo done
>>       else
>>           echo failed
>>       fi
> The above should all be changed to
>     echo -n 'stopping nfsd: '
>     rpc.nfsd 0
>     echo done
>
> or similar.  What distro are you using?
>
> I can't see how this would affect your problem with IPv6 but it would be
> nice if you could confirm that IPv6 still doesn't work even after
> changing the above.
> What version of nfs-utils are you using?
> Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?
>
> NeilBrown
>
It works as expected.

My distro is Yocto and nfs-utils 2.5.3.

Thanks,

Haixiao

>> }
>>
>> Thanks,
>>
>> Haixiao
>>
>>> Thanks,
>>> NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-23  6:52       ` Yan, Haixiao (CN)
@ 2025-05-23  7:42         ` NeilBrown
  2025-05-23  9:00           ` Yan, Haixiao (CN)
  0 siblings, 1 reply; 10+ messages in thread
From: NeilBrown @ 2025-05-23  7:42 UTC (permalink / raw)
  To: Yan, Haixiao (CN); +Cc: chuck.lever, stable, linux-kernel

On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
> On 5/23/2025 7:21 AM, NeilBrown wrote:
> > CAUTION: This email comes from a non Wind River email account!
> > Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> > On Thu, 22 May 2025, Haixiao Yan wrote:
> >> On 2025/5/22 07:32, NeilBrown wrote:
> >>> CAUTION: This email comes from a non Wind River email account!
> >>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >>>
> >>> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
> >>>> On linux-5.10.y, my testcase run failed:
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> >>>> mount.nfs: requested NFS version or transport protocol is not supported
> >>>>
> >>>> The first bad commit is:
> >>>>
> >>>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
> >>>> Author: Chuck Lever <chuck.lever@oracle.com>
> >>>> Date:   Mon Jun 3 10:35:02 2024 -0400
> >>>>
> >>>>      nfsd: don't allow nfsd threads to be signalled.
> >>>>
> >>>>      [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
> >>>>
> >>>>
> >>>> Here is the test log:
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
> >>>> 100+0 records in
> >>>> 100+0 records out
> >>>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
> >>>> mke2fs 1.46.1 (9-Feb-2021)
> >>>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
> >>>> Creating filesystem with 102400 1k blocks and 25688 inodes
> >>>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
> >>>> Superblock backups stored on blocks:
> >>>>         8193, 24577, 40961, 57345, 73729
> >>>>
> >>>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
> >>>>
> >>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
> >>>> stopping mountd: done
> >>>> stopping nfsd: ..........failed
> >>>>     using signal 9:
> >>>> ..........failed
> >>> What does your "nfsserver" script do to try to stop/restart the nfsd?
> >>> For a very long time the approved way to stop nfsd has been to run
> >>> "rpc.nfsd 0".  My guess is that whatever script you are using still
> >>> trying to send a signal to nfsd.  That no longer works.
> >>>
> >>> Unfortunately the various sysv-init scripts for starting/stopping nfsd
> >>> have never been part of nfs-utils so we were not able to update them.
> >>> nfs-utils *does* contain systemd unit files for sites which use systemd.
> >>>
> >>> If you have a non-systemd way of starting/stopping nfsd, we would be
> >>> happy to make the relevant scripts part of nfs-utils so that we can
> >>> ensure they stay up to date.
> >> Actually, we use  service nfsserver restart  =>
> >> /etc/init.d/nfsserver =>
> >>
> >> stop_nfsd(){
> >>       # WARNING: this kills any process with the executable
> >>       # name 'nfsd'.
> >>       echo -n 'stopping nfsd: '
> >>       start-stop-daemon --stop --quiet --signal 1 --name nfsd
> >>       if delay_nfsd || {
> >>           echo failed
> >>           echo ' using signal 9: '
> >>           start-stop-daemon --stop --quiet --signal 9 --name nfsd
> >>           delay_nfsd
> >>       }
> >>       then
> >>           echo done
> >>       else
> >>           echo failed
> >>       fi
> > The above should all be changed to
> >     echo -n 'stopping nfsd: '
> >     rpc.nfsd 0
> >     echo done
> >
> > or similar.  What distro are you using?
> >
> > I can't see how this would affect your problem with IPv6 but it would be
> > nice if you could confirm that IPv6 still doesn't work even after
> > changing the above.
> > What version of nfs-utils are you using?
> > Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?
> >
> > NeilBrown
> >
> It works as expected.
> 
> My distro is Yocto and nfs-utils 2.5.3.

Thanks.  I've sent a patch to openembedded to change the nfsserver
script.

Can you make the change to nfsserver and let me know if it fixes your
problem?

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-23  7:42         ` NeilBrown
@ 2025-05-23  9:00           ` Yan, Haixiao (CN)
  2025-05-23 12:13             ` NeilBrown
  0 siblings, 1 reply; 10+ messages in thread
From: Yan, Haixiao (CN) @ 2025-05-23  9:00 UTC (permalink / raw)
  To: NeilBrown; +Cc: chuck.lever, stable, linux-kernel


On 5/23/2025 3:42 PM, NeilBrown wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
>> On 5/23/2025 7:21 AM, NeilBrown wrote:
>>> CAUTION: This email comes from a non Wind River email account!
>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>
>>> On Thu, 22 May 2025, Haixiao Yan wrote:
>>>> On 2025/5/22 07:32, NeilBrown wrote:
>>>>> CAUTION: This email comes from a non Wind River email account!
>>>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>>>
>>>>> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
>>>>>> On linux-5.10.y, my testcase run failed:
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
>>>>>> mount.nfs: requested NFS version or transport protocol is not supported
>>>>>>
>>>>>> The first bad commit is:
>>>>>>
>>>>>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
>>>>>> Author: Chuck Lever <chuck.lever@oracle.com>
>>>>>> Date:   Mon Jun 3 10:35:02 2024 -0400
>>>>>>
>>>>>>       nfsd: don't allow nfsd threads to be signalled.
>>>>>>
>>>>>>       [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
>>>>>>
>>>>>>
>>>>>> Here is the test log:
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
>>>>>> 100+0 records in
>>>>>> 100+0 records out
>>>>>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
>>>>>> mke2fs 1.46.1 (9-Feb-2021)
>>>>>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
>>>>>> Creating filesystem with 102400 1k blocks and 25688 inodes
>>>>>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
>>>>>> Superblock backups stored on blocks:
>>>>>>          8193, 24577, 40961, 57345, 73729
>>>>>>
>>>>>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
>>>>>>
>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
>>>>>> stopping mountd: done
>>>>>> stopping nfsd: ..........failed
>>>>>>      using signal 9:
>>>>>> ..........failed
>>>>> What does your "nfsserver" script do to try to stop/restart the nfsd?
>>>>> For a very long time the approved way to stop nfsd has been to run
>>>>> "rpc.nfsd 0".  My guess is that whatever script you are using still
>>>>> trying to send a signal to nfsd.  That no longer works.
>>>>>
>>>>> Unfortunately the various sysv-init scripts for starting/stopping nfsd
>>>>> have never been part of nfs-utils so we were not able to update them.
>>>>> nfs-utils *does* contain systemd unit files for sites which use systemd.
>>>>>
>>>>> If you have a non-systemd way of starting/stopping nfsd, we would be
>>>>> happy to make the relevant scripts part of nfs-utils so that we can
>>>>> ensure they stay up to date.
>>>> Actually, we use  service nfsserver restart  =>
>>>> /etc/init.d/nfsserver =>
>>>>
>>>> stop_nfsd(){
>>>>        # WARNING: this kills any process with the executable
>>>>        # name 'nfsd'.
>>>>        echo -n 'stopping nfsd: '
>>>>        start-stop-daemon --stop --quiet --signal 1 --name nfsd
>>>>        if delay_nfsd || {
>>>>            echo failed
>>>>            echo ' using signal 9: '
>>>>            start-stop-daemon --stop --quiet --signal 9 --name nfsd
>>>>            delay_nfsd
>>>>        }
>>>>        then
>>>>            echo done
>>>>        else
>>>>            echo failed
>>>>        fi
>>> The above should all be changed to
>>>      echo -n 'stopping nfsd: '
>>>      rpc.nfsd 0
>>>      echo done
>>>
>>> or similar.  What distro are you using?
>>>
>>> I can't see how this would affect your problem with IPv6 but it would be
>>> nice if you could confirm that IPv6 still doesn't work even after
>>> changing the above.
>>> What version of nfs-utils are you using?
>>> Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?
>>>
>>> NeilBrown
>>>
>> It works as expected.
>>
>> My distro is Yocto and nfs-utils 2.5.3.
> Thanks.  I've sent a patch to openembedded to change the nfsserver
> script.
>
> Can you make the change to nfsserver and let me know if it fixes your
> problem?

What's the version of your nfs-utils?

The patch failed to apply.

$ git am '[PATCH OE-core] nfs-utils don'\''t use signals to shut down 
nfs server. - '\''NeilBrown '\'' (neil@brown.name) - 2025-05-23 
1541.eml' Applying: nfs-utils: don't use signals to shut down nfs 
server. error: patch failed: 
meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver:89 error: 
meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver: patch does not 
apply Patch failed at 0001 nfs-utils: don't use signals to shut down nfs 
server. hint: Use 'git am --show-current-patch=diff' to see the failed 
patch When you have resolved this problem, run "git am --continue". If 
you prefer to skip this patch, run "git am --skip" instead. To restore 
the original branch and stop patching, run "git am --abort".

Thanks,

Haixiao

>
> Thanks,
> NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-23  9:00           ` Yan, Haixiao (CN)
@ 2025-05-23 12:13             ` NeilBrown
  2025-05-23 17:18               ` Yan, Haixiao (CN)
  0 siblings, 1 reply; 10+ messages in thread
From: NeilBrown @ 2025-05-23 12:13 UTC (permalink / raw)
  To: Yan, Haixiao (CN); +Cc: chuck.lever, stable, linux-kernel

On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
> On 5/23/2025 3:42 PM, NeilBrown wrote:
> > CAUTION: This email comes from a non Wind River email account!
> > Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> > On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
> >> On 5/23/2025 7:21 AM, NeilBrown wrote:
> >>> CAUTION: This email comes from a non Wind River email account!
> >>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >>>
> >>> On Thu, 22 May 2025, Haixiao Yan wrote:
> >>>> On 2025/5/22 07:32, NeilBrown wrote:
> >>>>> CAUTION: This email comes from a non Wind River email account!
> >>>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >>>>>
> >>>>> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
> >>>>>> On linux-5.10.y, my testcase run failed:
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
> >>>>>> mount.nfs: requested NFS version or transport protocol is not supported
> >>>>>>
> >>>>>> The first bad commit is:
> >>>>>>
> >>>>>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
> >>>>>> Author: Chuck Lever <chuck.lever@oracle.com>
> >>>>>> Date:   Mon Jun 3 10:35:02 2024 -0400
> >>>>>>
> >>>>>>       nfsd: don't allow nfsd threads to be signalled.
> >>>>>>
> >>>>>>       [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
> >>>>>>
> >>>>>>
> >>>>>> Here is the test log:
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
> >>>>>> 100+0 records in
> >>>>>> 100+0 records out
> >>>>>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
> >>>>>> mke2fs 1.46.1 (9-Feb-2021)
> >>>>>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
> >>>>>> Creating filesystem with 102400 1k blocks and 25688 inodes
> >>>>>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
> >>>>>> Superblock backups stored on blocks:
> >>>>>>          8193, 24577, 40961, 57345, 73729
> >>>>>>
> >>>>>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>>>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>>>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
> >>>>>>
> >>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
> >>>>>> stopping mountd: done
> >>>>>> stopping nfsd: ..........failed
> >>>>>>      using signal 9:
> >>>>>> ..........failed
> >>>>> What does your "nfsserver" script do to try to stop/restart the nfsd?
> >>>>> For a very long time the approved way to stop nfsd has been to run
> >>>>> "rpc.nfsd 0".  My guess is that whatever script you are using still
> >>>>> trying to send a signal to nfsd.  That no longer works.
> >>>>>
> >>>>> Unfortunately the various sysv-init scripts for starting/stopping nfsd
> >>>>> have never been part of nfs-utils so we were not able to update them.
> >>>>> nfs-utils *does* contain systemd unit files for sites which use systemd.
> >>>>>
> >>>>> If you have a non-systemd way of starting/stopping nfsd, we would be
> >>>>> happy to make the relevant scripts part of nfs-utils so that we can
> >>>>> ensure they stay up to date.
> >>>> Actually, we use  service nfsserver restart  =>
> >>>> /etc/init.d/nfsserver =>
> >>>>
> >>>> stop_nfsd(){
> >>>>        # WARNING: this kills any process with the executable
> >>>>        # name 'nfsd'.
> >>>>        echo -n 'stopping nfsd: '
> >>>>        start-stop-daemon --stop --quiet --signal 1 --name nfsd
> >>>>        if delay_nfsd || {
> >>>>            echo failed
> >>>>            echo ' using signal 9: '
> >>>>            start-stop-daemon --stop --quiet --signal 9 --name nfsd
> >>>>            delay_nfsd
> >>>>        }
> >>>>        then
> >>>>            echo done
> >>>>        else
> >>>>            echo failed
> >>>>        fi
> >>> The above should all be changed to
> >>>      echo -n 'stopping nfsd: '
> >>>      rpc.nfsd 0
> >>>      echo done
> >>>
> >>> or similar.  What distro are you using?
> >>>
> >>> I can't see how this would affect your problem with IPv6 but it would be
> >>> nice if you could confirm that IPv6 still doesn't work even after
> >>> changing the above.
> >>> What version of nfs-utils are you using?
> >>> Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?
> >>>
> >>> NeilBrown
> >>>
> >> It works as expected.
> >>
> >> My distro is Yocto and nfs-utils 2.5.3.
> > Thanks.  I've sent a patch to openembedded to change the nfsserver
> > script.
> >
> > Can you make the change to nfsserver and let me know if it fixes your
> > problem?
> 
> What's the version of your nfs-utils?

The patch isn't against nfs-utils.  It is against openembedded-core
   https://git.openembedded.org/openembedded-core
which is what yocto is based on.

I was expecting you to manually edit /etc/init.d/nfsserver to make the
changes.
Or you could possibly:

  patch /etc/init.d/nfssever < THE-PATCH

NeilBrown


> 
> The patch failed to apply.
> 
> $ git am '[PATCH OE-core] nfs-utils don'\''t use signals to shut down 
> nfs server. - '\''NeilBrown '\'' (neil@brown.name) - 2025-05-23 
> 1541.eml' Applying: nfs-utils: don't use signals to shut down nfs 
> server. error: patch failed: 
> meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver:89 error: 
> meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver: patch does not 
> apply Patch failed at 0001 nfs-utils: don't use signals to shut down nfs 
> server. hint: Use 'git am --show-current-patch=diff' to see the failed 
> patch When you have resolved this problem, run "git am --continue". If 
> you prefer to skip this patch, run "git am --skip" instead. To restore 
> the original branch and stop patching, run "git am --abort".
> 
> Thanks,
> 
> Haixiao
> 
> >
> > Thanks,
> > NeilBrown
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: nfs mount failed with ipv6 addr
  2025-05-23 12:13             ` NeilBrown
@ 2025-05-23 17:18               ` Yan, Haixiao (CN)
  0 siblings, 0 replies; 10+ messages in thread
From: Yan, Haixiao (CN) @ 2025-05-23 17:18 UTC (permalink / raw)
  To: NeilBrown; +Cc: chuck.lever, stable, linux-kernel


On 5/23/2025 8:13 PM, NeilBrown wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
>> On 5/23/2025 3:42 PM, NeilBrown wrote:
>>> CAUTION: This email comes from a non Wind River email account!
>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>
>>> On Fri, 23 May 2025, Yan, Haixiao (CN) wrote:
>>>> On 5/23/2025 7:21 AM, NeilBrown wrote:
>>>>> CAUTION: This email comes from a non Wind River email account!
>>>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>>>
>>>>> On Thu, 22 May 2025, Haixiao Yan wrote:
>>>>>> On 2025/5/22 07:32, NeilBrown wrote:
>>>>>>> CAUTION: This email comes from a non Wind River email account!
>>>>>>> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>>>>>>
>>>>>>> On Thu, 22 May 2025, Yan, Haixiao (CN) wrote:
>>>>>>>> On linux-5.10.y, my testcase run failed:
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount -t nfs [::1]:/mnt/nfs_root /mnt/v6 -o nfsvers=3
>>>>>>>> mount.nfs: requested NFS version or transport protocol is not supported
>>>>>>>>
>>>>>>>> The first bad commit is:
>>>>>>>>
>>>>>>>> commit 7229200f68662660bb4d55f19247eaf3c79a4217
>>>>>>>> Author: Chuck Lever <chuck.lever@oracle.com>
>>>>>>>> Date:   Mon Jun 3 10:35:02 2024 -0400
>>>>>>>>
>>>>>>>>        nfsd: don't allow nfsd threads to be signalled.
>>>>>>>>
>>>>>>>>        [ Upstream commit 3903902401451b1cd9d797a8c79769eb26ac7fe5 ]
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is the test log:
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# dd if=/dev/zero of=/tmp/nfs.img bs=1M count=100
>>>>>>>> 100+0 records in
>>>>>>>> 100+0 records out
>>>>>>>> 104857600 bytes (105 MB, 100 MiB) copied, 0.0386658 s, 2.7 GB/s
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkfs /tmp/nfs.img
>>>>>>>> mke2fs 1.46.1 (9-Feb-2021)
>>>>>>>> Discarding device blocks:   1024/102400\b\b\b\b\b\b\b\b\b\b\b\b\b             \b\b\b\b\b\b\b\b\b\b\b\b\bdone
>>>>>>>> Creating filesystem with 102400 1k blocks and 25688 inodes
>>>>>>>> Filesystem UUID: 77e3bc56-46bb-4e5c-9619-d9a0c0999958
>>>>>>>> Superblock backups stored on blocks:
>>>>>>>>           8193, 24577, 40961, 57345, 73729
>>>>>>>>
>>>>>>>> Allocating group tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>>>> Writing inode tables:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>>>> Writing superblocks and filesystem accounting information:  0/13\b\b\b\b\b     \b\b\b\b\bdone
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mount /tmp/nfs.img /mnt
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# mkdir /mnt/nfs_root
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# touch /etc/exports
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# echo '/mnt/nfs_root *(insecure,rw,async,no_root_squash)' >> /etc/exports
>>>>>>>>
>>>>>>>> root@intel-x86-64:/opt/wr-test/testcases/userspace/nfs-utils_v6# /opt/wr-test/bin/svcwp.sh nfsserver restart
>>>>>>>> stopping mountd: done
>>>>>>>> stopping nfsd: ..........failed
>>>>>>>>       using signal 9:
>>>>>>>> ..........failed
>>>>>>> What does your "nfsserver" script do to try to stop/restart the nfsd?
>>>>>>> For a very long time the approved way to stop nfsd has been to run
>>>>>>> "rpc.nfsd 0".  My guess is that whatever script you are using still
>>>>>>> trying to send a signal to nfsd.  That no longer works.
>>>>>>>
>>>>>>> Unfortunately the various sysv-init scripts for starting/stopping nfsd
>>>>>>> have never been part of nfs-utils so we were not able to update them.
>>>>>>> nfs-utils *does* contain systemd unit files for sites which use systemd.
>>>>>>>
>>>>>>> If you have a non-systemd way of starting/stopping nfsd, we would be
>>>>>>> happy to make the relevant scripts part of nfs-utils so that we can
>>>>>>> ensure they stay up to date.
>>>>>> Actually, we use  service nfsserver restart  =>
>>>>>> /etc/init.d/nfsserver =>
>>>>>>
>>>>>> stop_nfsd(){
>>>>>>         # WARNING: this kills any process with the executable
>>>>>>         # name 'nfsd'.
>>>>>>         echo -n 'stopping nfsd: '
>>>>>>         start-stop-daemon --stop --quiet --signal 1 --name nfsd
>>>>>>         if delay_nfsd || {
>>>>>>             echo failed
>>>>>>             echo ' using signal 9: '
>>>>>>             start-stop-daemon --stop --quiet --signal 9 --name nfsd
>>>>>>             delay_nfsd
>>>>>>         }
>>>>>>         then
>>>>>>             echo done
>>>>>>         else
>>>>>>             echo failed
>>>>>>         fi
>>>>> The above should all be changed to
>>>>>       echo -n 'stopping nfsd: '
>>>>>       rpc.nfsd 0
>>>>>       echo done
>>>>>
>>>>> or similar.  What distro are you using?
>>>>>
>>>>> I can't see how this would affect your problem with IPv6 but it would be
>>>>> nice if you could confirm that IPv6 still doesn't work even after
>>>>> changing the above.
>>>>> What version of nfs-utils are you using?
>>>>> Are you should that the kernel has IPv6 enabled?  Does "ping6 ::1" work?
>>>>>
>>>>> NeilBrown
>>>>>
>>>> It works as expected.
>>>>
>>>> My distro is Yocto and nfs-utils 2.5.3.
>>> Thanks.  I've sent a patch to openembedded to change the nfsserver
>>> script.
>>>
>>> Can you make the change to nfsserver and let me know if it fixes your
>>> problem?
>> What's the version of your nfs-utils?
> The patch isn't against nfs-utils.  It is against openembedded-core
>     https://git.openembedded.org/openembedded-core
> which is what yocto is based on.
>
> I was expecting you to manually edit /etc/init.d/nfsserver to make the
> changes.
> Or you could possibly:
>
>    patch /etc/init.d/nfssever < THE-PATCH
>
> NeilBrown
>
I have verified the patch, it works as expected.

$ cat 0001-nfs-utils-don-t-use-signals-to-shut-down-nfs-server.patch

 From d99df205d0aca0703a49834df39435442044433b Mon Sep 17 00:00:00 2001
From: NeilBrown <neil@brown.name>
Date: Fri, 23 May 2025 23:58:09 +0800
Subject: [PATCH] nfs-utils: don't use signals to shut down nfs server

Since Linux v2.4 it has been possible to stop all NFS server by running

    rpc.nfsd 0

i.e.  by requesting that zero threads be running.  This is preferred as
it doesn't risk killing some other process which happens to be called
"nfsd".

Since Linux v6.6 - and other stable kernels to which

   Commit: 390390240145 ("nfsd: don't allow nfsd threads to be
   signalled.")

has been backported - sending a signal no longer works to stop nfs server
threads.

This patch changes the nfsserver script to use "rpc.nfsd 0" to stop
server threads.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
---
  .../nfs-utils/nfs-utils/nfsserver             | 28 +++----------------
  1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver 
b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index 0f5747cc6db9..053980271c05 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -66,34 +66,14 @@ start_nfsd(){
      start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
      echo done
  }
-delay_nfsd(){
-    for delay in 0 1 2 3 4 5 6 7 8 9
-    do
-        if pidof nfsd >/dev/null
-        then
-            echo -n .
-            sleep 1
-        else
-            return 0
-        fi
-    done
-    return 1
-}
  stop_nfsd(){
-    # WARNING: this kills any process with the executable
-    # name 'nfsd'.
      echo -n 'stopping nfsd: '
-    start-stop-daemon --stop --quiet --signal 1 --name nfsd
-    if delay_nfsd || {
-        echo failed
-        echo ' using signal 9: '
-        start-stop-daemon --stop --quiet --signal 9 --name nfsd
-        delay_nfsd
-    }
+    $NFS_NFSD 0
+    if pidof nfsd
      then
-        echo done
-    else
          echo failed
+    else
+      echo done
      fi
  }

-- 
2.34.1


Thanks,

Haixiao

>> The patch failed to apply.
>>
>> $ git am '[PATCH OE-core] nfs-utils don'\''t use signals to shut down
>> nfs server. - '\''NeilBrown '\'' (neil@brown.name) - 2025-05-23
>> 1541.eml' Applying: nfs-utils: don't use signals to shut down nfs
>> server. error: patch failed:
>> meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver:89 error:
>> meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver: patch does not
>> apply Patch failed at 0001 nfs-utils: don't use signals to shut down nfs
>> server. hint: Use 'git am --show-current-patch=diff' to see the failed
>> patch When you have resolved this problem, run "git am --continue". If
>> you prefer to skip this patch, run "git am --skip" instead. To restore
>> the original branch and stop patching, run "git am --abort".
>>
>> Thanks,
>>
>> Haixiao
>>
>>> Thanks,
>>> NeilBrown

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-05-23 17:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-21 14:11 nfs mount failed with ipv6 addr Yan, Haixiao (CN)
2025-05-21 15:03 ` Chuck Lever
2025-05-21 23:32 ` NeilBrown
2025-05-22  4:35   ` Haixiao Yan
2025-05-22 23:21     ` NeilBrown
2025-05-23  6:52       ` Yan, Haixiao (CN)
2025-05-23  7:42         ` NeilBrown
2025-05-23  9:00           ` Yan, Haixiao (CN)
2025-05-23 12:13             ` NeilBrown
2025-05-23 17:18               ` Yan, Haixiao (CN)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®