tech-kern archive

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


In article <>,
Juan RP  <> wrote:
>On Sat, 22 Mar 2008 17:59:27 +0100
>"Juan Romero Pardines" <> 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>

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.


Home | Main Index | Thread Index | Old Index