Commit de9aa967 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] direct-io invalidation fix

clean_blockdev_aliases() is using the wrong thing to work out how many
filesystem blocks should be invalidated.  It invalidates too many, which can
cause live fs metadata buffers to be invalidated when they are pending
writeout.  It's a filesystem-wrecker, although seems very hard to hit.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2ba1bdcc
...@@ -690,8 +690,11 @@ submit_page_section(struct dio *dio, struct page *page, ...@@ -690,8 +690,11 @@ submit_page_section(struct dio *dio, struct page *page,
static void clean_blockdev_aliases(struct dio *dio) static void clean_blockdev_aliases(struct dio *dio)
{ {
unsigned i; unsigned i;
unsigned nblocks;
for (i = 0; i < dio->blocks_available; i++) { nblocks = dio->map_bh.b_size >> dio->inode->i_blkbits;
for (i = 0; i < nblocks; i++) {
unmap_underlying_metadata(dio->map_bh.b_bdev, unmap_underlying_metadata(dio->map_bh.b_bdev,
dio->map_bh.b_blocknr + i); dio->map_bh.b_blocknr + i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment