> The reason ->write_inode() can be a no-op is that __sync_one()
> marks the inode clean, then calls ->write_inode(). We *know*
> that we took a copy of the inode in mark_inode_dirty(), so
> we don't need to do anything.
Yes, the only exception is that write_inode needs to honor the sync flag,
at least when not called under PF_MEMALLOC. The biggest reason I can find
so far is knfsd, who calls write_inode_now and expects the inode to be
securely on disk. It doesn't call mark_inode_dirty directly, it calls some
FS func (link, create, whatever) and then uses write_inode_now to commit.
>
> Of course this absolutely requires all inode dirtiers to
> call mark_inode_dirty() after doing the dirty, which is a risk.
> But we face that risk with the PF_MEMALLOC case anyway. No
> problems have appeared in testing.
I haven't seen any problems caused by it yet, but that might be because
reiserfs does all the important inode writes on its own. I believe
generic_commit_write is the only place outside the FS that calls
mark_inode_dirty with something other than an atime update.
-chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/