tech-kern archive

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

Re: FSCK_EXIT_ROOT_CHANGED



In article <20080322183849.bf68aacb.xtraeme%gmail.com@localhost>,
Juan RP  <xtraeme%gmail.com@localhost> wrote:
>On Sat, 22 Mar 2008 17:59:27 +0100
>"Juan Romero Pardines" <xtraeme%gmail.com@localhost> wrote:
>
>> Forgot to check errno for mount, it's returning EINVAL.
>
>I added printfs to do_sys_mount() in vfs_syscalls.c and because
>fsck_ffs:main.c sets MNT_UPDATE, mount_update() calls VFS_MOUNT()
>and this returns EINVAL.

Strange, the code from:

#include <sys/param.h>
#include <sys/time.h>
#include <sys/mount.h>
#include <ufs/ufs/ufsmount.h>
#include <err.h>
#include <stdlib.h>
#include <unistd.h>

int
main(int argc, char **argv)
{
        struct statvfs stfs_buf;
        struct ufs_args args;
        int flags;

        if (statvfs("/", &stfs_buf) != 0)
                err(1, "statvfs");

        flags = stfs_buf.f_flag;

        args.fspec = 0;
        flags |= MNT_UPDATE | MNT_RELOAD;
        if (mount(MOUNT_FFS, "/", flags, &args, sizeof args) != 0)
                err(1, "mount");
        return 0;
}

Works for me; well, really it crashes the fs, but I filed a PR for it.
$ mount -u -o ro /
then run this.

christos



Home | Main Index | Thread Index | Old Index