Thread (4 messages) 4 messages, 4 authors, 2021-11-09

Re: [PATCH V2] block: hold ->invalidate_lock in blkdev_fallocate

flat view

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-09-24 17:07:41

On 9/22/21 8:37 PM, Ming Lei wrote:
When running ->fallocate(), blkdev_fallocate() should hold
mapping->invalidate_lock to prevent page cache from being accessed,
otherwise stale data may be read in page cache.

Without this patch, blktests block/009 fails sometimes. With this patch,
block/009 can pass always.

Also as Jan pointed out, no pages can be created in the discarded area
while you are holding the invalidate_lock, so remove the 2nd
truncate_bdev_range().
Applied, thanks.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help