2004-10-26 02:21:17

by Zhu Yi

[permalink] [raw]
Subject: [PATCH] [swsusp] print error message when swapping is disabled (fwd)


Hi Andrew,

This patch gives some clues to the user when swapping is not enabled during
swsusp. Please apply.


Signed-off-by: Zhu Yi <[email protected]>

--- linux-2.6.9-orig/kernel/power/swsusp.c 2004-10-24 16:16:41.000000000 +0800
+++ linux-2.6.9/kernel/power/swsusp.c 2004-10-24 16:15:06.000000000 +0800
@@ -843,8 +843,11 @@ asmlinkage int swsusp_save(void)
{
int error = 0;

- if ((error = swsusp_swap_check()))
+ if ((error = swsusp_swap_check())) {
+ printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
+ "swapon -a!\n");
return error;
+ }
return suspend_prepare_image();
}



2004-10-26 03:20:21

by Chris Wedgwood

[permalink] [raw]
Subject: Re: [PATCH] [swsusp] print error message when swapping is disabled (fwd)

> + if ((error = swsusp_swap_check())) {
> + printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
> + "swapon -a!\n");

maybe it's just me, but i would really prefer to have the occasional
long(er) line that splitting strings like that

2004-10-26 09:15:12

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] [swsusp] print error message when swapping is disabled (fwd)

Hi!

> > + if ((error = swsusp_swap_check())) {
> > + printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
> > + "swapon -a!\n");
>
> maybe it's just me, but i would really prefer to have the occasional
> long(er) line that splitting strings like that

It is not just you :-). Also it should probably not have KERN_ERR
level (it is not really error, you just asked for something that can
not be done) and word FATAL scares me.

But it is probably easier to put there some message first then fix it
up.

Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

2004-10-26 09:19:02

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] [swsusp] print error message when swapping is disabled (fwd)

Pavel Machek <[email protected]> wrote:
>
> > > + if ((error = swsusp_swap_check())) {
> > > + printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
> > > + "swapon -a!\n");
> >
> > maybe it's just me, but i would really prefer to have the occasional
> > long(er) line that splitting strings like that
>
> It is not just you :-).

Try looking at that long line in an 80-col xterm. It looks worse than it
does with the manual break.