Re: [patch 5/8] fs: ext2 inode sync fix

From: Ted Ts'o
Date: Fri Jan 07 2011 - 14:08:14 EST


On Sat, Dec 18, 2010 at 12:46:39PM +1100, Nick Piggin wrote:
> There is a big fuckup with inode metadata writeback (I suspect in a lot
> of filesystems, but I've only dared to look at a couple as yet).
>
> ext2 relies on ->write_inode being called from sync_inode_metadata in
> fsync in order to sync the inode. However I_DIRTY_SYNC gets cleared
> after a call to this guy, and it doesn't actually write back and wait
> on the inode block unless it is called for sync. This means that write_inode
> from background writeback can kill the inode dirty bits without the data
> getting to disk. Fsync will subsequently miss it.
>
> The fix is for ->write_inode to dirty the buffers/cache, and then ->fsync to
> write back the dirty data. In the full filesystem sync case, buffercache
> writeback in the generic code will write back the dirty data. Other
> filesystems could use ->sync_fs for this.
>
> Signed-off-by: Nick Piggin <npiggin@xxxxxxxxx>

What are your plans for this patch? Is this something you were
planning on pushing during the merge window, or should file system
maintainers try to fix up their code, since I gather this particular
change is independent of the previous patches in this patchset. Is
that correct?

- Ted
--
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/