Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4635099rdb; Tue, 12 Dec 2023 05:26:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5viATpLgljUmP03HdK01LGgaANEFXSBBOskF7n0yOJ3A86dX2dQpf7r78EiqVLtYMFTfa X-Received: by 2002:a17:90b:4b4f:b0:286:dd9f:fe39 with SMTP id mi15-20020a17090b4b4f00b00286dd9ffe39mr4881893pjb.55.1702387575541; Tue, 12 Dec 2023 05:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702387575; cv=none; d=google.com; s=arc-20160816; b=i79fmKGlKgYs9/LwyAoXVhwgop9givLVArt+6L0dDFVUBqyY9LT+Xv/ImIu4cq16/d Ia1YIbhzQcGlJDnUDIChzhck5K8ue1mYeH0npLk1bIpVC7ut4noTToUi/iQy+635qJbj F1zh8RAX3kVFaeFGd1zD4wVfedkPfHOVz0wt063yqwgTOU1ZZolLtHN8ro06XEyw4qvw DaPx7nUtO7SRqqu3SDzAYiss94NDdr4GS7qNP04p29k9VTPD5QfTPQ0ZM0ggJ+modANw N+o8uMlrb1+cf9KV5Rz261Kmf8DviVvoIkIe0szS/w/RZOYf29RmtqV4ZaJAJjr0eHUa sSSA== ARC-Message-Signature: i=1; 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=b0EJSjGbwEr2b4Ml7A+chJ8+pEiLc4/B8ooSTDiYxzk=; fh=MeUUOj2j+iy27Ff8NnB29oTRl/j/84R5JYZt8JRFf0g=; b=R5cTh7961W5Vw2CM9l7t/vUQ/kmtInM3jlYb166nnMHoCreuKIyxnQbTcUQH0CrfmA k7fp3DMcncN3I7h6SaiJbr/41YOQ4FRRdG6/BRTIKbx7JWitL9tQvOOxy2o8nK9YeQue WoWvCfdHN7Av2rZQF2jXx0JMLV2XC/UDnPpYjxQqXAg3KlNV1vQmSCr8lyPrCr+SBopk u8tZHDUjPSROqwFSIinBPMXLcNpp+5lbZnfosXdc47PXl/ukb+vb6xSN0HqQ1efqkpDQ ZyWYLPYBLGpoxpLrPNbAUqEo/uVHEibBkD4z/bm2iaKb9Mgb2jq7IRK4S+7YBERSYz2Q OlPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=picipgXF; spf=pass (google.com: domain of linux-ext4+bounces-398-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-398-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z1-20020a17090ad78100b00285d58914ddsi7842034pju.51.2023.12.12.05.26.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 05:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-398-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=@infradead.org header.s=bombadil.20210309 header.b=picipgXF; spf=pass (google.com: domain of linux-ext4+bounces-398-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-398-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1CDC72817C1 for ; Tue, 12 Dec 2023 13:26:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A50A61FB5; Tue, 12 Dec 2023 13:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="picipgXF" X-Original-To: linux-ext4@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059CCB3; Tue, 12 Dec 2023 05:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=b0EJSjGbwEr2b4Ml7A+chJ8+pEiLc4/B8ooSTDiYxzk=; b=picipgXFbvzoUhEoBG/zPnQX1q HE6smIRBy5a89R9akhr+qXOZgV2ZWsX5XPLxtAEgCavvFg2RD1Nd4bY6y3UtqlfS5bvjWd1FYs03a CEKxQcI96bW9kVZcHP+cYaV8hEgMc7fElg/c9Fc75ryish62M2PDTmzUmPs5fvjFZ8ka06osdMRpf ASMKxc6mHhCj37Uwwthec0X8EOQOG/hGGGWoR9QRV2Bnh4w97sL+F2xaXO4b3Qr1y31RDun14/d27 LpamT9Qvnaapt6jca0mzWu9EovPM8+74IynFRKTN08S2sDe2pXO4Td8t8oHiM29FNbbe9flIcdz3n 3xcYUrag==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rD2lJ-00BnAr-2I; Tue, 12 Dec 2023 13:25:25 +0000 Date: Tue, 12 Dec 2023 05:25:25 -0800 From: Christoph Hellwig To: Yu Kuai Cc: axboe@kernel.dk, roger.pau@citrix.com, colyli@suse.de, kent.overstreet@gmail.com, joern@lazybastard.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, sth@linux.ibm.com, hoeppner@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, jejb@linux.ibm.com, martin.petersen@oracle.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, viro@zeniv.linux.org.uk, brauner@kernel.org, nico@fluxnic.net, xiang@kernel.org, chao@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, agruenba@redhat.com, jack@suse.com, konishi.ryusuke@gmail.com, willy@infradead.org, akpm@linux-foundation.org, p.raghav@samsung.com, hare@suse.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, gfs2@lists.linux.dev, linux-nilfs@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block Message-ID: References: <20231211140552.973290-1-yukuai1@huaweicloud.com> <20231211140753.975297-1-yukuai1@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@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: <20231211140753.975297-1-yukuai1@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Dec 11, 2023 at 10:07:53PM +0800, Yu Kuai wrote: > +static __always_inline int buffer_uptodate_or_error(struct buffer_head *bh) > +{ > + /* > + * If the buffer has the write error flag, data was failed to write > + * out in the block. In this case, set buffer uptodate to prevent > + * reading old data. > + */ > + if (buffer_write_io_error(bh)) > + set_buffer_uptodate(bh); > + return buffer_uptodate(bh); > +} So - risking this blows up into a lot of nasty work: Why do we even clear the uptodate flag on write errors? Doing so makes not sense to me as the data isn't any less uptodate just because we failed to write it..