Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4655163yba; Sun, 12 May 2019 18:58:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKgs/x5hILGvzRkb6A+7vYRK0LpJr8xKnWDUSDDjYARFNFRBHSE9/J3DYeYclVGwLgT4w3 X-Received: by 2002:a62:8245:: with SMTP id w66mr29888090pfd.58.1557712704885; Sun, 12 May 2019 18:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557712704; cv=none; d=google.com; s=arc-20160816; b=GDU3JnhZ6BSZNXGRHd7+pDh/W5cWpHI1prJQgjJ2K3ebZni3kH4NfqzJ78cd9aCDc/ 2+qr93QZ+mSdqRfPv9OPcP0SDiAauvs96rGWu3VvTnEKr0PeJEQ06bM/wjmQFDntgLvV aAHWuecmFwLytX4Yd9GhEeWbaus6rEvwwxmylMJLFjBCju2mLsWDj7oTQcs2xKtqIYt1 HssT7hYF55Lbj/EQyM/n/rXnf8GrvEV+WMHIG5Vsng1z/Jvwoq2xvpHbHIhSlb/bKZNh bUpi3Jh8rRYOgs/QqhZUsKfShXeYc4HOg+0rllB7zkPF4skGhSCssMu2XMu70cqiRpBV 9jYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=B0X5L8/jwcNvSGglOKChn3qYwbmPvOJ2EFGcoa3uj7w=; b=ojUhU/daed2ZVdsa+IPnsGARXsfP5GPSnK7RDfdrYLH+bncjix5CKgxbOiLOxkBRsS l71r41MjP6rw4o4R4V7jyv1mTZ9seCnvu6p2VZL/K5dwVMl3X7SjJWuoUgyztM6ixPHx Kt0Cqmwjs6owCDh1CIRVQZUCI7HGvagJVfgnOt5ZWUCKh00twQarfdCMxXPBPlkC7/YJ mzLN5sYglz2RrCTVDaMiVuWnoZIUwIWn3siN9G1lJfkZ6Zo5nxbPq0wwvxTf9zX+cxLy 281DieKHn72bWQawJAOCPCl1kLv9lB3JP8uhiJlmk99bLveyRfhT0WNiLqLgFgQhFjat +vpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si16151025pfa.128.2019.05.12.18.58.11; Sun, 12 May 2019 18:58:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727183AbfEMBwS (ORCPT + 99 others); Sun, 12 May 2019 21:52:18 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7628 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727054AbfEMBwS (ORCPT ); Sun, 12 May 2019 21:52:18 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0ADC0248A3493BF3EB84; Mon, 13 May 2019 09:48:40 +0800 (CST) Received: from [127.0.0.1] (10.184.189.120) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Mon, 13 May 2019 09:48:36 +0800 Subject: Re: [PATCH] NFS4: Fix v4.0 client state corruption when mount To: , , References: <1557115023-86769-1-git-send-email-zhangxiaoxu5@huawei.com> From: "zhangxiaoxu (A)" Message-ID: <066b843e-33cc-e8a3-ad2b-f8d257d8a4df@huawei.com> Date: Mon, 13 May 2019 09:48:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1557115023-86769-1-git-send-email-zhangxiaoxu5@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.189.120] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org ping. On 5/6/2019 11:57 AM, ZhangXiaoxu wrote: > stat command with soft mount never return after server is stopped. > > When alloc a new client, the state of the client will be set to > NFS4CLNT_LEASE_EXPIRED. > > When the server is stopped, the state manager will work, and accord > the state to recover. But the state is NFS4CLNT_LEASE_EXPIRED, it > will drain the slot table and lead other task to wait queue, until > the client recovered. Then the stat command is hung. > > When discover server trunking, the client will renew the lease, > but check the client state, it lead the client state corruption. > > So, we need to call state manager to recover it when detect server > ip trunking. > > Signed-off-by: ZhangXiaoxu > --- > fs/nfs/nfs4state.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c > index 3de3647..f502f1c 100644 > --- a/fs/nfs/nfs4state.c > +++ b/fs/nfs/nfs4state.c > @@ -159,6 +159,10 @@ int nfs40_discover_server_trunking(struct nfs_client *clp, > /* Sustain the lease, even if it's empty. If the clientid4 > * goes stale it's of no use for trunking discovery. */ > nfs4_schedule_state_renewal(*result); > + > + /* If the client state need to recover, do it. */ > + if (clp->cl_state) > + nfs4_schedule_state_manager(clp); > } > out: > return status; >