From patchwork Mon Feb 12 07:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13552742 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BD4BC48297 for ; Mon, 12 Feb 2024 07:14:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 761136B0074; Mon, 12 Feb 2024 02:14:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7117B6B0075; Mon, 12 Feb 2024 02:14:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DACE6B0078; Mon, 12 Feb 2024 02:14:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 461D76B0074 for ; Mon, 12 Feb 2024 02:14:03 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 187FE80957 for ; Mon, 12 Feb 2024 07:14:03 +0000 (UTC) X-FDA: 81782287566.10.71F451C Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf05.hostedemail.com (Postfix) with ESMTP id 772B410000F for ; Mon, 12 Feb 2024 07:14:01 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=fBxYIBr5; dmarc=none; spf=none (imf05.hostedemail.com: domain of BATV+56c964bc8172c8a9ee6e+7477+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+56c964bc8172c8a9ee6e+7477+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707722041; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UWZt1qWFcFm+fzPf8IEKeJSyXZf+l++RirmcZF+UAzI=; b=JGzCcbGpvpJpoIQhoHHSRJx4mEpA+UWMPL2SABEFAoV1k0XDlVP7QKk1aPWFA3YgrsTiJv CC/Mv/m3f2rdvHQ/OecoCvr15NWK/UdKd1JatFwYDuGpXEo4WQKsdW6qh+NFkvh0igYURC RWc82/FRzpqdTlWFO3w1LSsNuH+p8Bk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=fBxYIBr5; dmarc=none; spf=none (imf05.hostedemail.com: domain of BATV+56c964bc8172c8a9ee6e+7477+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+56c964bc8172c8a9ee6e+7477+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707722041; a=rsa-sha256; cv=none; b=DMn3M6BLBfvgxqCUSgO4hcVX2RtmT3+IR+gGJfcdmHpd0vzWMjw9ZiqTx844WwZ9B4B/Gt L+tv7qPt+VS9CwfP5Ka7tC0OkXRgunouiYVDZohOjdGku2RrbllKH8u6bbCH4uHIFb4Lri pL8ssBinDS4JM0So9jlq1led3ClodUk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=UWZt1qWFcFm+fzPf8IEKeJSyXZf+l++RirmcZF+UAzI=; b=fBxYIBr50i75typXVRTy376Pn/ CQXblV/zQ6YusIu7nNdSNa4irkybtfukPQvmp93qD0JxWc9W6DZVzThYo50vrOq4Dwr7te99PFh3f vzYWhbE86of4eVstB9bX6ZqvUGSxRZlf5jabXXILmkHa2L17gOEj110mYC4ev4VI7z2JOVfYNksqC UEmRO/qWjT+mPYRCr6o514Qc2Y0rZlBM7rt6vQCVvmVi8GiGqCDnxmdlvCsfOWIi00QRG37mlCH50 DOtT3lNEwJoy+DtTN1lTNFOgaru1s+ViQ62OBfv0b/y3Sxwc5zWfuVV8e3nM9aGaGzHJh0tqVNpmV eVw6Q71w==; Received: from [2001:4bb8:190:6eab:75e9:7295:a6e3:c35d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZQVr-00000004Smh-1CN2; Mon, 12 Feb 2024 07:13:59 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: Matthew Wilcox , Jan Kara , David Howells , Brian Foster , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/14] writeback: don't call mapping_set_error in writepage_cb Date: Mon, 12 Feb 2024 08:13:35 +0100 Message-Id: <20240212071348.1369918-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212071348.1369918-1-hch@lst.de> References: <20240212071348.1369918-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 772B410000F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 4qxyzio35kb3u5tw568ks8shfouhdco9 X-HE-Tag: 1707722041-912876 X-HE-Meta: U2FsdGVkX19UMh7l5I/eJ3qt74PzH0vxfSwQL/8CvJJBvHYQatLvT94zPe6Gf0bT9LH1LBeBklsa1auLgYPTE7DwgwoZO8R8A4Y8JLX+E02EkBeHgobkT6dPnly/0Vk2sOcD5ZLT12tp5ue+SZjcRzg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garPF5CRPK29LH/XkX2FTIOEfGfD5MV6Qp0TCy7FGeMhkn0kt5iuZrX/i6tJlbVkmiMD1o92saeDUctmLgiGv8Ujj/g3DWCuqYIVxwiu6zbcyjT8cTH6Hed45dyWrW+xIdA2QY3PqD3snwpmog1FP2Yaz2zq7quolObRtLkyCGMelQFQn5OjC6QS+wH4vlRt/UL4XTj6mE/0hGHmeQ42AmEHokFQmcSWU6gJMBFHU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: writepage_cb is the iterator callback for write_cache_pages, which already tracks all errors and returns them to the caller. There is no need to additionally cal mapping_set_error which is intended for contexts where the error can't be directly returned (e.g. the I/O completion handlers). Remove the mapping_set_error call in writepage_cb which is not only superfluous but also buggy as it can be called with the error argument set to AOP_WRITEPAGE_ACTIVATE, which is not actually an error but a magic return value asking the caller to unlock the page. Signed-off-by: Christoph Hellwig --- mm/page-writeback.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 3f255534986a2f..62901fa905f01e 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2534,9 +2534,8 @@ static int writepage_cb(struct folio *folio, struct writeback_control *wbc, void *data) { struct address_space *mapping = data; - int ret = mapping->a_ops->writepage(&folio->page, wbc); - mapping_set_error(mapping, ret); - return ret; + + return mapping->a_ops->writepage(&folio->page, wbc); } int do_writepages(struct address_space *mapping, struct writeback_control *wbc)