linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why a lot of fses are using bdev's page cache to do super block read/write?
@ 2025-07-09  9:05 Qu Wenruo
  2025-07-09 12:01 ` Matthew Wilcox
  2025-07-09 15:04 ` Darrick J. Wong
  0 siblings, 2 replies; 4+ messages in thread
From: Qu Wenruo @ 2025-07-09  9:05 UTC (permalink / raw)
  To: linux-fsdevel@vger.kernel.org, linux-btrfs, Matthew Wilcox,
	linux-block@vger.kernel.org

Hi,

Recently I'm trying to remove direct bdev's page cache usage from btrfs 
super block IOs.

And replace it with common bio interface (mostly with bdev_rw_virt()).

However I'm hitting random generic/492 failure where sometimes blkid 
failed to detect any useful super block signature of btrfs.


This leads more digging, and to my surprise using bdev's page cache to 
do superblock IOs is not an exception, in fact f2fs is doing exactly the 
same thing.


This makes me wonder:

- Should a fs use bdev's page cache directly?
   I thought a fs shouldn't do this, and bio interface should be
   enough for most if not all cases.

   Or am I wrong in the first place?

- What is keeping fs super block update from racing with user space
   device scan?

   I guess it's the regular page/folio locking of the bdev page cache.
   But that also means, pure bio based IO will always race with buffered
   read of a block device.

- If so, is there any special bio flag to prevent such race?
   So far I am unable to find out such flag.

Thanks,
Qu

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-09 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09  9:05 Why a lot of fses are using bdev's page cache to do super block read/write? Qu Wenruo
2025-07-09 12:01 ` Matthew Wilcox
2025-07-09 15:04 ` Darrick J. Wong
2025-07-09 20:40   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).