On Thu, Nov 30, 2023 at 09:20:41PM +0530, Ritesh Harjani wrote: > OR, one other approach to this can be... > > IIUC, for a new block mapping for the same folio, the folio can be made to > get invalidated once in between right? So should this be handled in folio > cache somehow to know if for a given folio the underlying mapping might > have changed for which iomap should again query ->map_blocks() ? > ... can that also help against unnecessary re-validations against cached > block mappings? That's pretty much exactly what buffer heads do -- we'd see the mapped bit was now clear. Maybe we could have a bit in the iomap_folio_state that is set once a map has been returned for this folio. On the one hand, this is exactly against the direction of iomap; to divorce the filesystem state from the page cache state. On the other hand, maybe that wasn't a great idea and deserves to be reexamined.