Re: [PATCH RFC] __bd_forget should wait for inodes using themapping

From: Chris Mason
Date: Fri Jun 18 2004 - 09:49:18 EST


On Fri, 2004-06-18 at 10:22, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
wrote:
> On Fri, Jun 18, 2004 at 09:03:31AM -0400, Chris Mason wrote:
> > sync_sb_inodes, the filesystem block device inode ends up on some dirty
> > list, and under memory pressure balance_dirty_pages_ratelimited will
> > trigger writeback on it.
> >
> > There's nothing to write back of course, the real block device address
> > space has no dirty pages at all. But, writeback is looking through the
> > mapping and __bd_forget can't drop it until writeback has finished
> > checking it.
>
> So WTF does writeback bother with that? _That_ is the real bug here -
> the only kind of bdev inodes that can have accesses to ->i_mapping
> is fs/block_dev.c-created stuff.

During writeback, we need to answer the question: "are there dirty pages
attached to this inode", and the only way to answer it is via the
address space.

If bdev inodes don't want other inodes using their address space, they
shouldn't be setting the i_mapping on other inodes. Since they are, the
bdev code needs to be aware that someone else might be using it.

-chris



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/