Re: [prepatch] address_space-based writeback

Alexander Viro
2002-04-10T20:53:22Z

On Wed, 10 Apr 2002, Andrew Morton wrote:

[I'll answer to the rest when I get some sleep]

> The one thing which does worry me a bit is why __mark_inode_dirty
> tests for a null ->i_sb. If the inode doesn't have a superblock
> then its pages are hidden from the writeback functions.
>
> This is not fatal per-se. The pages are still visible to the VM
> via the LRU, and presumably the filesystem knows how to sync
> its own stuff. But for memory-balancing and throttling purposes,
> I'd prefer that the null ->i_sb not be allowed. Where can this
> occur?

In rather old kernels. IOW, these checks are atavisms - these days
_all_ inodes have (constant) ->i_sb. The only way to create an
in-core inode is alloc_inode(superblock) and requires superblock
to be non-NULL. After that ->i_sb stays unchanged (and non-NULL)
until struct inode is freed.