friends, may I request code review for the earth-shattering fix to:

6495558 zoneadm -z <zone> boot should not only check but repair filesystems
http://cr.opensolaris.org/~batschul/onnv-vplat/

backround:

Evaluation

when booting a zone, zoneadm ( ie. vplat.c:dofsck() ) should perform the same 
tasks as the /usr/sbin/mountall script,
which does a 'is suitable for mounting' (fsck -m) check first, followed by a 
preen fsck (fsck -p) if the former failed.

the obvious quick fix would be to change the code in vplat.c:dofsck()

    825         argv[0] = "fsck";
    826         argv[1] = "-m";
    827         argv[2] = (char *)rawdev;
    828         argv[3] = NULL;
    829 
    830         status = forkexec(zlogp, cmdbuf, argv);
    831         if (status == 0 || status == -1)
    832                 return (status);
    833         zerror(zlogp, B_FALSE, "fsck of '%s' failed with exit status 
%d; "
    834             "run fsck manually", rawdev, status);
    835         return (-1);

to always just run fsck in preen mode (shouldn't cause any real problem) or 
fork off a 2nd fsck in preen mode
if the first fsck -m failed.

actually the fix will be to just execute fsck in preen mode (fsck -p) rather 
then
doing the 'is suitable for mounting' and preen fsck dance. if the former fails,
the latter will have to be done anyways. the latter however kind of implies
the former.

thanks!
-- 
frankB

It is always possible to agglutinate multiple separate problems
into a single complex interdependent solution.
In most cases this is a bad idea.
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to