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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0E9DC48BEB for ; Thu, 15 Feb 2024 11:43:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22A038D000E; Thu, 15 Feb 2024 06:43:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D9AB8D0001; Thu, 15 Feb 2024 06:43:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 079528D000E; Thu, 15 Feb 2024 06:42:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E74C28D0001 for ; Thu, 15 Feb 2024 06:42:59 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AFCAA80FF7 for ; Thu, 15 Feb 2024 11:42:59 +0000 (UTC) X-FDA: 81793851678.26.2607FDE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 7CF7314000A for ; Thu, 15 Feb 2024 11:42:56 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="OgdT35T/"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of bfoster@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bfoster@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707997378; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Xii2dGZNUM53ImanG6FtSPY3VdLuDxHQOVnxEu+XqVY=; b=R1/tyXLk5ms2R9URi4lZbUSfzaU4+DfsDTweueT7RReIC02QAqcR24+U1MLMwyIuLYEJAa wylhJtjSxf7jgbokkZzoPMEsEMota5wo+xRiszhjh1WYyPpJQ1uFxtTQqoVTfCGczhR/3A Bsds98CT1F2PFun0oDEEUCd6EZ3rz8I= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="OgdT35T/"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of bfoster@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bfoster@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707997378; a=rsa-sha256; cv=none; b=ELT9vy5jnmieEezwGp2WE/fgJ0S9Jo2UDDvE9GxB2ME1CGU3okNdvoJcIdtgIFRzPhyRFj rZKABLC6TsW5VT7hotDv7ELzZV+QSDkZW3m3/qVHovw1Ls/ifT6PEbJbogTvByLPPasJbZ tcJedLqKfuNnKJlzcCl+klYGtUKmYIA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707997375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xii2dGZNUM53ImanG6FtSPY3VdLuDxHQOVnxEu+XqVY=; b=OgdT35T/QoeKVWWKMjtqQdx9e2l9EIH651v/EXRSp+8ybbxFa+s7ZZfvJK3NrimXKxThjJ y7YGnU8m+YsnBH4FfITkNHgqS7FPywkPVjFt6yaSaTSbXHor8WRKw55giE79+FSFPTK7sM YRgm/lqxTtRmhYabNyBoKRitma7nROo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-Za6kuhPdP7mORgoJwagK2g-1; Thu, 15 Feb 2024 06:42:52 -0500 X-MC-Unique: Za6kuhPdP7mORgoJwagK2g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9FAAF845DC1; Thu, 15 Feb 2024 11:42:51 +0000 (UTC) Received: from bfoster (unknown [10.22.16.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C20F2166B36; Thu, 15 Feb 2024 11:42:51 +0000 (UTC) Date: Thu, 15 Feb 2024 06:44:28 -0500 From: Brian Foster To: Christoph Hellwig Cc: linux-mm@kvack.org, Matthew Wilcox , Jan Kara , David Howells , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/14] writeback: don't call mapping_set_error on AOP_WRITEPAGE_ACTIVATE Message-ID: References: <20240215063649.2164017-1-hch@lst.de> <20240215063649.2164017-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240215063649.2164017-2-hch@lst.de> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspamd-Queue-Id: 7CF7314000A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 9drmesbsushoton34y9jdk8zax49cxp5 X-HE-Tag: 1707997376-634397 X-HE-Meta: U2FsdGVkX18qLnQGthxntdIQqe4WUrUDSmxRvi7WKOl9DSQ8yWGFhrOaR+T5OtYinx8J6PLlEuCTeHhD98TR8JUEkQHboEYnmkqvezdvM325mV3XrnmveZH6UhlqQOwWr2J4Fxyd/R4HUSeKxxruuoDiBL7ThbzDEZib89SnOxZ7kjjSMTN9pAeui0XPdtf5OBxq7AgZ258t/72VCV/lkxHbE7EkWsqH+0JE9TfKTEp5O/M7ON3rCschGBgZUzccuBylNA7Un5wG/36X24FyNY2w+691eHMHSC5SQzgs1KLVjz+P4aKU8DGlH+WJZ9SnyZUx5aBUeEzXdRFH/hehoIad7n0SQWmypYS0DTbOWm7fq+/mi1UzhOBUlju5CS5PuqzLFYIlOXuQP5lGjhh1RWL+kA3ztwGuQi1kOgp1bdueMlVsW9BPeZUgY8SqpTdOr/7RBgEQphmEzdJaP9ne539gepEUwlXwl8kbJ5jFh70dB0XP6skTfaSdVkqdR0svKrm+QQbixredaCY23ZWybSgAl/wSv7DG8keJnWrerTo8SXycjq58rhJEy2FDIVglKCH2O9Fh1BsnGl7jqsh3bZ4PJT1xmuR70pMIHLPRx6Q7LSACBtJ1J/isqCqxdXCudqFPUOKYT7E+FgmbSwRPlwOLLNmbLESqRL2mXu8Kf9mAul3aKiJgHL1C71mbxaZvXzUMlRRW83Ai1BlHGssqZZPWzCO0bEWfBni0mi8ei3mMbFIDh3L8gVV2/jE54iEbCjo9wt4qfH5Z8u5/m+J4aXbFeFJaie8xT1/UEUl2KyTQk5nZ+o0DpcHt7sTA5oXieM3BRBGajUysTfZwz2YDNhoz6JzAr5fsCKf/inVvuqC21c9zBjDLBmjRsDdlGmmOGCQ7OeKYtciol4QSHXmTSQ== 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: On Thu, Feb 15, 2024 at 07:36:36AM +0100, Christoph Hellwig wrote: > mapping_set_error should only be called on 0 returns (which it ignores) > or a negative error code. > > writepage_cb ends up being able to call writepage_cb on the magic > AOP_WRITEPAGE_ACTIVATE return value from ->writepage which means > success but the caller needs to unlock the page. Ignore that and > just call mapping_set_error on negative errors. > > (no fixes tag as this goes back more than 20 years over various renames > and refactors so I've given up chasing down the original introduction) > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Brian Foster > mm/page-writeback.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 3f255534986a2f..703e83c69ffe08 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -2535,7 +2535,9 @@ static int writepage_cb(struct folio *folio, struct writeback_control *wbc, > { > struct address_space *mapping = data; > int ret = mapping->a_ops->writepage(&folio->page, wbc); > - mapping_set_error(mapping, ret); > + > + if (ret < 0) > + mapping_set_error(mapping, ret); > return ret; > } > > -- > 2.39.2 > >