From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E09FC43457 for ; Fri, 16 Oct 2020 16:20:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC176207BC for ; Fri, 16 Oct 2020 16:20:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vCH11OKZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC176207BC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0171194000D; Fri, 16 Oct 2020 12:20:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB829940007; Fri, 16 Oct 2020 12:20:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D819594000D; Fri, 16 Oct 2020 12:20:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 28C97940007 for ; Fri, 16 Oct 2020 12:20:21 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 062031EF1 for ; Fri, 16 Oct 2020 16:20:19 +0000 (UTC) X-FDA: 77378300958.10.spy23_060ba842721e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id D235516A047 for ; Fri, 16 Oct 2020 16:20:18 +0000 (UTC) X-HE-Tag: spy23_060ba842721e X-Filterd-Recvd-Size: 2696 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 16:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=J3dIYfqfYa58oXV6j+5Y6Rq8CwUVru9FXe4AJtaFdts=; b=vCH11OKZXL9NGakbK4kDvShlck 2N1p/5myGxqgcjko4iNvCq32P73BNcmWnyBns4QWj+n+rhh8u9pRPawGx4M/1w6lZdNSDKCOBAmuu 3hserHxEru/BWigBhy+IwlvYFFrboAtozx8dmlZxRdtv/qeJLtJCuV9TsZm+EfuNShRw7ZGdn1chk KRG0gGMEWkTIAy881LlpvLSntWo6aedRtfBL65ObCuTTG4i2qXjqSqwObEbNflG5bCEO3Czc/5+6x 8m9bPSZ5YR5dEHaTg2p1NlRx8+s5T44ihtgxdgxD5Mddr6DTxp1SdjsD1vwPk7ZjF2xVEw3jDHcEg z9W3ZX1g==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTSDl-0004s8-4B; Fri, 16 Oct 2020 16:04:45 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, David Howells , stable@vger.kernel.org Subject: [PATCH v3 01/18] cachefiles: Handle readpage error correctly Date: Fri, 16 Oct 2020 17:04:26 +0100 Message-Id: <20201016160443.18685-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201016160443.18685-1-willy@infradead.org> References: <20201016160443.18685-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: If ->readpage returns an error, it has already unlocked the page. Fixes: 5e929b33c393 ("CacheFiles: Handle truncate unlocking the page we'r= e reading") Cc: stable@vger.kernel.org Signed-off-by: Matthew Wilcox (Oracle) --- fs/cachefiles/rdwr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c index 3080cda9e824..8bda092e60c5 100644 --- a/fs/cachefiles/rdwr.c +++ b/fs/cachefiles/rdwr.c @@ -121,7 +121,7 @@ static int cachefiles_read_reissue(struct cachefiles_= object *object, _debug("reissue read"); ret =3D bmapping->a_ops->readpage(NULL, backpage); if (ret < 0) - goto unlock_discard; + goto discard; } =20 /* but the page may have been read before the monitor was installed, so @@ -138,6 +138,7 @@ static int cachefiles_read_reissue(struct cachefiles_= object *object, =20 unlock_discard: unlock_page(backpage); +discard: spin_lock_irq(&object->work_lock); list_del(&monitor->op_link); spin_unlock_irq(&object->work_lock); --=20 2.28.0