Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Don't fatal_error if remounting root read-write fails (http://www.linux-archive.org/debian-user/499335-dont-fatal_error-if-remounting-root-read-write-fails.html)

Will Woods 03-09-2011 07:08 PM

Don't fatal_error if remounting root read-write fails
 
As long as we can write to a few places (e.g. /etc, /var, /tmp) it's OK
if the root filesystem is readonly. Remove the fatal error if the mount
fails. Also clean up the mount call a bit - MS_MGC_VAL hasn't been
required since kernel 2.4...
---
loader/init.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/loader/init.c b/loader/init.c
index 18ff83b..39bade0 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -767,9 +767,7 @@ int main(int argc, char **argv) {
ret = setdomainname("", 0);

printf("trying to remount root filesystem read write... ");
- if (mount("/", "/", "ext2", MS_REMOUNT | MS_MGC_VAL, NULL)) {
- fatal_error(1);
- }
+ mount("/", "/", "remount", MS_REMOUNT, NULL);
printf("done
");

/* we want our /tmp to be tmpfs, but we also want to let people hack
--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Chris Lumens 03-09-2011 07:52 PM

Don't fatal_error if remounting root read-write fails
 
> As long as we can write to a few places (e.g. /etc, /var, /tmp) it's OK
> if the root filesystem is readonly. Remove the fatal error if the mount
> fails. Also clean up the mount call a bit - MS_MGC_VAL hasn't been
> required since kernel 2.4...

As long as mount(2) isn't marked with warn_unused_result, ACK to both of
these. For what it's worth, I've gotten rid of all this stuff on my
no-init branch (though, that's a long ways from being merged in).

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Will Woods 03-09-2011 08:01 PM

Don't fatal_error if remounting root read-write fails
 
On Wed, 2011-03-09 at 15:52 -0500, Chris Lumens wrote:
> > As long as we can write to a few places (e.g. /etc, /var, /tmp) it's OK
> > if the root filesystem is readonly. Remove the fatal error if the mount
> > fails. Also clean up the mount call a bit - MS_MGC_VAL hasn't been
> > required since kernel 2.4...
>
> As long as mount(2) isn't marked with warn_unused_result, ACK to both of
> these. For what it's worth, I've gotten rid of all this stuff on my
> no-init branch (though, that's a long ways from being merged in).

I applied these patches to f15-branch and everything built and ran OK -
I guess warn_unused_result would have resulted in compile failure?

Anyway, as mentioned on IRC, these patches are intended for master, but
they're also groundwork for the anaconda-as-squashfs-live-image stuff.

If memory usage becomes an F15 blocker we might need to cherry-pick them
both into f15-branch, once the lorax patches are ready.

-w

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Chris Lumens 03-09-2011 08:14 PM

Don't fatal_error if remounting root read-write fails
 
> > As long as mount(2) isn't marked with warn_unused_result, ACK to both of
> > these. For what it's worth, I've gotten rid of all this stuff on my
> > no-init branch (though, that's a long ways from being merged in).
>
> I applied these patches to f15-branch and everything built and ran OK -
> I guess warn_unused_result would have resulted in compile failure?

Correct.

> Anyway, as mentioned on IRC, these patches are intended for master, but
> they're also groundwork for the anaconda-as-squashfs-live-image stuff.
>
> If memory usage becomes an F15 blocker we might need to cherry-pick them
> both into f15-branch, once the lorax patches are ready.

Okay, let's wait to see what the whole set looks like and then if it's
acceptable, we'll cherry-pick them all to f15-branch all at once.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 04:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.