Re: possible mountroot regression

看板FB_current作者時間14年前 (2011/10/20 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串15/22 (看更多)
On Oct 18, 2011, at 9:04 AM, Andriy Gapon wrote: > on 14/10/2011 18:54 Arnaud Lacombe said the following: >> Andry Gapon wrote: >>> Simple: revert to the previous behavior. If a user enters incorrect = device name >>> (i.e. root mounting fails), then return back to the prompt instead = of panicing. >> That should do the job. >>=20 >> - Arnaud >>=20 >> --- >> sys/kern/vfs_mountroot.c | 45 = +++++++++++++++++++++++---------------------- >> 1 files changed, 23 insertions(+), 22 deletions(-) >>=20 >> diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c >> index ccbcb33..ae3ffa7 100644 >> --- a/sys/kern/vfs_mountroot.c >> +++ b/sys/kern/vfs_mountroot.c >> @@ -481,28 +481,29 @@ parse_dir_ask(char **conf) >> printf("\n"); >> printf(" ? List valid disk boot devices\n"); >> printf(" . Yield 1 second (for background = tasks)\n"); >> - printf(" <empty line> Abort manual input\n"); >> + printf(" x Abort manual input)\n"); >> + >> + do { >> + error =3D EINVAL; >> + printf("\nmountroot> "); >> + gets(name, sizeof(name), GETS_ECHO); >> + if (name[0] =3D=3D '?') { >> + printf("\nList of GEOM managed disk devices:\n = "); >> + g_dev_print(); >> + continue; >> + } >> + if (name[0] =3D=3D '.') { >> + pause("rmask", hz); >> + continue; >> + } >> + if (name[0] =3D=3D 'x' && name[1] =3D=3D '\0') >> + break; >> + mnt =3D name; >> + error =3D parse_mount(&mnt); >> + if (error < 0) >> + printf("Invalid specification.\n"); >> + } while (error !=3D 0); >>=20 >> - again: >> - printf("\nmountroot> "); >> - gets(name, sizeof(name), GETS_ECHO); >> - if (name[0] =3D=3D '\0') >> - return (0); >> - if (name[0] =3D=3D '?') { >> - printf("\nList of GEOM managed disk devices:\n "); >> - g_dev_print(); >> - goto again; >> - } >> - if (name[0] =3D=3D '.') { >> - pause("rmask", hz); >> - goto again; >> - } >> - mnt =3D name; >> - error =3D parse_mount(&mnt); >> - if (error =3D=3D -1) { >> - printf("Invalid specification.\n"); >> - goto again; >> - } >> return (error); >> } >>=20 >=20 > Arnaud, >=20 > I like how your change fixes the regression and improves code style. > As you've said, the 'x' change is unrelated. I like it, but it needs = to be > discussed and committed separately. >=20 > Marcel, >=20 > what do you think? I like it. > Would you be able to commit a variant of this patch sans the 'x' part? >=20 Yes, soonish. If people like the 'x' change I can do that in a followup commit as well. I just need to know if people like it or not... --=20 Marcel Moolenaar marcel@xcllnt.net _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1Edn1Yld (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1Edn1Yld (FB_current)