linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Massive ext4 filesystem corruption after a failed s2disk/ram cycle
@ 2009-10-06 21:06 Maxim Levitsky
  2009-10-06 21:42 ` Theodore Tso
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Maxim Levitsky @ 2009-10-06 21:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-pm

Hi,

Just prior to 2.6.32 cycle I tried -next tree and noticed that after a
failed s2ram (here it works only once, and I test once in a whileto see
if fixed accidentally) I got a minor filesystem corruption. I am sorry I
didn't report that back then.

Now I have installed 2.6.32-rc2 (well -rc1...) and things were sort of
ok, I have even thought that hibernation is once again stable
(somewhere in the not that distinct past the hibernation which used to
work, began to fail randomly on resume)

Few days ago, I got a read-only filesystem again, an fsck, few more
corrupted files..., It should have had rung the bell for me (I have
still used hibernation, trying to understand why it fails sometimes)

Yesterday, however, I have decided to fix that once and for all, and for
that I have set up a loop + rtc wakealarm to make it cycle through
hibernation.

Needless to say I didn't run that loop more that maybe 3 cycles (and no
failures), but noticed that rtc clock is dead on resume. 

I sort of fixed that (this is hpet emulation that strikes again), I will
post when I test the fix (trivial), because when I had rebooted the
system into the modified kernel, I got that readonly filesystem again,
and this time the damage had spread over lots of files.
(I have even lost most of dpkg database..., many programs,
libraries,..., settings)

Yet, thanks to Linux flexibility, after a day, and some study of
nautilus source, I had the system recovered fully.
(Now am doing backups.....)

But I don't want that to happen again...

Another clue that I have seen was that ext4 driver reported that it
aborts journal replay.

I know that for now there is not much you can do, but just to let you
know that something is there...

What is especially interesting is that there were no s2ram'disk faulure
preceding the corruption, but my theory is that corruption wasn't
detected for a while from last failure, probably giving such bad
consequences.

You do sync file-systems before entering the hibernation, don't you?


Best regards,
Maxim Levitsky


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

* Re: Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 21:06 Massive ext4 filesystem corruption after a failed s2disk/ram cycle Maxim Levitsky
@ 2009-10-06 21:42 ` Theodore Tso
  2009-10-06 23:02   ` Maxim Levitsky
  2009-10-06 21:58 ` [linux-pm] " Rafael J. Wysocki
  2009-10-10  3:26 ` ext4 filesystem corruption Maxim Levitsky
  2 siblings, 1 reply; 17+ messages in thread
From: Theodore Tso @ 2009-10-06 21:42 UTC (permalink / raw)
  To: Maxim Levitsky; +Cc: linux-kernel, linux-pm

On Tue, Oct 06, 2009 at 11:06:55PM +0200, Maxim Levitsky wrote:
> 
> Just prior to 2.6.32 cycle I tried -next tree and noticed that after a
> failed s2ram (here it works only once, and I test once in a whileto see
> if fixed accidentally) I got a minor filesystem corruption. I am sorry I
> didn't report that back then.

When you say filesystem corruption, it's important to indicate whether
you meant that (a) you noticed that some files were had corrupted
contents, (b) the kernel complained that the filesystem was corrupted,
and remounted the filesystem read-only, or (c) e2fsck found and fixed
errors.

Also, when you found errors of either class (a) or (b), did you run
e2fsck to find and fix any potential errors?  In a few places it
sounded like the kernel had complained about errors, but you had
ignored them and hadn't run e2fsck to fix them.  I hope that was just
me misunderstanding what you wrote!  Can you clarify?

   		    	     	     	     - Ted

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 21:06 Massive ext4 filesystem corruption after a failed s2disk/ram cycle Maxim Levitsky
  2009-10-06 21:42 ` Theodore Tso
@ 2009-10-06 21:58 ` Rafael J. Wysocki
  2009-10-06 22:53   ` Henrique de Moraes Holschuh
  2009-10-10  3:26 ` ext4 filesystem corruption Maxim Levitsky
  2 siblings, 1 reply; 17+ messages in thread
From: Rafael J. Wysocki @ 2009-10-06 21:58 UTC (permalink / raw)
  To: linux-pm; +Cc: Maxim Levitsky, linux-kernel

On Tuesday 06 October 2009, Maxim Levitsky wrote:
> Hi,
> 
> Just prior to 2.6.32 cycle I tried -next tree and noticed that after a
> failed s2ram (here it works only once, and I test once in a whileto see
> if fixed accidentally) I got a minor filesystem corruption. I am sorry I
> didn't report that back then.
> 
> Now I have installed 2.6.32-rc2 (well -rc1...) and things were sort of
> ok, I have even thought that hibernation is once again stable
> (somewhere in the not that distinct past the hibernation which used to
> work, began to fail randomly on resume)
> 
> Few days ago, I got a read-only filesystem again, an fsck, few more
> corrupted files..., It should have had rung the bell for me (I have
> still used hibernation, trying to understand why it fails sometimes)
> 
> Yesterday, however, I have decided to fix that once and for all, and for
> that I have set up a loop + rtc wakealarm to make it cycle through
> hibernation.
> 
> Needless to say I didn't run that loop more that maybe 3 cycles (and no
> failures), but noticed that rtc clock is dead on resume. 
> 
> I sort of fixed that (this is hpet emulation that strikes again), I will
> post when I test the fix (trivial), because when I had rebooted the
> system into the modified kernel, I got that readonly filesystem again,
> and this time the damage had spread over lots of files.
> (I have even lost most of dpkg database..., many programs,
> libraries,..., settings)
> 
> Yet, thanks to Linux flexibility, after a day, and some study of
> nautilus source, I had the system recovered fully.
> (Now am doing backups.....)
> 
> But I don't want that to happen again...
> 
> Another clue that I have seen was that ext4 driver reported that it
> aborts journal replay.
> 
> I know that for now there is not much you can do, but just to let you
> know that something is there...
> 
> What is especially interesting is that there were no s2ram'disk faulure
> preceding the corruption, but my theory is that corruption wasn't
> detected for a while from last failure, probably giving such bad
> consequences.
> 
> You do sync file-systems before entering the hibernation, don't you?

Yes, a sync is there, but it is not effective on some filesystems.

Thanks,
Rafael

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 21:58 ` [linux-pm] " Rafael J. Wysocki
@ 2009-10-06 22:53   ` Henrique de Moraes Holschuh
  2009-10-06 23:02     ` Rafael J. Wysocki
  0 siblings, 1 reply; 17+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-10-06 22:53 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, Maxim Levitsky, linux-kernel

On Tue, 06 Oct 2009, Rafael J. Wysocki wrote:
> > You do sync file-systems before entering the hibernation, don't you?
> 
> Yes, a sync is there, but it is not effective on some filesystems.

Which ones?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 21:42 ` Theodore Tso
@ 2009-10-06 23:02   ` Maxim Levitsky
  2009-10-07 14:25     ` Jindrich Makovicka
  0 siblings, 1 reply; 17+ messages in thread
From: Maxim Levitsky @ 2009-10-06 23:02 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-kernel, linux-pm

On Tue, 2009-10-06 at 17:42 -0400, Theodore Tso wrote: 
> On Tue, Oct 06, 2009 at 11:06:55PM +0200, Maxim Levitsky wrote:
> > 
> > Just prior to 2.6.32 cycle I tried -next tree and noticed that after a
> > failed s2ram (here it works only once, and I test once in a whileto see
> > if fixed accidentally) I got a minor filesystem corruption. I am sorry I
> > didn't report that back then.
> 
> When you say filesystem corruption, it's important to indicate whether
> you meant that (a) you noticed that some files were had corrupted
> contents, (b) the kernel complained that the filesystem was corrupted,
> and remounted the filesystem read-only, or (c) e2fsck found and fixed
> errors.
> 
> Also, when you found errors of either class (a) or (b), did you run
> e2fsck to find and fix any potential errors?  In a few places it
> sounded like the kernel had complained about errors, but you had
> ignored them and hadn't run e2fsck to fix them.  I hope that was just
> me misunderstanding what you wrote!  Can you clarify?

Sure, kernel noticed errors, and remounted the filesystem R/O (I didn't
write anything down. really sorry)

I had rebooted the system.
Then startup scripts had booted the system to root shell

I had run fsck on the filesystem. It had plenty of files with shared
blocks, many orphaned inodes, errors in free bitmaps.


Then, after the fsck, I got many missing files (many probably went to
lost+found), some had garbage, some became truncated (0 size)

Mostly were affected files that were from recent dpkg update.


I use ubuntu 9.10, and (almost) latest -git of kernel tree.


Best regards,
Maxim Levitsky


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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 22:53   ` Henrique de Moraes Holschuh
@ 2009-10-06 23:02     ` Rafael J. Wysocki
  2009-10-07  1:29       ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 17+ messages in thread
From: Rafael J. Wysocki @ 2009-10-06 23:02 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: linux-pm, Maxim Levitsky, linux-kernel

On Wednesday 07 October 2009, Henrique de Moraes Holschuh wrote:
> On Tue, 06 Oct 2009, Rafael J. Wysocki wrote:
> > > You do sync file-systems before entering the hibernation, don't you?
> > 
> > Yes, a sync is there, but it is not effective on some filesystems.
> 
> Which ones?

XFS for one example.

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 23:02     ` Rafael J. Wysocki
@ 2009-10-07  1:29       ` Henrique de Moraes Holschuh
  2009-10-07  2:14         ` Daniel Pittman
  0 siblings, 1 reply; 17+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-10-07  1:29 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, Maxim Levitsky, linux-kernel

On Wed, 07 Oct 2009, Rafael J. Wysocki wrote:
> On Wednesday 07 October 2009, Henrique de Moraes Holschuh wrote:
> > On Tue, 06 Oct 2009, Rafael J. Wysocki wrote:
> > > > You do sync file-systems before entering the hibernation, don't you?
> > > 
> > > Yes, a sync is there, but it is not effective on some filesystems.
> > 
> > Which ones?
> 
> XFS for one example.

Interesting.  So XFS is not only a Bad Idea for /, but also for anything
that might enter S3/S4.  Not nice.  I sure hope it doesn't do a
half-assed job of flushing and checkpointing itself during machine
shutdown/restart like it apparently does when told to "sync" before
S3/S4...

Would you be so kind to disclose to us, the uninitated, which other
filesystems are unsafe when faced with a sleep/suspend request?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-07  1:29       ` Henrique de Moraes Holschuh
@ 2009-10-07  2:14         ` Daniel Pittman
  2009-10-07 16:16           ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Pittman @ 2009-10-07  2:14 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Rafael J. Wysocki, linux-pm, Maxim Levitsky, linux-kernel

Henrique de Moraes Holschuh <hmh@hmh.eng.br> writes:
> On Wed, 07 Oct 2009, Rafael J. Wysocki wrote:
>> On Wednesday 07 October 2009, Henrique de Moraes Holschuh wrote:
>> > On Tue, 06 Oct 2009, Rafael J. Wysocki wrote:
>> > > > You do sync file-systems before entering the hibernation, don't you?
>> > > 
>> > > Yes, a sync is there, but it is not effective on some filesystems.
>> > 
>> > Which ones?
>> 
>> XFS for one example.
>
> Interesting.  So XFS is not only a Bad Idea for /, but also for anything
> that might enter S3/S4.  Not nice.  I sure hope it doesn't do a
> half-assed job of flushing and checkpointing itself during machine
> shutdown/restart like it apparently does when told to "sync" before
> S3/S4...

For what it is worth, I would also be quite interested to know /why/ XFS is
bad in this regard.  Is it just the previously stated "XFS writes to disk
despite freezing kernel threads" issue, or something deeper?

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

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

* Re: Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-06 23:02   ` Maxim Levitsky
@ 2009-10-07 14:25     ` Jindrich Makovicka
  0 siblings, 0 replies; 17+ messages in thread
From: Jindrich Makovicka @ 2009-10-07 14:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-pm

On Wed, 07 Oct 2009 01:02:25 +0200
Maxim Levitsky <maximlevitsky@gmail.com> wrote:

> On Tue, 2009-10-06 at 17:42 -0400, Theodore Tso wrote: 
> > On Tue, Oct 06, 2009 at 11:06:55PM +0200, Maxim Levitsky wrote:
> > > 
> > > Just prior to 2.6.32 cycle I tried -next tree and noticed that
> > > after a failed s2ram (here it works only once, and I test once in
> > > a whileto see if fixed accidentally) I got a minor filesystem
> > > corruption. I am sorry I didn't report that back then.
> > 
> 
> Sure, kernel noticed errors, and remounted the filesystem R/O (I
> didn't write anything down. really sorry)
> 
> I had rebooted the system.
> Then startup scripts had booted the system to root shell
> 
> I had run fsck on the filesystem. It had plenty of files with shared
> blocks, many orphaned inodes, errors in free bitmaps.
> 
> 
> Then, after the fsck, I got many missing files (many probably went to
> lost+found), some had garbage, some became truncated (0 size)
> 
> Mostly were affected files that were from recent dpkg update.
> 
> 
> I use ubuntu 9.10, and (almost) latest -git of kernel tree.

I encountered something very similar yesterday, with 2.6.32-rc3. When
doing sync after accidentally removing a mounted USB stick, sync got
stuck, so I resorted to SysRq+S/U/B. Unfortunately this was also just
after an apt-get upgrade. The result was the same, corrupted ext4
partitions, shared blocks, orphaned inodes, free bitmap errors.

Only recently written files seem to be affected, in my case
upgraded stuff in / and configuration files in /home.

-- 
Jindrich Makovicka



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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-07  2:14         ` Daniel Pittman
@ 2009-10-07 16:16           ` Christoph Hellwig
  2009-11-04  2:18             ` KOSAKI Motohiro
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2009-10-07 16:16 UTC (permalink / raw)
  To: Daniel Pittman
  Cc: Henrique de Moraes Holschuh, Rafael J. Wysocki, linux-pm,
	Maxim Levitsky, linux-kernel

On Wed, Oct 07, 2009 at 01:14:10PM +1100, Daniel Pittman wrote:
> For what it is worth, I would also be quite interested to know /why/ XFS is
> bad in this regard.  Is it just the previously stated "XFS writes to disk
> despite freezing kernel threads" issue, or something deeper?

sync pushes out all data to disk, but in a journaling filesystem that
might just but the log not the "normal" place on disk.  For a boot
loader to deal with it properly it actually needs to do an replay of
the log.  Grub does so for reiserfs but not for XFS for some reason.
I don't know why problems don't trigger more often with ext3, though.

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

* ext4 filesystem corruption
  2009-10-06 21:06 Massive ext4 filesystem corruption after a failed s2disk/ram cycle Maxim Levitsky
  2009-10-06 21:42 ` Theodore Tso
  2009-10-06 21:58 ` [linux-pm] " Rafael J. Wysocki
@ 2009-10-10  3:26 ` Maxim Levitsky
  2 siblings, 0 replies; 17+ messages in thread
From: Maxim Levitsky @ 2009-10-10  3:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-pm

I have more information on that issue.

First of all this isn't related to s2ram/disk.
Second, this happened here again 3 times.

Now kernel complains loudly about access to freed inode.

After a reboot fsck tells the following:

- Some directory entries point to freed inodes,
   Which means these files are gone, but I never deleted some of them

- Some inodes have shared blocks

- Some orpahaned inodes found

- Free block counts/bitmaps corrupted.

That all happens without any s2ram/disk cycle.

However, yet an unusual situation did happen today.
I had installed an update to mountall ubuntu package, and it hosed all
boot process.
I had to  reboot many times, and once did hold the power button for 4
seconds.

I also used often the SYSRQ+U/SYSRQ+B tool.

On the contrary, I did several s2disk cycles, and one did fail, but
there was no corruption.

I must say that until now, I had never seen any ext3/ext4 corruption,
even though there were many many crashes, power failures, forced
reboots, etc...

Best regards,
Maxim Levitsky


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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-10-07 16:16           ` Christoph Hellwig
@ 2009-11-04  2:18             ` KOSAKI Motohiro
  2009-11-05  9:56               ` Henrique de Moraes Holschuh
  2009-11-08  8:29               ` Dave Chinner
  0 siblings, 2 replies; 17+ messages in thread
From: KOSAKI Motohiro @ 2009-11-04  2:18 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: kosaki.motohiro, Daniel Pittman, Henrique de Moraes Holschuh,
	Rafael J. Wysocki, linux-pm, Maxim Levitsky, linux-kernel

> On Wed, Oct 07, 2009 at 01:14:10PM +1100, Daniel Pittman wrote:
> > For what it is worth, I would also be quite interested to know /why/ XFS is
> > bad in this regard.  Is it just the previously stated "XFS writes to disk
> > despite freezing kernel threads" issue, or something deeper?
> 
> sync pushes out all data to disk, but in a journaling filesystem that
> might just but the log not the "normal" place on disk.  For a boot
> loader to deal with it properly it actually needs to do an replay of
> the log.  Grub does so for reiserfs but not for XFS for some reason.
> I don't know why problems don't trigger more often with ext3, though.

I'm sorry for the long delayed and offtopic responce. I discussed this
issue with okuji-san (GRUB2 maintainer) at several month ago.
He really wish linux implement real sync.

A bootloader has much constraint than OS (mainly caused by size constraint).
it can't implemnt jornal log replay logic for _all_ filesystem. Why can't we
implement storong sync syscall? I don't think this is PM nor bootloader fault.



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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-11-04  2:18             ` KOSAKI Motohiro
@ 2009-11-05  9:56               ` Henrique de Moraes Holschuh
  2009-11-07 22:22                 ` Thomas Fjellstrom
  2009-11-08  8:29               ` Dave Chinner
  1 sibling, 1 reply; 17+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-11-05  9:56 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Christoph Hellwig, Daniel Pittman, Rafael J. Wysocki, linux-pm,
	Maxim Levitsky, linux-kernel

On Wed, 04 Nov 2009, KOSAKI Motohiro wrote:
> > On Wed, Oct 07, 2009 at 01:14:10PM +1100, Daniel Pittman wrote:
> > > For what it is worth, I would also be quite interested to know /why/ XFS is
> > > bad in this regard.  Is it just the previously stated "XFS writes to disk
> > > despite freezing kernel threads" issue, or something deeper?
> > 
> > sync pushes out all data to disk, but in a journaling filesystem that
> > might just but the log not the "normal" place on disk.  For a boot
> > loader to deal with it properly it actually needs to do an replay of
> > the log.  Grub does so for reiserfs but not for XFS for some reason.
> > I don't know why problems don't trigger more often with ext3, though.
> 
> I'm sorry for the long delayed and offtopic responce. I discussed this
> issue with okuji-san (GRUB2 maintainer) at several month ago.
> He really wish linux implement real sync.

This is not about real sync.  It is about the box being able to reboot after
a crash or power failure.

GRUB2 is broken in that regard, at least in its peecee-BIOS version:  last
time I checked, it doesn't sort RAID components so that it won't boot from
failed or out-of-sync older components, it can't deal with some of the
filesystems being unclean...

> A bootloader has much constraint than OS (mainly caused by size constraint).
> it can't implemnt jornal log replay logic for _all_ filesystem. Why can't we
> implement storong sync syscall? I don't think this is PM nor bootloader fault.

A bootloader that can't boot a system that went through an unclean shutdown
is quite broken.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-11-05  9:56               ` Henrique de Moraes Holschuh
@ 2009-11-07 22:22                 ` Thomas Fjellstrom
  0 siblings, 0 replies; 17+ messages in thread
From: Thomas Fjellstrom @ 2009-11-07 22:22 UTC (permalink / raw)
  To: linux-kernel

On Thu November 5 2009, Henrique de Moraes Holschuh wrote:
> On Wed, 04 Nov 2009, KOSAKI Motohiro wrote:
> > > On Wed, Oct 07, 2009 at 01:14:10PM +1100, Daniel Pittman wrote:
> > > > For what it is worth, I would also be quite interested to know
> > > > /why/ XFS is bad in this regard.  Is it just the previously stated
> > > > "XFS writes to disk despite freezing kernel threads" issue, or
> > > > something deeper?
> > >
> > > sync pushes out all data to disk, but in a journaling filesystem that
> > > might just but the log not the "normal" place on disk.  For a boot
> > > loader to deal with it properly it actually needs to do an replay of
> > > the log.  Grub does so for reiserfs but not for XFS for some reason.
> > > I don't know why problems don't trigger more often with ext3, though.
> >
> > I'm sorry for the long delayed and offtopic responce. I discussed this
> > issue with okuji-san (GRUB2 maintainer) at several month ago.
> > He really wish linux implement real sync.
> 
> This is not about real sync.  It is about the box being able to reboot
>  after a crash or power failure.
> 
> GRUB2 is broken in that regard, at least in its peecee-BIOS version: 
>  last time I checked, it doesn't sort RAID components so that it won't
>  boot from failed or out-of-sync older components, it can't deal with
>  some of the filesystems being unclean...
> 
> > A bootloader has much constraint than OS (mainly caused by size
> > constraint). it can't implemnt jornal log replay logic for _all_
> > filesystem. Why can't we implement storong sync syscall? I don't think
> > this is PM nor bootloader fault.
> 
> A bootloader that can't boot a system that went through an unclean
>  shutdown is quite broken.
> 

It can barely boot a system that's gone through a clean shutdown. "bios read 
error" and all that.

-- 
Thomas Fjellstrom
tfjellstrom@shaw.ca

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-11-04  2:18             ` KOSAKI Motohiro
  2009-11-05  9:56               ` Henrique de Moraes Holschuh
@ 2009-11-08  8:29               ` Dave Chinner
  2009-11-08 16:49                 ` Christoph Hellwig
  1 sibling, 1 reply; 17+ messages in thread
From: Dave Chinner @ 2009-11-08  8:29 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Christoph Hellwig, Daniel Pittman, Henrique de Moraes Holschuh,
	Rafael J. Wysocki, linux-pm, Maxim Levitsky, linux-kernel

On Wed, Nov 04, 2009 at 11:18:05AM +0900, KOSAKI Motohiro wrote:
> > On Wed, Oct 07, 2009 at 01:14:10PM +1100, Daniel Pittman wrote:
> > > For what it is worth, I would also be quite interested to know
> > > /why/ XFS is bad in this regard.  Is it just the previously
> > > stated "XFS writes to disk despite freezing kernel threads"
> > > issue, or something deeper?
> > 
> > sync pushes out all data to disk, but in a journaling filesystem
> > that might just but the log not the "normal" place on disk.  For
> > a boot loader to deal with it properly it actually needs to do
> > an replay of the log.  Grub does so for reiserfs but not for XFS
> > for some reason.  I don't know why problems don't trigger more
> > often with ext3, though.
> 
> I'm sorry for the long delayed and offtopic responce. I discussed
> this issue with okuji-san (GRUB2 maintainer) at several month ago.
> He really wish linux implement real sync.
> 
> A bootloader has much constraint than OS (mainly caused by size
> constraint).  it can't implemnt jornal log replay logic for _all_
> filesystem.  Why can't we implement storong sync syscall? I don't
> think this is PM nor bootloader fault.

We already have an ioctl that does what you want: FIFREEZE.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-11-08  8:29               ` Dave Chinner
@ 2009-11-08 16:49                 ` Christoph Hellwig
  2009-11-09  9:42                   ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2009-11-08 16:49 UTC (permalink / raw)
  To: Dave Chinner
  Cc: KOSAKI Motohiro, Christoph Hellwig, Daniel Pittman,
	Henrique de Moraes Holschuh, Rafael J. Wysocki, linux-pm,
	Maxim Levitsky, linux-kernel

On Sun, Nov 08, 2009 at 07:29:05PM +1100, Dave Chinner wrote:
> We already have an ioctl that does what you want: FIFREEZE.

Doesn't really help as there is not guarentee important metadata is
modified again before the bootloader accesses it, but that's a fate
share with any other kind of super sync.  The only way to really fix
the problem is to implement proper (in-memory) log recovery in the
bootloader, especially as it doesn't only have to deal with the
relatively easy case of clean shutdowns but also needs to deal with the
case of an unclean shutdown with major amounts of updates to the lookup
and allocation data structures in the log.

IMHO the best option is to have a separate partition for /boot with a
very simple filesystem that we can expect boot loader developers to
implement fully and correctly.

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

* Re: [linux-pm] Massive ext4 filesystem corruption after a failed s2disk/ram cycle
  2009-11-08 16:49                 ` Christoph Hellwig
@ 2009-11-09  9:42                   ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 17+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-11-09  9:42 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Dave Chinner, KOSAKI Motohiro, Daniel Pittman, Rafael J. Wysocki,
	linux-pm, Maxim Levitsky, linux-kernel

On Sun, 08 Nov 2009, Christoph Hellwig wrote:
> IMHO the best option is to have a separate partition for /boot with a
> very simple filesystem that we can expect boot loader developers to
> implement fully and correctly.

Agreed.  And one that is not all but abandoned kernel-side, or you will risk
bugs there.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

end of thread, other threads:[~2009-11-09  9:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 21:06 Massive ext4 filesystem corruption after a failed s2disk/ram cycle Maxim Levitsky
2009-10-06 21:42 ` Theodore Tso
2009-10-06 23:02   ` Maxim Levitsky
2009-10-07 14:25     ` Jindrich Makovicka
2009-10-06 21:58 ` [linux-pm] " Rafael J. Wysocki
2009-10-06 22:53   ` Henrique de Moraes Holschuh
2009-10-06 23:02     ` Rafael J. Wysocki
2009-10-07  1:29       ` Henrique de Moraes Holschuh
2009-10-07  2:14         ` Daniel Pittman
2009-10-07 16:16           ` Christoph Hellwig
2009-11-04  2:18             ` KOSAKI Motohiro
2009-11-05  9:56               ` Henrique de Moraes Holschuh
2009-11-07 22:22                 ` Thomas Fjellstrom
2009-11-08  8:29               ` Dave Chinner
2009-11-08 16:49                 ` Christoph Hellwig
2009-11-09  9:42                   ` Henrique de Moraes Holschuh
2009-10-10  3:26 ` ext4 filesystem corruption Maxim Levitsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).