Re: [patch] sys_sync livelock fix

From: Andrew Morton (akpm@zip.com.au)
Date: Tue Feb 12 2002 - 18:22:48 EST


Alan Cox wrote:
>
> > Given that /bin/sync calls write_unlocked_buffers() three times,
> > that's good enough. sync still takes aaaaaages, but it terminates.
>
> Whats wrong with sync not terminating when there is permenantly I/O left ?
> Its seems preferably to suprise data loss

Hard call. What do we *want* sync to do?

SuS doesn't require sync to be synchronous, although in linux
it traditionally has been. SUS says:

        The sync() function causes all information in memory that
        updates file systems to be scheduled for writing out to all
        file systems.

        The writing, although scheduled, is not necessarily complete
        upon return from sync().

I think the larger problem is that an infinite-duration
/bin/sync can break existing stuff.

If someone calls /bin/sync while there's write activity
going on, and expects that to prevent data loss then
their assumptions are broken anyway. There can be new
write data generated as soon as sync returns.

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



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:51 EST