linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@digeo.com>,
	Nigel Cunningham <ncunningham@clear.net.nz>,
	cat@zip.com.au, mbligh@aracnet.com, gigerstyle@gmx.ch,
	geert@linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: Fix SWSUSP & !SWAP
Date: Thu, 24 Apr 2003 22:48:05 +0200	[thread overview]
Message-ID: <20030424204805.GA379@elf.ucw.cz> (raw)
In-Reply-To: <20030424103734.O26054@schatzie.adilger.int>

Hi!

> > > > > > > Sorry, I still don't get it.  Go through the steps for me:
> > > > > > > 
> > > > > > > 1) suspend writes pages to disk
> > > > > > > 
> > > > > > > 2) machine is shutdown
> > > > > > > 
> > > > > > > 3) restart, journal replay
> > > > 
> > > > Corruption comes here. The journal reply tidies things up that shouldn't
> > > > be tidied up. They shouldn't be tidied up because once we reload the
> > > > image, things should be in the same state as prior to suspend. If replay
> > > > frees a block (thinking it wasn't properly linked or something similar),
> > > > it introduces corruption.
> > > 
> > > No, this will not happen.  All swapfile blocks must be allocated by swapon
> > > time.  It is just a chunk of disk and replay will not touch it.
> > > 
> > > That's for ext3, and no other filesystems journal data anyway...
> > 
> > Its not about data.
> > 
> > Corruption is not in suspended image. Imagine you have running system
> > (X open, applications running, gcc compiling) and someone runs journal
> > replay. Bye bye data. And that's what happens there. When you restore,
> > restored kernel no longer knows you did replay.
> 
> Wouldn't that be true in all cases where you have a journaled filesystem
> and you suspend?  

No. In normal state you restore without mounting anything (thus no
journal replay).

> Are you talking about someone restarting system (without
> doing a resume), mounting the file system (causing journal replay), and
> then shutting down and going back to the suspended image?

No, I'm not.

> I think the important thing to note is that if you don't unmount the
> filesystem during suspend, then no journal recovery will take place
> at resume time, because you are not really mounting the filesystem
> at all.  And I can't see how you could be unmounting the filesystems
> without killing all of the applications, at which point it would make
> suspend pretty useless.

No, I'm not unmounting it.

> What is also important to note is that during normal filesystem operation,
> the ext3 journaling code never reads back any data from the journal, with
> the exception of a couple of fields in the journal superblock.  I would
> hazard a guess that if you did a suspend, wiped the journal, and then
> resumed the journaling code wouldn't know the difference.

That's possible, but I do not want suspend to know about filesystem
specifics.

								Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  reply	other threads:[~2003-04-24 20:38 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 13:51 Fix SWSUSP & !SWAP Pavel Machek
2003-04-23 14:32 ` Geert Uytterhoeven
2003-04-23 14:47   ` Pavel Machek
2003-04-23 15:56     ` gigerstyle
2003-04-23 19:41       ` Nigel Cunningham
2003-04-23 20:36         ` Marc Giger
2003-04-23 22:25           ` Nigel Cunningham
2003-04-23 23:28             ` Martin J. Bligh
2003-04-23 23:58               ` Pavel Machek
2003-04-23 23:55                 ` Martin J. Bligh
2003-04-24  0:07                 ` Andrew Morton
2003-04-24  0:17                   ` CaT
2003-04-24  0:16                     ` Nigel Cunningham
2003-04-24  0:26                       ` Randy.Dunlap
2003-04-24  0:31                         ` CaT
2003-04-24  0:38                         ` Andrew Morton
2003-04-24  0:54                           ` CaT
2003-04-24  1:06                             ` Andrew Morton
2003-04-24  8:48                           ` John Bradford
2003-04-24  0:37                       ` Andrew Morton
2003-04-24  9:12                         ` Pavel Machek
2003-04-24  9:25                           ` Andrew Morton
2003-04-24  9:35                             ` Pavel Machek
2003-04-24  9:46                               ` Andrew Morton
2003-04-24 11:13                                 ` Nigel Cunningham
2003-04-24 11:36                                   ` Andrew Morton
2003-04-24 14:26                                     ` Pavel Machek
2003-04-24 16:37                                       ` Andreas Dilger
2003-04-24 20:48                                         ` Pavel Machek [this message]
2003-04-24 21:46                                           ` Andreas Dilger
2003-04-25  1:09                                             ` Nigel Cunningham
2003-04-25 12:59                                               ` Pavel Machek
2003-04-25 16:20                                                 ` Andreas Dilger
2003-04-25 18:28                                                   ` Nigel Cunningham
2003-04-25 19:32                                                     ` Jamie Lokier
2003-04-25 19:58                                                     ` Andreas Dilger
2003-04-27 18:59                                                   ` Pavel Machek
2003-04-24 11:36                                   ` Geert Uytterhoeven
2003-04-25  1:22                                     ` H. Peter Anvin
2003-04-25  1:19                                       ` Nigel Cunningham
2003-04-25  1:31                                       ` Hua Zhong
2003-04-25 19:41                                         ` H. Peter Anvin
2003-04-25  4:27                                       ` Andreas Dilger
2003-04-25  4:33                                         ` H. Peter Anvin
2003-04-24  0:25                   ` Pavel Machek
2003-04-24  9:01                     ` Andrew Morton
2003-04-24  9:14                       ` Pavel Machek
2003-04-24  9:05                     ` Jamie Lokier
2003-04-24  9:34                       ` Pavel Machek
2003-04-24 15:22                     ` Carl-Daniel Hailfinger
2003-04-24  8:00             ` Marc Giger
2003-04-23 23:47 Grover, Andrew
2003-04-24  0:03 ` Pavel Machek
2003-04-23 23:57   ` Martin J. Bligh
2003-04-24  0:25     ` Pavel Machek
2003-04-24  0:37       ` CaT
2003-04-24  0:49       ` Martin J. Bligh
2003-04-24  9:16         ` Pavel Machek
2003-04-24  0:02   ` Nigel Cunningham
2003-04-24  0:23     ` Pavel Machek
2003-04-24  0:45     ` Martin J. Bligh
2003-04-24  3:17       ` Nigel Cunningham
2003-04-24  4:37         ` Martin J. Bligh
2003-04-24  7:49           ` Marc Giger
2003-04-24  9:27           ` Pavel Machek
2003-04-24  3:49   ` David Ford
2003-04-24  6:54     ` Jörn Engel
2003-04-24  7:01     ` Elladan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030424204805.GA379@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@digeo.com \
    --cc=cat@zip.com.au \
    --cc=geert@linux-m68k.org \
    --cc=gigerstyle@gmx.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=ncunningham@clear.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).