Why a lot of fses are using bdev's page cache to do super block read/write?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux