Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 1998 18:11:27 -0400 (EDT)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        luoqi@watermarkgroup.com, mckusick@McKusick.COM
Cc:        Don.Lewis@tsc.tdk.com, current@FreeBSD.ORG
Subject:   Re: Yet another patch to try for softupdates panic
Message-ID:  <199809222211.SAA04717@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
> In case (2), the fsync() syscall does call VOP_FSYNC with MNT_WAIT
> and you most definitely *must* write out the parent directory
> entries! When the fsync system call returns, it ensures that
> the entire file, including its name, is on stable storage.
> 
> 	Kirk McKusick
> 
That's not what I see in FreeBSD's code. Here is the fsync() function
copied from kern/vfs_syscalls.c [rev1.106],

int
fsync(p, uap)
        struct proc *p;
        struct fsync_args /* {
                syscallarg(int) fd;
        } */ *uap;
{
        register struct vnode *vp;
        struct file *fp;
        int error;

        if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
                return (error);
        vp = (struct vnode *)fp->f_data;
        if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p)) == NULL) {
                if (vp->v_object) {
                        vm_object_page_clean(vp->v_object, 0, 0, FALSE);
                }
                if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP)) {
                        error = VOP_FSYNC(vp, fp->f_cred, MNT_LAZY, p);
                                                          ^^^^^^^^
                } else {
                        error = VOP_FSYNC(vp, fp->f_cred,
                                (vp->v_mount && (vp->v_mount->mnt_flag & MNT_ASY
NC)) ?
                                MNT_NOWAIT : MNT_WAIT, p);
                }
                VOP_UNLOCK(vp, 0, p);

                if ((vp->v_mount->mnt_flag & MNT_SOFTDEP) && bioops.io_sync)
                        (*bioops.io_sync)(NULL);
        }
        return (error);
}

Ok, I did a little digging through the CVS log, the waitfor flag was changed
to MNT_LAZY by John Dyson in March with the following log message:

    Correct a significant problem with the softupdates port.  Allow fsync
    to work properly within the softupdates framework, and thereby eliminate
    some unfortunate panics.

Does anyone know what significant problem John was refering to?

-lq

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809222211.SAA04717>