tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: where are fsck return values documented?



On Mon, 17 Mar 2008, Christos Zoulas wrote:

> | Now I noticed it reboots every time (per exit code 4 and rc.d/fsck script) 
> | after MARKING FILE SYSTEM CLEAN with "Root filesystem was modified, 
> | rebooting ..."
> | 
> | I don't recall it ever doing that before. I know it had option to reboot 
> | before but I don't remember ever noticing that happening to me.
> | 
> | Something else change to cause this?
> | 
> | I see the new fsck man page says "and updating the mount was 
> | unsuccessful". I just don't think I saw any indication of that -- or maybe 
> | I don't know what that means.
> | 
> | Is this necessary? Why?
> 
> The code in question is main.c:
> 
>       if (hotroot()) {
>               struct statvfs stfs_buf;
>               /*
>                * We modified the root.  Do a mount update on
>                * it, unless it is read-write, so we can continue.
>                */
>               if (statvfs("/", &stfs_buf) == 0) {
>                       long flags = stfs_buf.f_flag;
>                       struct ufs_args args;
> 
>                       if (flags & MNT_RDONLY) {
>                               args.fspec = 0;
>                               flags |= MNT_UPDATE | MNT_RELOAD;
>                               if (mount(MOUNT_FFS, "/", flags,
>                                   &args, sizeof args) == 0)
>                                       return FSCK_EXIT_OK;
>                       }
>               }
>               if (!preen)
>                       pwarn("\n***** REBOOT NOW *****\n");
>               sync();
>               return FSCK_EXIT_ROOT_CHANGED;
>       }
> 
> I don't see anything wrong with it. Can you add some debugging to see
> what's going on?

I will try to. This is on my main laptop so don't have chance to reboot 
often but I can try to HEAD in bochs or other emulator.

I noticed ffs_reload() in sys/ufs/ffs/ffs_vfsops.c was updated in January. 
(I didn't start using HEAD on here until 10 days ago.)

Also MNT_RELOAD is not documented in mount(2).


  Jeremy C. Reed


Home | Main Index | Thread Index | Old Index