Re: Fix SWSUSP & !SWAP

H. Peter Anvin
2003-04-25T01:11:12Z

Followup to: <Pine.GSO.4.21.0304241335210.19942-100000@vervain.sonytel.be>
By author: Geert Uytterhoeven <geert@linux-m68k.org>
In newsgroup: linux.dev.kernel
>
> On Thu, 24 Apr 2003, Nigel Cunningham wrote:
> > On Thu, 2003-04-24 at 21:46, Andrew Morton wrote:
> > > > > 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.
>
> This has nothing to do with using a swapfile.
>
> But if you resume from swsusp, you don't really `mount' all file systems. They
> are implicitly mounted because they were mounted before the suspend operation.
>

Shouldn't we be syncing them all before the suspend anyway, to
minimize corruption in case the user chooses to mount the filesystem
*without* resuming (think a dual-boot configuration.) This would be
another application for the "supersync" operation that was discussed
at OLS 2002 -- a need for an operation which not only flushes all
blocks to disk but also forces the journal to be replayed and
truncated.

-hpa

--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64