* [PATCH RESEND] Don't remove /sys in initramfs
@ 2004-11-05 15:26 Juerg Billeter
0 siblings, 0 replies; 3+ messages in thread
From: Juerg Billeter @ 2004-11-05 15:26 UTC (permalink / raw)
To: linux-kernel; +Cc: torvalds
Using the "resume" kernel parameter together with an initramfs revealed
a bug that causes removal of the /sys directory in the initramfs' tmpfs,
making the system unbootable.
The source of the problem is that the try_name() function removes
the /sys directory unconditionally, instead of removing it only when it
has been created by try_name().
The attached patch only removes /sys if it has been created before.
Please CC me, I'm not on lkml.
Juerg
--
Signed-off-by: Juerg Billeter <juerg@paldo.org>
diff -upNr linux-2.6.10-rc1-bk15.orig/init/do_mounts.c linux-2.6.10-rc1-bk15/init/do_mounts.c
--- linux-2.6.10-rc1-bk15.orig/init/do_mounts.c 2004-10-18 23:53:51.000000000 +0200
+++ linux-2.6.10-rc1-bk15/init/do_mounts.c 2004-11-05 16:24:17.816549948 +0100
@@ -142,7 +142,7 @@ dev_t __init name_to_dev_t(char *name)
int part;
#ifdef CONFIG_SYSFS
- sys_mkdir("/sys", 0700);
+ int mkdir_err = sys_mkdir("/sys", 0700);
if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
goto out;
#endif
@@ -197,7 +197,8 @@ done:
#ifdef CONFIG_SYSFS
sys_umount("/sys", 0);
out:
- sys_rmdir("/sys");
+ if (!mkdir_err)
+ sys_rmdir("/sys");
#endif
return res;
fail:
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH RESEND] Don't remove /sys in initramfs
@ 2004-11-11 16:33 Juerg Billeter
2004-11-12 0:51 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Juerg Billeter @ 2004-11-11 16:33 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm
Using the "resume" kernel parameter together with an initramfs revealed
a bug that causes removal of the /sys directory in the initramfs' tmpfs,
making the system unbootable.
The source of the problem is that the try_name() function removes
the /sys directory unconditionally, instead of removing it only when it
has been created by try_name().
The attached patch only removes /sys if it has been created before.
Please CC me, I'm not on lkml.
Juerg
--
Signed-off-by: Juerg Billeter <juerg@paldo.org>
diff -upNr linux-2.6.10-rc1-bk15.orig/init/do_mounts.c linux-2.6.10-rc1-bk15/init/do_mounts.c
--- linux-2.6.10-rc1-bk15.orig/init/do_mounts.c 2004-10-18 23:53:51.000000000 +0200
+++ linux-2.6.10-rc1-bk15/init/do_mounts.c 2004-11-05 16:24:17.816549948 +0100
@@ -142,7 +142,7 @@ dev_t __init name_to_dev_t(char *name)
int part;
#ifdef CONFIG_SYSFS
- sys_mkdir("/sys", 0700);
+ int mkdir_err = sys_mkdir("/sys", 0700);
if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
goto out;
#endif
@@ -197,7 +197,8 @@ done:
#ifdef CONFIG_SYSFS
sys_umount("/sys", 0);
out:
- sys_rmdir("/sys");
+ if (!mkdir_err)
+ sys_rmdir("/sys");
#endif
return res;
fail:
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH RESEND] Don't remove /sys in initramfs
2004-11-11 16:33 Juerg Billeter
@ 2004-11-12 0:51 ` Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2004-11-12 0:51 UTC (permalink / raw)
To: Juerg Billeter; +Cc: linux-kernel
Juerg Billeter <juerg@paldo.org> wrote:
>
> Using the "resume" kernel parameter together with an initramfs revealed
> a bug that causes removal of the /sys directory in the initramfs' tmpfs,
> making the system unbootable.
>
> The source of the problem is that the try_name() function removes
> the /sys directory unconditionally, instead of removing it only when it
> has been created by try_name().
>
> The attached patch only removes /sys if it has been created before.
The patch looks sane. Your email client replaced tabs with spaces. I
fixed that up. In future, please send the patch to yourself first, check
that it still applies, then send it on, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-12 0:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-05 15:26 [PATCH RESEND] Don't remove /sys in initramfs Juerg Billeter
2004-11-11 16:33 Juerg Billeter
2004-11-12 0:51 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®