Re: [PATCH RFC 2/2] block: Do not discard buffers under a mounted filesystem

Christoph Hellwig
2020-08-27T07:16:10Z

On Tue, Aug 25, 2020 at 04:50:56PM +0200, Jan Kara wrote:
> Do you mean that address_space filesystem uses to access its metadata on
> /dev/sda will be different from the address_space you will see when reading
> say /dev/sda? Thus these will be completely separate (and incoherent)
> caches?

Yes.

> Although this would be simple it will break userspace I'm afraid.
> There are situations where tools read e.g. superblock of a mounted
> filesystem from the block device and rely on the data to be reasonably
> recent. Even worse e.g. tune2fs or e2fsck can *modify* superblock of a
> mounted filesystem through the block device (e.g. to set 'fsck after X
> mounts' fields and similar).

We've not had any problems when XFS stopped using the block device
address space 9.5 years ago.