All of lore.kernel.org
 help / color / mirror / Atom feed
* mounting NFS on the same host leads to D state
@ 2018-05-15  3:47 maowenan
  2018-05-16 10:37 ` maowenan
  0 siblings, 1 reply; 2+ messages in thread
From: maowenan @ 2018-05-15  3:47 UTC (permalink / raw)
  To: netdev, jlayton, linux-nfs; +Cc: yangerkun, weiyongjun (A)

Hi,

Recently I have tested NFS and exportfs scenario,
that NFS server and client are in the same host.
And I found mounting NFS filesystm onto the same host
can lead to rpc.mountd and related task become D state.
My kernel version is based on 3.10, and I find 4.15 has the same
appearance.

My test step as below:
1)create dir.
mkdir -p /home/test1 /home/test2
2)share dir /home/test1
echo '/home/test1 localhost(rw,all_squash,anonuid=0,anongid=0)' > /etc/exports
3)exportfs
exportfs -vr || echo "Failed to export /home/test1"
4)mount NFS.
mount localhost:/home/test1 /home/test2 -o vers=3,soft
5)share dir /home/test2
echo '/home/test2 *(rw,all_squash,anonuid=0,anongid=0)' >> /etc/exports
6)exportfs
exportfs -vr
7) list /home/test2
ls /home/test2
then we found ls command is hung, ls and rpc.mountd became "D" state, and after
180 second ls command return.

Another scenario as below:
1)create dir.
mkdir -p /home/test3 /home/test4
2)share dir /home/test3
echo '/home/test3 localhost(rw,sync,no_wdelay,anonuid=0,anongid=0,no_subtree_check)' > /etc/exports
3)exportfs
exportfs -r
4)to see NFS status
showmount -e localhost
5)mount NFS
mount -t nfs4 -o proto=tcp,nolock,soft,timeo=50 localhost:/home/test3 /home/test4
6) stop nfs service,and  and check ls task state is D.
service nfs stop
ls /home/test4
ls command is hung and became D state.

I wonder to know is it reasonable about these test scenario because NFS server and
client are in the same host? Since some task went into D state, is there any reason about this?
and is there any patch to fix this issue?
Here is a link to talk about NFS mounting on the same host,  https://lwn.net/Articles/595652/

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

* Re: mounting NFS on the same host leads to D state
  2018-05-15  3:47 mounting NFS on the same host leads to D state maowenan
@ 2018-05-16 10:37 ` maowenan
  0 siblings, 0 replies; 2+ messages in thread
From: maowenan @ 2018-05-16 10:37 UTC (permalink / raw)
  To: netdev, jlayton, linux-nfs, Eric Dumazet; +Cc: yangerkun, weiyongjun (A)

Hi,

I have tested in recent version 4.16 rc7 and find it also has the same issue.
@Eric do you have any comments about this nfs issue?

On 2018/5/15 11:47, maowenan wrote:
> Hi,
> 
> Recently I have tested NFS and exportfs scenario,
> that NFS server and client are in the same host.
> And I found mounting NFS filesystm onto the same host
> can lead to rpc.mountd and related task become D state.
> My kernel version is based on 3.10, and I find 4.15 has the same
> appearance.
> 
> My test step as below:
> 1)create dir.
> mkdir -p /home/test1 /home/test2
> 2)share dir /home/test1
> echo '/home/test1 localhost(rw,all_squash,anonuid=0,anongid=0)' > /etc/exports
> 3)exportfs
> exportfs -vr || echo "Failed to export /home/test1"
> 4)mount NFS.
> mount localhost:/home/test1 /home/test2 -o vers=3,soft
> 5)share dir /home/test2
> echo '/home/test2 *(rw,all_squash,anonuid=0,anongid=0)' >> /etc/exports
> 6)exportfs
> exportfs -vr
> 7) list /home/test2
> ls /home/test2
> then we found ls command is hung, ls and rpc.mountd became "D" state, and after
> 180 second ls command return.
> 
> Another scenario as below:
> 1)create dir.
> mkdir -p /home/test3 /home/test4
> 2)share dir /home/test3
> echo '/home/test3 localhost(rw,sync,no_wdelay,anonuid=0,anongid=0,no_subtree_check)' > /etc/exports
> 3)exportfs
> exportfs -r
> 4)to see NFS status
> showmount -e localhost
> 5)mount NFS
> mount -t nfs4 -o proto=tcp,nolock,soft,timeo=50 localhost:/home/test3 /home/test4
> 6) stop nfs service,and  and check ls task state is D.
> service nfs stop
> ls /home/test4
> ls command is hung and became D state.
> 
> I wonder to know is it reasonable about these test scenario because NFS server and
> client are in the same host? Since some task went into D state, is there any reason about this?
> and is there any patch to fix this issue?
> Here is a link to talk about NFS mounting on the same host,  https://lwn.net/Articles/595652/
> 

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

end of thread, other threads:[~2018-05-16 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  3:47 mounting NFS on the same host leads to D state maowenan
2018-05-16 10:37 ` maowenan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.