From patchwork Wed Jul 10 13:05:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13729272 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B36DC192493; Wed, 10 Jul 2024 13:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616788; cv=none; b=Bw+585vAlEaWkTf41O/rRZbvxOhG9q5ciWfZEt2uFW4MI4fNbEWENxrz2h9KLTR5Y27pA3s4VyeyJ4ZwL67zNrw5Jc+QKnIZjsMBS9ZXIDeLDHR80889+0B3TViylTJ9uUwkFWiq0I2kwMKC5/tknkaVzQ1ksYuR5f398D+TLA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616788; c=relaxed/simple; bh=PW5J9RmIMWOs63awhlKVRUsc/q4YKmg5qreeXssolV4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u8tUzbZl7EP9l13keF+K4fU4nfHjqurR9ujKMNbDjLNNH9aR9ZvhoWFIQeciDO/VNlfP30XIhtYmHJt3J+fD4Iz+SEQqL6oWmLr9HoG035rfGwr8sg1QRCx0po3GhSss/opPHYQqAT/O0urwlJOxK2ilbZRreopBLrS/aIndeyU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SiMw688F; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SiMw688F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4900C32786; Wed, 10 Jul 2024 13:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720616788; bh=PW5J9RmIMWOs63awhlKVRUsc/q4YKmg5qreeXssolV4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SiMw688FWW7JGJgbfE2KskdR2xPCVCUaohwjmypFnJMo3FxpWOONbpCP8SsmobD4D WA8J2x7Md3quwMCadzF/01mL+0M5MnsqUH77+hhEDdWwXSaoqIfd1RzoNW1ZDXaC2W /s0J9FZZlMdS9wUhLCR0ZwXgQ90XxG7+RqEC1z+Opm1XHRJTgrUv0KfRQy8RX/M9I5 Ke1dZNyrtmOE97bjHeotQ36db8ffQHMON6hppZao4Ws8l1MIvB0h76ITvIOMsRekUv fB8R4SesdotUEAPrvXvqqWi1WHJGNqhKRBKFKlQehInflrFRnYKycXXNM8uIFq57jI ttbkElQkQucSQ== From: Jeff Layton Date: Wed, 10 Jul 2024 09:05:31 -0400 Subject: [PATCH 1/3] nfsd: fix refcount leak when failing to hash nfsd_file Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240710-nfsd-next-v1-1-21fca616ac53@kernel.org> References: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> In-Reply-To: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: Youzhong Yang , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=875; i=jlayton@kernel.org; h=from:subject:message-id; bh=PW5J9RmIMWOs63awhlKVRUsc/q4YKmg5qreeXssolV4=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmjodSC+xMX7A+v7sYgagQPog5F6NLwmjttcuO0 xBcvKjd/Q+JAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZo6HUgAKCRAADmhBGVaC FRiHD/9I1vDhHMocDJFsxvaHkCVa3fKzADNGbS9odsia4tuFszKqqHCAG2Bwa0427ewDEU7bpzX P2R4KrGUSCIq1b+Wrc0S+AtsgZY57O3nBN4yO7cc6Gi3bXcf9OqJXUXOB95wewIOx2akAVIjfco SLXnRFVx9sEuX6JuKs/TVJ3UcRI0whKRs9d28aY9jV2gik+fJ/gRlK231ydiRR14azllZBUlaf3 VIQ5sq/eaocem/gOOsPhw4gUGaNjPzSPDF01jRF4lSb5FppiRR9rkMZ9U6H1G6Gs8Sd1wYkq+gC BoOwLEqe4aKR+wVrWdajMCbTHep6hCoiGHfny1oCOrVTeKIl+PT4UITzn4iJE3uYSoV4vX3fiJP ts2ZzY4xlhWWYcWZd5wI+jqNxeKqVAkvuJKaVsCfGsChYQCpsPyCNl2LZSVblj5DtqeKxdEwO6F v5CLzE+FIHdyoJJarKwWYqlXLWYByIXUzrbL0cECDUjMbzUrbiu4iDFxZ7XyfTzRO5xhthXA4H2 2Sve9REPux/eN3fHKyma7Xj4XRRCknjzABT3hbd7bbXE62+MbfGWYtiheYAUPjc1txWvZfyUSof 5hns8o+AQhksQ3eZ7VD3P+yfs0dLBYTMedEfADpp6AuGDZ8w9TjI4JlqIp+rAm9PCjI3zEHVIrP 0lVSp4DXgeryGlw== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 At this point, we have a new nf that we couldn't properly insert into the hashtable. Just free it before retrying, since it was never hashed. Fixes: c6593366c0bf ("nfsd: don't kill nfsd_files because of lease break error") Signed-off-by: Jeff Layton --- fs/nfsd/filecache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index f84913691b78..4fb5e8546831 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -1038,8 +1038,10 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, if (likely(ret == 0)) goto open_file; - if (ret == -EEXIST) + if (ret == -EEXIST) { + nfsd_file_free(nf); goto retry; + } trace_nfsd_file_insert_err(rqstp, inode, may_flags, ret); status = nfserr_jukebox; goto construction_err; From patchwork Wed Jul 10 13:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13729273 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE349192B85; Wed, 10 Jul 2024 13:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616790; cv=none; b=N8BNSgWkoRWJkwbFtwJNWWUszGso0OLPSSTt1lGI/2W9fJ6/eOX9IT+VOOc8oMa+H2gym1onx1XpNyu/3sUfTYDJrB+D28RW9Qw1Asq6qZj5QKwNHP5iZG6HS3KqGMbBxBIQJg0n7swzzfQXFTzDC9HKVw3/vcziOnHa0U7guvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616790; c=relaxed/simple; bh=FUxA06jnYH/Ta9/O5/4vWWJfqdKwCRgE/6sEUrbzx0Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Aald31II/ShHsiiH+ULQ35bwf5MA2KMGeLniZeKBHVsyxqtTkehlCKfDWaodcCKT3PyGnyYGyAFesAt7AxaqltAbZGRLgoVPWGUW0rZt4qt78iHuPCfztcAAX3UJDVaYQfh/b7F9FyRNQWExel0bihWxUUIdHXBA3qoZqZ7W8Tg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aSQWagAe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aSQWagAe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C47CFC4AF07; Wed, 10 Jul 2024 13:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720616789; bh=FUxA06jnYH/Ta9/O5/4vWWJfqdKwCRgE/6sEUrbzx0Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aSQWagAezpfg067CjPDE6qh/y3FHoi2nACWNpkcm6gRgefureBscFJH+7yaqUtCMT cm/8ELgE+OrW9393BZckZR4YFWD17NbQhstCU3nhpHBKP8uclKWckhr3xNobOCffZG vgs4bKQgzq52TOo92oqTGCLcwO/xOYVhuJWA9F10H/kvFRF1AcWbFpbu4jTT4QfLaf 0Us0+s9Zg7l/Pj/xymYA0z0npsYfFcVXCtWYMZSQMHUWAK9oRzVx7b1A9CVmT3klsP Tu5eneCyUHMPrH9bbwWRCqbviNbg1FVHOOIxXG8DK7jW4D/MzL5sDwLswMDt/kBrUw 392OZG6apMaiw== From: Jeff Layton Date: Wed, 10 Jul 2024 09:05:32 -0400 Subject: [PATCH 2/3] nfsd: fix refcount leak when file is unhashed after being found Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240710-nfsd-next-v1-2-21fca616ac53@kernel.org> References: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> In-Reply-To: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: Youzhong Yang , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=793; i=jlayton@kernel.org; h=from:subject:message-id; bh=FUxA06jnYH/Ta9/O5/4vWWJfqdKwCRgE/6sEUrbzx0Y=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmjodSSqy31DazLB7kcwt5g9Zn14B9Sa2xZPP1S 8B6QGsUKhmJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZo6HUgAKCRAADmhBGVaC Ff+QD/4pgQoUcQ5URJp42KQNCS6YiIjHhHqdh0VgjoTYwSZPGnTMtJ9r2n5I0VLcZIS2iNpqi1N xnOq5Do/ief8/UovblADiihQg7M8ajd2jNnAzOMWOHmSaZOoBtppSnzXcxwB4p5k9suSppb+ukE eSMihRw5XCQq6KPQnQq8Z9nEPEHjHLg5FCuBXi38I31+uQem2xTO0VifSqFXFSUIhYBEcYFO3Zb bXWkq81hE/rWcxM/7CZ7Jo1IdCv9SpSBIl3bd0Zc0TSPvZ/OuKtHPRdM/GdM9fQMSq6es+DOgAC G0ER4W6s3HLl3UREjYjkxTPeqAJJiD7XUH4GuMZmGr3nBP3V/6cpaB8wlu5pD3zFPV3/6jK/Omt bpZCM34UqOvOzr/CeykZEejr5fQ6AYSUUknDkL1hPFaCnlrBRwBKw5PMclLNRZwhZaUPt+0/68x vr4Brv3n+2IAnPdjxYki9sqSgKDkDHHNulCTqcioQJr6XvUqHbdFJieR4Ke+65lFZ4PX0ZTQe82 Khk7lgk30Xdg694aSBUF0IfCNKAKHDqDHxk3dw2eBIaeKOEMOybM0AqDaz0dpSplRrj4N/HJ+/R OdRTL04HA8PrzB/vh5KCm2G4g7HSsgNEeLDJ2SUBvkJ15R7E2gy5TbYn3THVHqTpsMopS/1m8gZ XoEGgedfi8FmyIw== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 If we wait_for_construction and find that the file is no longer hashed, and we're going to retry the open, the old nfsd_file reference is currently leaked. Put the reference before retrying. Fixes: c6593366c0bf ("nfsd: don't kill nfsd_files because of lease break error") Signed-off-by: Jeff Layton --- fs/nfsd/filecache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 4fb5e8546831..52063f2cf0df 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -1056,6 +1056,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, status = nfserr_jukebox; goto construction_err; } + nfsd_file_put(nf); open_retry = false; fh_put(fhp); goto retry; From patchwork Wed Jul 10 13:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13729274 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE431193065; Wed, 10 Jul 2024 13:06:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616790; cv=none; b=PPEffbY08NVbUnY6MvARTOrQLhvrY2Wh/sHY+Di48TWJjI5/544f9VZteA2GMux86O1zzd30W/8VmCf4zOqofymBJCkiIrl/bz/chUCTCCZLcXjeTEkrbd4CzywsspzagA6ouxLwDAv5jIMeMvVAnLLMEHZJyD37MfsvcUjR7pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720616790; c=relaxed/simple; bh=vunybwmwyeDdA28AxzCVTJeL0m1p52lwXE6ZLQY3F/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PuC43TVhSGYUfdQKm+Gr9SimUYAn15mFHLmd0S/QZFkMbepc4jeen75fuubunPo9G+ilEzQbUbQSiYyoTdnQeGOWpYA6meGixOyQuNwZGTTpxPEcPtCCdNAEVGOAWzjA0h1djSAvY8Q+jcQry0IO+DnGVml6QEnxujDL1oRnrsY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IfgoENiV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IfgoENiV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3B0EC32786; Wed, 10 Jul 2024 13:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720616790; bh=vunybwmwyeDdA28AxzCVTJeL0m1p52lwXE6ZLQY3F/8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IfgoENiViytTpJNukjjgWY5Xwo4LcHush9imrrp2AsonI8/1JVAvJa3aRkSae9ffK jWdGgtw4taZjbjkJpDwWVerxDabezB9KOVdFIJ95xCajExv6yTZKvSclpjRVFh7kJ9 pGdprC/Hw9RY1XfKNJfTWaJPPYMEaPh412LqV3etLNOETtfRsKuS2sHLcS8I+Cv/8C gADOgMFHteIZD9ePOkR257zVAIfbDBugeHTbCpWAZt8/N06GH554HXcdIk9n04M+Bh IFGm4yineBsJ85WmC69z4yooDcquOwB9kim6KxyNzsB2gILefHf1yZ0m4Z0o6u2uWB FOgds+xsJqyTw== From: Jeff Layton Date: Wed, 10 Jul 2024 09:05:33 -0400 Subject: [PATCH 3/3] nfsd: count nfsd_file allocations Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240710-nfsd-next-v1-3-21fca616ac53@kernel.org> References: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> In-Reply-To: <20240710-nfsd-next-v1-0-21fca616ac53@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: Youzhong Yang , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3046; i=jlayton@kernel.org; h=from:subject:message-id; bh=vunybwmwyeDdA28AxzCVTJeL0m1p52lwXE6ZLQY3F/8=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmjodSpMClY8wJaVfsbcP3P9VAWwdL3w6tcQ7dZ fqvThP6IAaJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZo6HUgAKCRAADmhBGVaC Fcq8EACOlaIh7xXlDVDhEcFBXMNIiVBM139vNb7Q9o3FjCBoCGCYT94CTavutyRfhHPesiKeYhr cF1KnTdW7z6+g709GHylnmW61qalOm+P0xIH7UNeUutRC3wxsOzXpfsa4WvJ0juS43lI7TkZRdU 7bx49ABaKgnm8kLH4U8aihnLcZqK/lBkXKjEerroG8G0DmC/MH2YBBD3Jcqi8M8f5BL+zLDJDTE HfswSCZ1oKbkXlHJN+yMziPPPHqnOX3ExtvqQMD5mjcOq7ZV38V1FLPSLLGOLhk3m19TrKc23Tw JxqjUZ4HFwe01scxc7em3RxHBbMkHNEfpGDw5WfdGMf5JvLfM5ROd9QT8iYSUNAQqzu6dbiOr+A AVueGwgZyYQ5wR5ystL3PuCtec1Iw1QoDgCVVUXYLlnTqRa2OcakQHF1WobBjDzU1N7kXcDLl9m 9FwjKvPBGUFl+4sZV/MShBXTsWqmDuUj3LYv04BQRuQQyQOG7rzdcSTMCsgbqwo3tL2QPFHWgrt vmU8lH32n31Pq9YsoUBhUiNNDFI4tcJrygybzkgTQOn7rHbO1r0y7k3Apf+2Gqa3sw6Zeu3FNZO Vdvy5UlazZxKeOhmYZ/z6Gbr7AySffIG2OgMO3ZcwonKf+dBzbStwcvvSLIsYdypUXI2D2t5gub exCq6qivdchdARA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 We already count the frees (via nfsd_file_releases). Count the allocations as well. Also switch the direct call to nfsd_file_slab_free in nfsd_file_do_acquire to nfsd_file_free, so that the allocs and releases match up. Signed-off-by: Jeff Layton --- fs/nfsd/filecache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 52063f2cf0df..8997058ddbcb 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -56,6 +56,7 @@ static DEFINE_PER_CPU(unsigned long, nfsd_file_cache_hits); static DEFINE_PER_CPU(unsigned long, nfsd_file_acquisitions); +static DEFINE_PER_CPU(unsigned long, nfsd_file_allocations); static DEFINE_PER_CPU(unsigned long, nfsd_file_releases); static DEFINE_PER_CPU(unsigned long, nfsd_file_total_age); static DEFINE_PER_CPU(unsigned long, nfsd_file_evictions); @@ -215,6 +216,7 @@ nfsd_file_alloc(struct net *net, struct inode *inode, unsigned char need, if (unlikely(!nf)) return NULL; + this_cpu_inc(nfsd_file_allocations); INIT_LIST_HEAD(&nf->nf_lru); INIT_LIST_HEAD(&nf->nf_gc); nf->nf_birthtime = ktime_get(); @@ -912,6 +914,7 @@ nfsd_file_cache_shutdown(void) for_each_possible_cpu(i) { per_cpu(nfsd_file_cache_hits, i) = 0; per_cpu(nfsd_file_acquisitions, i) = 0; + per_cpu(nfsd_file_allocations, i) = 0; per_cpu(nfsd_file_releases, i) = 0; per_cpu(nfsd_file_total_age, i) = 0; per_cpu(nfsd_file_evictions, i) = 0; @@ -1027,7 +1030,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, if (unlikely(nf)) { spin_unlock(&inode->i_lock); rcu_read_unlock(); - nfsd_file_slab_free(&new->nf_rcu); + nfsd_file_free(new); goto wait_for_construction; } nf = new; @@ -1205,7 +1208,7 @@ nfsd_file_acquire_opened(struct svc_rqst *rqstp, struct svc_fh *fhp, */ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) { - unsigned long releases = 0, evictions = 0; + unsigned long allocations = 0, releases = 0, evictions = 0; unsigned long hits = 0, acquisitions = 0; unsigned int i, count = 0, buckets = 0; unsigned long lru = 0, total_age = 0; @@ -1230,6 +1233,7 @@ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) for_each_possible_cpu(i) { hits += per_cpu(nfsd_file_cache_hits, i); acquisitions += per_cpu(nfsd_file_acquisitions, i); + allocations += per_cpu(nfsd_file_allocations, i); releases += per_cpu(nfsd_file_releases, i); total_age += per_cpu(nfsd_file_total_age, i); evictions += per_cpu(nfsd_file_evictions, i); @@ -1240,6 +1244,7 @@ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) seq_printf(m, "lru entries: %lu\n", lru); seq_printf(m, "cache hits: %lu\n", hits); seq_printf(m, "acquisitions: %lu\n", acquisitions); + seq_printf(m, "allocations: %lu\n", allocations); seq_printf(m, "releases: %lu\n", releases); seq_printf(m, "evictions: %lu\n", evictions); if (releases)