From patchwork Wed Feb 23 18:16:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dai Ngo X-Patchwork-Id: 12757282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F36C433FE for ; Wed, 23 Feb 2022 18:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243730AbiBWSRT (ORCPT ); Wed, 23 Feb 2022 13:17:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243791AbiBWSRP (ORCPT ); Wed, 23 Feb 2022 13:17:15 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F17F3ED1F for ; Wed, 23 Feb 2022 10:16:48 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21NIDlBs029458; Wed, 23 Feb 2022 18:16:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2021-07-09; bh=eHrSfOzLuA/l3QfZyJUNjfB216919oN9sMyCE5alM58=; b=hYFMmXWAR22UtgtmejLiCbQV4HgtJ6XBt/f8pcWtZFqsqJC82r1rkkWXy4qBhvLnCOGQ /+UcoKnRV2aEGpd2pSTOytk3s6qWp1fjUhZLtB4r7Uz0G2Eu/G1A8M7jQQGyZ66Wt0SN wId4nnio1NuniMNaf3rssea/KmF0IEZzKDeKtmX2m7RAONZy/s1GkOaJm8KMLUumL50u CnaN2ZkNh33nZRehVt5eLGIbxWVoU7U4CGqjD9YOASnn0WSKZpXrBpfa8WQft2iT5qGZ GcWn/RDZvbKLfJjBjOphLoXpOZawy+UDYm4X/g0QwqMHR+jubQ7J930J5HG3xefFPO5T Iw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3ectsx54v2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Feb 2022 18:16:46 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21NIAtu8155939; Wed, 23 Feb 2022 18:16:46 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3030.oracle.com with ESMTP id 3eapkj17te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Feb 2022 18:16:46 +0000 Received: from aserp3030.oracle.com (aserp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 21NICxfk162308; Wed, 23 Feb 2022 18:16:45 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by aserp3030.oracle.com with ESMTP id 3eapkj17pe-11; Wed, 23 Feb 2022 18:16:45 +0000 From: Dai Ngo To: chuck.lever@oracle.com, bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v14 10/10] NFSD: Show state of courtesy clients in client info Date: Wed, 23 Feb 2022 10:16:37 -0800 Message-Id: <1645640197-1725-11-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1645640197-1725-1-git-send-email-dai.ngo@oracle.com> References: <1645640197-1725-1-git-send-email-dai.ngo@oracle.com> X-Proofpoint-ORIG-GUID: oLSa3pCi7FuAuOO9yySD7qYYYNbQsjIc X-Proofpoint-GUID: oLSa3pCi7FuAuOO9yySD7qYYYNbQsjIc Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Update client_info_show to show state of courtesy client and number of seconds since last renew. Signed-off-by: Dai Ngo --- fs/nfsd/nfs4state.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 282b8f040540..b2909ae816a8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2435,6 +2435,10 @@ static int client_info_show(struct seq_file *m, void *v) seq_puts(m, "status: confirmed\n"); else seq_puts(m, "status: unconfirmed\n"); + seq_printf(m, "courtesy client: %s\n", + test_bit(NFSD4_CLIENT_COURTESY, &clp->cl_flags) ? "yes" : "no"); + seq_printf(m, "seconds from last renew: %lld\n", + ktime_get_boottime_seconds() - clp->cl_time); seq_printf(m, "name: "); seq_quote_mem(m, clp->cl_name.data, clp->cl_name.len); seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion);