Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6842084rwb; Wed, 18 Jan 2023 10:01:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXu2lyVO4wKZ5TPSuLfCVbaXdLZ2ha76jSptC/w/ftrSV7FIlONVCtjjxrhRwrMJ3ksIx8Hb X-Received: by 2002:a05:6402:c41:b0:499:d0e3:7745 with SMTP id cs1-20020a0564020c4100b00499d0e37745mr9844220edb.14.1674064916085; Wed, 18 Jan 2023 10:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674064916; cv=none; d=google.com; s=arc-20160816; b=uACPES6AhCmoPrqSfwJzKCEB5RG44sqo/nlqyE49BxgpfqYll0/oxzOpdAQTBlHBk8 kPyf5ILyDkmJ567KoHIuCQhk2Y9s1Uc+CDycXKnFENoIhptzB2QICl/cyo3XuuoeCyRH v5k/JDzymVZwyRKvKJOPAKLucmSnMBJ3ww7xH5YHU48Bs6tOe7dNwFv1r/y/8AHfs5Dr Fnjx6fV+PzYUc+z54zJiwF6DcrE6bS3+tqH5uhxaJ2WWY4rcWDaTOl703QsJT4tK/qLF rNyHZMNVKKyhL8S+5RPaXi5KtxFAOhaOzHvkHxS9vhG/Tg1D+kEM+nmMPfr8HwpQ5ryg DCZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Epy+pt/D7gtCNGe4zN/gEO0rzjlfX8+uVJ3GXdDu0Z4=; b=VdEpDCm2/1wQPk/nfOU3YhxV6QwLkfBnIgSHHoQYJa70M1cLJqhL+sTMqmYChiVDqV gJr1pQKWCf6cWgQV9V5mHznU6trEk6/PWMOwEbq0BrM5m+OyAxMomQ4iF9ga3sgSFfyz IPPOCYvY04V3GTb7/7RZrxfImXb0NfanZZ5h6887fTfMKlPNDSF5H59sbV8iWgTwyvqI zxQAAqQnUwC4ZsFKnbUMbxzzcmfjaMMZiyAHbO+mnj9qvbNeTxuDVb2rIxdhvG/HGVV6 LWAOHPcFp3vQAwUHhb7ABMNuXB5LWC4S2tyaRUEAHMC1t1haXtQ4f6fCAJlzFs3STnbH SSHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i0jYTPVw; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020aa7cb8d000000b0047ae036876fsi33076534edt.59.2023.01.18.10.01.31; Wed, 18 Jan 2023 10:01:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i0jYTPVw; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbjARRyq (ORCPT + 99 others); Wed, 18 Jan 2023 12:54:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjARRyp (ORCPT ); Wed, 18 Jan 2023 12:54:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F124B4DE0A for ; Wed, 18 Jan 2023 09:54:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1C47B81E66 for ; Wed, 18 Jan 2023 17:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF42C433EF; Wed, 18 Jan 2023 17:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674064478; bh=P3+hdFuxKs8cOdds+IoqRIs0g0+EH5HWr6r2nvRh8DU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=i0jYTPVwyNdz3uDWngrYrJr5naO4viXyehgCy8M+Y2Ec614k0Dz0Agwpa0V3UoC8K 5ei80fg8+BpulZq96jx4b2l54F3vcNpNW6BFMdxs6BRw0eLjBaE559jjMOU0xWrCmK nsxitbJMu6wvZM3+/cx5KIlOo9ZkTeaHzUmquX2y2bKZCATzzQ7QjeKbLwvLYmId0/ AHn43t0/bOpqqwdDXZMTJOHMYvTEzMkT0lM/BcZLqhRRxjabapnpvlF5O6B94099wf UncafuNPeMTqGAzUkXQTn1UHXbd2kU8vOlutecRcBEYkHaSmrSAIr542YvvV//VmDk J67JJt8P1qS2Q== Message-ID: <951265d3954621086aa00d27c275e1d50d3e9586.camel@kernel.org> Subject: Re: [PATCH 3/4] nfsd: don't kill nfsd_files because of lease break error From: Jeff Layton To: chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org Date: Wed, 18 Jan 2023 12:54:36 -0500 In-Reply-To: <20230105121512.21484-4-jlayton@kernel.org> References: <20230105121512.21484-1-jlayton@kernel.org> <20230105121512.21484-4-jlayton@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, 2023-01-05 at 07:15 -0500, Jeff Layton wrote: > An error from break_lease is non-fatal, so we needn't destroy the > nfsd_file in that case. Just put the reference like we normally would > and return the error. >=20 > Signed-off-by: Jeff Layton > --- > fs/nfsd/filecache.c | 29 +++++++++++++++-------------- > 1 file changed, 15 insertions(+), 14 deletions(-) >=20 > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > index a67b22579c6e..f0ca9501edb2 100644 > --- a/fs/nfsd/filecache.c > +++ b/fs/nfsd/filecache.c > @@ -1113,7 +1113,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct= svc_fh *fhp, > nf =3D nfsd_file_alloc(&key, may_flags); > if (!nf) { > status =3D nfserr_jukebox; > - goto out_status; > + goto out; > } > =20 > ret =3D rhashtable_lookup_insert_key(&nfsd_file_rhash_tbl, > @@ -1122,13 +1122,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, stru= ct svc_fh *fhp, > if (likely(ret =3D=3D 0)) > goto open_file; > =20 > - nfsd_file_slab_free(&nf->nf_rcu); > - nf =3D NULL; > if (ret =3D=3D -EEXIST) > goto retry; > trace_nfsd_file_insert_err(rqstp, key.inode, may_flags, ret); > status =3D nfserr_jukebox; > - goto out_status; > + goto construction_err; > =20 > wait_for_construction: > wait_on_bit(&nf->nf_flags, NFSD_FILE_PENDING, TASK_UNINTERRUPTIBLE); > @@ -1138,28 +1136,24 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, stru= ct svc_fh *fhp, > trace_nfsd_file_cons_err(rqstp, key.inode, may_flags, nf); > if (!open_retry) { > status =3D nfserr_jukebox; > - goto out; > + goto construction_err; > } > open_retry =3D false; > - if (refcount_dec_and_test(&nf->nf_ref)) > - nfsd_file_free(nf); > goto retry; > } > - > this_cpu_inc(nfsd_file_cache_hits); > =20 > status =3D nfserrno(nfsd_open_break_lease(file_inode(nf->nf_file), may_= flags)); > + if (status !=3D nfs_ok) { > + nfsd_file_put(nf); > + nf =3D NULL; > + } > + > out: > if (status =3D=3D nfs_ok) { > this_cpu_inc(nfsd_file_acquisitions); > *pnf =3D nf; > - } else { > - if (refcount_dec_and_test(&nf->nf_ref)) > - nfsd_file_free(nf); > - nf =3D NULL; > } > - > -out_status: > put_cred(key.cred); > trace_nfsd_file_acquire(rqstp, key.inode, may_flags, nf, status); > return status; > @@ -1189,6 +1183,13 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struc= t svc_fh *fhp, > if (status !=3D nfs_ok) > nfsd_file_unhash(nf); > clear_and_wake_up_bit(NFSD_FILE_PENDING, &nf->nf_flags); > + if (status =3D=3D nfs_ok) > + goto out; > + > +construction_err: > + if (refcount_dec_and_test(&nf->nf_ref)) > + nfsd_file_free(nf); > + nf =3D NULL; > goto out; > } > =20 Chuck, ping? You never responded to this patch and I don't see it in your tree. Any thoughts? --=20 Jeff Layton