Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2327012rdb; Mon, 12 Feb 2024 00:28:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxIlDOoGEGIus0BSVhfc+i29W1o0xGxIlVR4EjmmO0MvB0sAxoDTObIoFUNatTBi7PcIO7fKkojBvuJ8cMbfdXb2cn7+R0Ky6Ptma2Ng== X-Google-Smtp-Source: AGHT+IG/dFifCP02WpKHQl6x89hhvBZMq2suxeO+Y1b9Rfr9c7dOz6oIGr5TTQeI9utB4ldOgCUF X-Received: by 2002:a05:6871:7291:b0:21a:5358:a070 with SMTP id mm17-20020a056871729100b0021a5358a070mr4326906oac.7.1707726480826; Mon, 12 Feb 2024 00:28:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707726480; cv=pass; d=google.com; s=arc-20160816; b=Y5vFy6HsUxJiueB2YOCbMzPTSfIMuwhIc8z9HUuTZJ4BbhGZOh0fOg2Btg0/w4FjJ6 sxFoQH8EzStr1wpWoSM6f5s/BOaY/M9q5D/CATQBo89B3/YZGEC9+5wMpR2vVWKhgBl8 YwrBdsJ5EQm/ZEqGQvKcrxmpHikme9cEx3+E4NkP9dep6CNiV44LAVJW+osFlZpZCHAG YjCgLndB8r4IAILYgw3/aKWzREnqbk9kWBWZVnQMq+pKMPBOCy1EpC5+fv9Uos+iFIMp cHZ2r2Vz90ZeWCgpZalNSKpj3GtcaMbtLXTI1PgRcaiJP2PMSEGM46alh7FeYZwUeQEF zGug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UWZt1qWFcFm+fzPf8IEKeJSyXZf+l++RirmcZF+UAzI=; fh=NZuEtL5mG3LmqPFM94QEW4zwdSTxeaTpromXo5ckL8g=; b=FB4qktCZlxcO5xrMagbEh3ZvX9ZQ3XfQLaE1IKRYQUbMaVuwF8NAFC1H+EOQWy3Jzg 1JR18sftyWSzHI6amOrf1A4TNzF2WrN/R0axy2n5DcTN/lwN8QeMt+WCgMA1vBarn8WX 3sCP8suIlVzfsQCVXZSPKq9chQ7JpsaglSQSzTC5gt1W58C4oLC9/C8joLIcC0mSKBg5 1BJeK5RjamRHv8Tzcybl9WNJ/APPrC5HyzVW/gbNBtJSAa34YHhQVYRSUL3FxhavAQi9 07mpfDcgzl5M0N07ZUZZHSrwIRIbkkJenQExSDrEITX4v4Ntv73HEdRNXOqQxD7hMxZM vSmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fBxYIBr5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61127-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWmGUjckB47pnPorTushXlVrMx7nJ7iaX7xTapbp2JxI/SlTyt5mf/GHSB/8lBB78rDeJWxWoYXPTMSums5ATNhTHzKUq/kPFWtqm6mwg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i63-20020a638742000000b005d584838d7bsi5872650pge.833.2024.02.12.00.28.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 00:28:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fBxYIBr5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61127-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AD224B21680 for ; Mon, 12 Feb 2024 07:14:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0E50C2C7; Mon, 12 Feb 2024 07:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fBxYIBr5" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 94F5A7462; Mon, 12 Feb 2024 07:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707722042; cv=none; b=RYbz1SUWyBFa7VEYPhkGGRU4an3dPgYzAS33bBTS6YwaX7cbnunIj5HnhdefE7o47kW7xsUtKjVOa01tT244l2B+MD2qhoN5+88lkYucuQb6AAiJRrYurnwEnEtWclVCVrTqPXs7IwioMEZUE0XBBRg6Onw4vDIDntgqpY3OvXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707722042; c=relaxed/simple; bh=rP1TPgcHWkhJLnsYeLGXh3XxbkZLo6v2aWpQwVYAC9c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F1qKTr2hASxOIemq++07bTCbls2SpDa7uM14UMex7A7Tpx1WRfZgHyP74NgKL4OrRJJhbxoXs595B3+8sNwZSRut3PmTIvDg2PCrY9ayeJBIkluY/3+pXwyTaeQYwIf5FsgeMqgRmrd4GNQagwr2C32ahhsXVQy6qGvg3AM/y7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=fBxYIBr5; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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) -- 2.39.2