[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block
- To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
- From: Jan Kara <jack@xxxxxxx>
- Date: Tue, 12 Dec 2023 15:11:10 +0100
- 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@xxxxxxx) smtp.mailfrom=jack@xxxxxxx
- Cc: Yu Kuai <yukuai1@xxxxxxxxxxxxxxx>, axboe@xxxxxxxxx, roger.pau@xxxxxxxxxx, colyli@xxxxxxx, kent.overstreet@xxxxxxxxx, joern@xxxxxxxxxxxxxxx, miquel.raynal@xxxxxxxxxxx, richard@xxxxxx, vigneshr@xxxxxx, sth@xxxxxxxxxxxxx, hoeppner@xxxxxxxxxxxxx, hca@xxxxxxxxxxxxx, gor@xxxxxxxxxxxxx, agordeev@xxxxxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, clm@xxxxxx, josef@xxxxxxxxxxxxxx, dsterba@xxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, brauner@xxxxxxxxxx, nico@xxxxxxxxxxx, xiang@xxxxxxxxxx, chao@xxxxxxxxxx, tytso@xxxxxxx, adilger.kernel@xxxxxxxxx, agruenba@xxxxxxxxxx, jack@xxxxxxxx, konishi.ryusuke@xxxxxxxxx, willy@xxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, p.raghav@xxxxxxxxxxx, hare@xxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-bcachefs@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-erofs@xxxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, gfs2@xxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, yukuai3@xxxxxxxxxx, yi.zhang@xxxxxxxxxx, yangerkun@xxxxxxxxxx
- Delivery-date: Tue, 12 Dec 2023 14:11:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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 <jack@xxxxxxxx>
SUSE Labs, CR
|