On Thu 27-01-22 10:49:42, Christoph Hellwig wrote: > On Thu, Jan 27, 2022 at 10:47:37AM +0100, Jan Kara wrote: > > On Wed 26-01-22 16:50:35, Christoph Hellwig wrote: > > > Nothing prevents a file system or userspace opener of the block device > > > from redirtying the page right afte sync_blockdev returned. Fortunately > > > data in the page cache during a block device change is mostly harmless > > > anyway. > > > > > > Signed-off-by: Christoph Hellwig > > > > My understanding was these warnings are there to tell userspace it is doing > > something wrong. Something like the warning we issue when DIO races with > > buffered IO... I'm not sure how useful they are but I don't see strong > > reason to remove them either... > > Well, it is not just a warning, but also fails the command. With some of > the reduced synchronization blktests loop/002 can hit them pretty reliably. I see. I guess another place where using mapping->invalidate_lock would be good to avoid these races... So maybe something like attached patch? Honza -- Jan Kara SUSE Labs, CR