public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* generic_osync_inode/ext2_fsync_inode still not safe
@ 2001-04-14 10:24 Marcelo Tosatti
  2001-04-17 13:09 ` Stephen C. Tweedie
  0 siblings, 1 reply; 4+ messages in thread
From: Marcelo Tosatti @ 2001-04-14 10:24 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Stephen C. Tweedie, Alexander Viro, lkml


Hi,

As described earlier, code which wants to write an inode cannot rely on
the I_DIRTY bits (on inode->i_state) being clean to guarantee that the
inode and its dirty pages, if any, are safely synced on disk.

The reason for that is sync_one() --- it cleans the I_DIRTY bits of an
inode, sets the I_LOCK and starts a writeout. 

If sync_one() is called to write an inode _asynchronously_, there is no
guarantee that an inode will have its data fully synced on disk even if
the inode gets unlocked, which means the previous fix to
generic_osync_inode() is not safe.

The easy and safe fix is to simply remove the I_DIRTY_* checks from
generic_osync_inode and ext2_fsync_inode. Easy but slow. Another fix would
be to make sync_one() unconditionally synchronous... slow.

Any suggestion for a fast, safe, but simple fix to this bug?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-04-20 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-14 10:24 generic_osync_inode/ext2_fsync_inode still not safe Marcelo Tosatti
2001-04-17 13:09 ` Stephen C. Tweedie
2001-04-18  9:45   ` Marcelo Tosatti
2001-04-20 20:27     ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox