Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4663327rdb; Tue, 12 Dec 2023 06:11:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmaCppBUyY5GeAYkCKW/ha1m6wo0YCXNhtu1DqmlHLtMYF5mew0J3vT5JdQDYrem5NPaIg X-Received: by 2002:a05:6358:9394:b0:170:5200:e1b2 with SMTP id h20-20020a056358939400b001705200e1b2mr6788130rwb.4.1702390294614; Tue, 12 Dec 2023 06:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702390294; cv=none; d=google.com; s=arc-20160816; b=GI7xyv+GWrLAhDbcGRcNx8aLfl2ZDOUSgy5k9o88mhjDXg2ilihvIciJDgjbirVA/c CbQcVf2PWAZLTyYGt8TtVa4n7fDEV8Whewht0CEbpncpXetQ6lMlB89ZI/eLg+aGec/G O7hy2YoMRy8WuP3QQjd1bTr4+SxhpfTY8INq9qf2BXnk8BZISFhJp3NBkYv8tp92ru72 UbSP0pvzdkhsK++mlOQO/sdchodFbKaQo7IV0svu3piExmIZ88HHMMyyGNTK0guanPid uTU6nqFF4POlpyjBBdqq0nLEXG/JEhpGJphyzraZwhD4VQ6fFhcHRqj/M2L77OjhJhs/ xzpQ== 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:dkim-signature:dkim-signature :dkim-signature; bh=f/nbhyN5crR1w3m66kOkHUMah0FU4U4vRvr/vSaOUKo=; fh=f7qXBo5AHWAOl0r9linO88XpzaJ1EKuIbCS4Zd1FAtQ=; b=VNvsq3j7qsqPW0+0qjIhW44y7ntj5aE+jb4y/eZmY65pIG6iaKQBQ7xdX+xtr573++ p5SutDYRsQdWZZ0D1fu+DHHszijTEfGTj7QHDMgi1EXoQFG+tzqVGuwan1ZNhkqu3w2G oA39kjns7tS9HKTsRR1LXRU6vwbY6o2VAuFs7PGGj6cVO17tPIX900N79zHBYrBEG2u/ VuOSGEXRMJt1g2dZFQZJ0IRJgNOQcfNEzA5mb6LxJYYqhnuX+K3G60ZwhJwIOTCllrxG QzMoLuesq0aVt/QAd62qzCBz0m+gIrep1tWP8aC1v5bvd04+nDVWl4pVSxUfRcu5PO1d EGRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=B++bEOcu; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=B++bEOcu; dkim=neutral (no key) header.i=@suse.cz header.b=RYDemGbn; spf=pass (google.com: domain of linux-ext4+bounces-400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-400-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qd13-20020ad4480d000000b0067eacd2a7a4si9985051qvb.54.2023.12.12.06.11.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:11:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=B++bEOcu; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=B++bEOcu; dkim=neutral (no key) header.i=@suse.cz header.b=RYDemGbn; spf=pass (google.com: domain of linux-ext4+bounces-400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-400-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A9251C20C87 for ; Tue, 12 Dec 2023 14:11:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D62B573184; Tue, 12 Dec 2023 14:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="B++bEOcu"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="RYDemGbn"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="B++bEOcu"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="RYDemGbn" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55B6D2; Tue, 12 Dec 2023 06:11:13 -0800 (PST) Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AF1351FB4F; Tue, 12 Dec 2023 14:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702390271; h=from:from:reply-to: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=f/nbhyN5crR1w3m66kOkHUMah0FU4U4vRvr/vSaOUKo=; b=B++bEOcuECOPLUS6gRl1BadE5Ojhg72LI17/Jf8so38UM+0K3tK3EM18zqdte42Rmdahip pT2NLWONXbbx1wHqSpSUPrJ6SV/khTkKgkoHLhS3Je5qcEna7m+A0ImkydNS5Hp2KL7ol5 NGT5IsMbucBv49ZwMiTMIN/MTc8WjGg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702390271; h=from:from:reply-to: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=f/nbhyN5crR1w3m66kOkHUMah0FU4U4vRvr/vSaOUKo=; b=RYDemGbnXZfKi9uzTsokLLJFp3Q2IBX/Y+6xZm0LlYsd4XpI31h6ZqYPNIYrqGTAdxjsbq 9DRT+9hTWhL8LpBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702390271; h=from:from:reply-to: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=f/nbhyN5crR1w3m66kOkHUMah0FU4U4vRvr/vSaOUKo=; b=B++bEOcuECOPLUS6gRl1BadE5Ojhg72LI17/Jf8so38UM+0K3tK3EM18zqdte42Rmdahip pT2NLWONXbbx1wHqSpSUPrJ6SV/khTkKgkoHLhS3Je5qcEna7m+A0ImkydNS5Hp2KL7ol5 NGT5IsMbucBv49ZwMiTMIN/MTc8WjGg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702390271; h=from:from:reply-to: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=f/nbhyN5crR1w3m66kOkHUMah0FU4U4vRvr/vSaOUKo=; b=RYDemGbnXZfKi9uzTsokLLJFp3Q2IBX/Y+6xZm0LlYsd4XpI31h6ZqYPNIYrqGTAdxjsbq 9DRT+9hTWhL8LpBQ== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 8B6A8139E9; Tue, 12 Dec 2023 14:11:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id lJX+If9peGUGTgAAn2gu4w (envelope-from ); Tue, 12 Dec 2023 14:11:11 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E4786A06E5; Tue, 12 Dec 2023 15:11:10 +0100 (CET) Date: Tue, 12 Dec 2023 15:11:10 +0100 From: Jan Kara To: Christoph Hellwig Cc: Yu Kuai , 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: <20231212141110.4pcetu5ozp3m33qc@quack3> 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: X-Spam-Score: 1.39 X-Spamd-Bar: ++++ Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=B++bEOcu; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=RYDemGbn; dmarc=none; spf=softfail (smtp-out2.suse.de: 2a07:de40:b281:104:10:150:64:98 is neither permitted nor denied by domain of jack@suse.cz) smtp.mailfrom=jack@suse.cz X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [4.79 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_SOFTFAIL(4.60)[~all]; R_RATELIMIT(0.00)[to_ip_from(RLa8hd5fybgmzcyr9mhbq8ey7y)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_GT_50(0.00)[51]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[22.45%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(1.20)[suse.cz]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[huaweicloud.com,kernel.dk,citrix.com,suse.de,gmail.com,lazybastard.org,bootlin.com,nod.at,ti.com,linux.ibm.com,oracle.com,fb.com,toxicpanda.com,suse.com,zeniv.linux.org.uk,kernel.org,fluxnic.net,mit.edu,dilger.ca,redhat.com,infradead.org,linux-foundation.org,samsung.com,vger.kernel.org,lists.xenproject.org,lists.infradead.org,lists.ozlabs.org,lists.linux.dev,huawei.com]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:98:from] X-Spam-Score: 4.79 X-Rspamd-Queue-Id: AF1351FB4F X-Spam-Flag: NO On Tue 12-12-23 05:25:25, Christoph Hellwig wrote: > 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.. Historic reasons I'd say (buffer_write_io_error isn't *that* old - from 2003 it seems). And yes, it would make a lot of sense to keep uptodate flag set and just rely on buffer_write_io_error() but it also means going through all buffer_uptodate() checks in filesystems and determining which need changing to buffer_write_io_error() which is something nobody is keen on doing ;) Honza -- Jan Kara SUSE Labs, CR