Re: sync, reboot, and corrupting data [was Re: 2.6.29 -mm merge plans]



On Sat 2009-01-10 23:12:32, Andi Kleen wrote:
On Sat, Jan 10, 2009 at 10:32:23PM +0100, Pavel Machek wrote:
On Sat 2009-01-10 16:07:29, Andi Kleen wrote:
On Thu, Jan 08, 2009 at 02:24:55PM +0100, Pavel Machek wrote:
On Wed 2009-01-07 03:57:25, Andi Kleen wrote:
sys_sync B which is invoked *after* sys_sync caller A should not
return before A. If you didn't have a global lock, they'd tend to
block one another's pages anyway. I think it's OK.

It means that you cannot reboot because reboot does sync.
What happens when the sync gets stuck somewhere on a really
slow device?

And what do you propose? Silently corrupt data on the slow device?

Yes not writing is better than being unable to reboot.

Disagreed.

Well you're just forcing the user to press power/reset/sysrq-b which
will pretty much guarantee data loss if anything is unwritten.

Well, ok, data loss is expected in such case. It is not expected on
"clean reboot".

maybe reboot utility should not call sync()...

I think it should call sync(), but have a suitable timeout.
Never spend more than 10 seconds on the sync. And give user visible
feedback during the countdown.

if fork() {
sync()
} else {
sleep(10)
reboot()
}

..is perfectly doable in userspace.

One alternative would be to do it with a background thread
(which seems to be en vogue right now anyways)
Ok I suppose with that Nick's lock is actually ok, although
I still don't like it very much.

Yes, I believe Nick's lock is okay and needed.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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/



Relevant Pages

  • OS lock up Win XP
    ... Next lock up could be in one hour ... >Now and the during reboot she gets a checksum error... ... problem with my video driver Nvidia GeForce 440 MX,kept ...
    (microsoft.public.windowsxp.perform_maintain)
  • RE: synchronizing domain user Local cached credentials with domain (VP
    ... locally cached credentials are out of sync with domain credentials. ... For the technical savvy will lock their screen and logon on ... change (script the detection of the Window bubble, ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Windows XP w/Dual Processor
    ... > reboot without warning? ... >> My pc will lock up. ... I just bought/built a dual AMD Opteron workstation. ... Geforce4 MX440 64MB AGP Card ...
    (microsoft.public.windowsxp.general)
  • Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()
    ... we need to hold the page-table lock over the whole sequence ... So if you split it up, so that the first phase is that ... and fsync/msyncmight not write back memory mapped data ... will then sync the file times... ...
    (Linux-Kernel)
  • sync, reboot, and corrupting data [was Re: 2.6.29 -mm merge plans]
    ... It means that you cannot reboot because reboot does sync. ... Silently corrupt data on the slow device? ... rebootsyscall should not sync. ...
    (Linux-Kernel)