Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp395514rdb; Thu, 15 Feb 2024 03:43:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWVn1M9YKiCD7CkNOSe9sUvzZiG7A4+inChBLJBd2cb7XLUqKDb9azg4vYhha9A0b0dY4qsfgb4JrRDUJApMs4QuLT50tABYXn3QG5hGw== X-Google-Smtp-Source: AGHT+IHFQe0KkWMuAxbQGrCGwJaFePxhPQFePpE4Yva08O8M6/bL63eM6R++ICvl/d1CCy9ZuDTC X-Received: by 2002:a05:6830:88:b0:6e2:f14c:b958 with SMTP id a8-20020a056830008800b006e2f14cb958mr1467027oto.2.1707997385776; Thu, 15 Feb 2024 03:43:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707997385; cv=pass; d=google.com; s=arc-20160816; b=EX3dCsgasbIuDL12iK+j+15Xevb3IGkSrol0ub/Ycyrx49mfPH/Rkpw0vQZAlYCgV3 z+aD8KP3g6Kkr2vresq2Ufs0zpggtzTrwnix8yXJth0aTwipujdPDxaBI+TKT1If4Ala e00vlgbLooO5OxbyLp7y6oYGeaJnMuFfAcdfPnGmBUt5mtXXNq4/i84j0K1ECR+P+/EI cYS8uvD6GSssFHgQWV7S7yIAHiizM+K6yHRqsMjba6OcaW2SaJ2bOnhDKNdJPzPMW/3M r3aWVFv4MH7C9wODO7kY+otkEkbErL8HyMYh/mae+QxFQwYr8GP1Oelpg1lTe3vXrRiB SW1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Xii2dGZNUM53ImanG6FtSPY3VdLuDxHQOVnxEu+XqVY=; fh=F8cVyYPOtWdQyI9DzN9p9zdA3iWm2CTT7fZkg8kuPuQ=; b=tWRmpBN4rfKEHlMUm7smIcZEHuypf/Ly+D1u7PVYHfid8AWFdKGcgrGJeH2lYiSnl3 AdrfAD4cZCC4jAd2em6YbeEBKr2I6jax2+ccx9+PBCY34P2dh/u/DEmrbZLz47iASaaR DzflEDD1u2UH/IyvWkKg4tPJ9leppHtWRGJ3CCnBbEmp5BcpbnhUYzO7XE5oJhbhoc8Y At4EwjNVGIPZaLcNjSC+SVT60IsqOns/LlySHV+BCBJDYzRCzgzRFzhRa7BX8mrPO8nb nAa2WdmZptQtKw3qiXnNX4ziPQ2GnbIjMjucMY4I2koHlIsA3fovDaJEUhQHx5K3bW1/ XfIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OgdT35T/"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-66823-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66823-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i197-20020a636dce000000b005dc4202b402si1019228pgc.173.2024.02.15.03.43.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:43:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66823-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OgdT35T/"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-66823-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66823-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6AFB828451A for ; Thu, 15 Feb 2024 11:43:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83CE912AAE2; Thu, 15 Feb 2024 11:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OgdT35T/" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 D9740129A98 for ; Thu, 15 Feb 2024 11:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997378; cv=none; b=R1pNXozC8nMoO3XA4zL9q8ERgXZ/XVxm6QN+4sQvWT0LLjPqIPepcppnm/oowtIVgMHni+GUXkZ0+KGf+IMnI5+M5z7dw5hXn6riEtriySaqTiiu8SUIRliiXXIdwTr7erGRTrhh902QOqnXCIIFCRcJqipjEEVvykPiRulu7UE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997378; c=relaxed/simple; bh=/FTXlztzle2L/AhigWw1U4jQU2T/XKgKPnl46C3daJk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u0uNOLPDsq8sO8PQ8/MpxH/utU4k2yZEMUOS9Du7411X9yYcLKrQeiEfeit8hKDZfzYEXN/kLwqRfNizYwiacRhYGduVEtrmDUK8IFlKzbJ2XhtjaZ9eSPx7+d5LUsUvf5fEELcrv6/m84Hk/Kvqhjr75fRHuxrDtD2skWApde4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OgdT35T/; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 > >