Netdev List
 help / color / mirror / Atom feed
From: maowenan <maowenan@huawei.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	<jlayton@kernel.org>, <linux-nfs@vger.kernel.org>
Cc: <yangerkun@huawei.com>, "weiyongjun (A)" <weiyongjun1@huawei.co>
Subject: mounting NFS on the same host leads to D state
Date: Tue, 15 May 2018 11:47:46 +0800	[thread overview]
Message-ID: <737a947e-a53d-fcd2-bbc3-ca373bea6cb1@huawei.com> (raw)

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/

             reply	other threads:[~2018-05-15  3:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15  3:47 maowenan [this message]
2018-05-16 10:37 ` mounting NFS on the same host leads to D state maowenan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=737a947e-a53d-fcd2-bbc3-ca373bea6cb1@huawei.com \
    --to=maowenan@huawei.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=weiyongjun1@huawei.co \
    --cc=yangerkun@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox