Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2154391ybm; Thu, 23 May 2019 12:15:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHWT/K0XTX6DGMdJSOfvX/esCJkPk666DFAjkK1+vZ+tKL0830a/VL5CxYYYkvuk41abdu X-Received: by 2002:aa7:880f:: with SMTP id c15mr10936668pfo.100.1558638918067; Thu, 23 May 2019 12:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638918; cv=none; d=google.com; s=arc-20160816; b=lXSuNa0v/YnpvYfZ1uveuqguRo0QK4TG98YbZ3+AvvvR3h5eRqw+UO++fOzVOeW0LN bhVq67wve3/Ay48mL9vnsUbK3TCpkbdIZA39QCgyNSV7kbxRCm5GhY9LU3ANk5sYX+Rb 3/pW+WettlfGU6Asq4UFMY/A3xi6tZqmZbsG92fGOcsnElbf/ywLnsajpEq145i992Jc QUMf3gVMD04J/oGB3qTMYRV4DPxYjwQMRlgjF5tP3UODCu7J2AyQpWihKHkmuL9sN6aM wKp/CtgRsBtx1aLW/wsda5lRItDvyZ4Jq5zT5JKq7M1ikSNfVU6y9tnLJxIUgRbv87k3 F7jg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y3Hld4K2abI2EtoqSbgIPAj0Z5X4IZCyAdsTmbzEj7o=; b=S7LQMeoQFwDGWh9zVOI4KOFwx1dDuaNXUae1Y7Dke1jMiRirqbAaYc8MmC1/Gf/Fg9 R4r7/bI+wqgXrvcPxwO3xssHnFoUB1RuO9tJVqLN9EcHN2YAUe3/GJUInFKTePHqQQWH Izu1tUINi/hROhqUBarPEZ3ai2nWolUPlDRmvYXXHPzQjgu6Yel2VSDIZehnEuJZXACK pbxfUe3d+UnISmrk2Gibpk+iXq7kLCsJ/Bg6YFIXilYIxG1yzY6Z9n5ymLKhTq8A3T9E IV/DYMubKgwJ1zk7FD0PRsyK2NZccEmFUctreueSJD/s4Wgi/4y8eVfVyFN1t9qwm8v8 A6KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nvGTqfZI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z19si306111pfc.265.2019.05.23.12.15.02; Thu, 23 May 2019 12:15:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nvGTqfZI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388353AbfEWTME (ORCPT + 99 others); Thu, 23 May 2019 15:12:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:45676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388313AbfEWTMB (ORCPT ); Thu, 23 May 2019 15:12:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F97421873; Thu, 23 May 2019 19:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638721; bh=SNM0Fl27uXWqQ5amLSxTAalRgg9QV1Z6TRqIcxX9UNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvGTqfZImYtcXVcm87oP35w0G5pMUONaQmCXxQugBRvBRtzs9ox460/+uOQ7X/Zy2 Na7uAj9OQ2iQGDC6vUjkqkWMcNOAPmW4QAMoSMalMAn5ngif7aVRBWqi9c722SXJEQ ZNwiZAwJINtLd+lfrydA6Hx59NSaapC++AtC1SPY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, ZhangXiaoxu , Anna Schumaker Subject: [PATCH 4.14 23/77] NFS4: Fix v4.0 client state corruption when mount Date: Thu, 23 May 2019 21:05:41 +0200 Message-Id: <20190523181723.530871339@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangXiaoxu commit f02f3755dbd14fb935d24b14650fff9ba92243b8 upstream. 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 Cc: stable@vger.kernel.org Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4state.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -143,6 +143,10 @@ int nfs40_discover_server_trunking(struc /* 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;