Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 12:49:48 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        Kirk McKusick <mckusick@mckusick.com>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Nasty non-recursive lockmgr panic on softdep only enabled UFS partition when filesystem full
Message-ID:  <BANLkTi=Gm%2BGwi6XpAQfe_AieHz=VBY2v=Q@mail.gmail.com>
In-Reply-To: <20110505173600.GB48734@deviant.kiev.zoral.com.ua>
References:  <BANLkTik4=O_1PWB2GzGzY=m51dG-Kbhe%2BQ@mail.gmail.com> <201105040559.p445xEJ5024585@chez.mckusick.com> <BANLkTikAQ6Jz4Jbjxh51iA-cjCYmdx1mSg@mail.gmail.com> <BANLkTik8F_SvEzW-vPW9=dZUEJuYOy9WcQ@mail.gmail.com> <20110504090718.GN48734@deviant.kiev.zoral.com.ua> <9E4C162F-B4EA-4378-A010-3E8D0D23EA93@gmail.com> <20110505173600.GB48734@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 5, 2011 at 10:36 AM, Kostik Belousov <kostikbel@gmail.com> wrot=
e:
> On Thu, May 05, 2011 at 10:23:47AM -0700, Garrett Cooper wrote:
>> On May 4, 2011, at 2:07 AM, Kostik Belousov wrote:
>>
>> > On Tue, May 03, 2011 at 11:58:49PM -0700, Garrett Cooper wrote:
>> >> On Tue, May 3, 2011 at 11:42 PM, Garrett Cooper <yanegomi@gmail.com> =
wrote:
>> >>> On Tue, May 3, 2011 at 10:59 PM, Kirk McKusick <mckusick@mckusick.co=
m> wrote:
>> >>>>> Date: Tue, 3 May 2011 22:40:26 -0700
>> >>>>> Subject: Nasty non-recursive lockmgr panic on softdep only enabled=
 UFS
>> >>>>> =A0partition when filesystem full
>> >>>>> From: Garrett Cooper <yanegomi@gmail.com>
>> >>>>> To: Jeff Roberson <jeff@freebsd.org>,
>> >>>>> =A0 =A0 =A0 =A0 Marshall Kirk McKusick <mckusick@mckusick.com>
>> >>>>> Cc: FreeBSD Current <freebsd-current@freebsd.org>
>> >>>>>
>> >>>>> Hi Jeff and Dr. McKusick,
>> >>>>> =A0 =A0 Ran into this panic when /usr ran out of space doing a mak=
e
>> >>>>> universe on amd64/r221219 (it took ~15 minutes for the panic to oc=
cur
>> >>>>> after the filesystem ran out of space -- wasn't quite sure what it=
 was
>> >>>>> doing at the time):
>> >>>>>
>> >>>>> ...
>> >>>>>
>> >>>>> =A0 =A0 Let me know what other commands you would like for me to r=
un in kgdb.
>> >>>>> Thanks,
>> >>>>> -Garrett
>> >>>>
>> >>>> You did not indicate whether you are running an 8.X system or a 9-c=
urrent
>> >>>> system. It would be helpful to know that.
>> >>>
>> >>> I've actually been running CURRENT for a few years now, but you're r=
ight --
>> >>> I didn't mention that part.
>> >>>
>> >>>> Jeff thinks that there may be a potential race in the locking code =
for
>> >>>> softdep_request_cleanup. If so, this patch for 9-current should fix=
 it:
>> >>>>
>> >>>> Index: ffs_softdep.c
>> >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >>>> --- ffs_softdep.c =A0 =A0 =A0 (revision 221385)
>> >>>> +++ ffs_softdep.c =A0 =A0 =A0 (working copy)
>> >>>> @@ -11380,7 +11380,8 @@
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cont=
inue;
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MNT_IUNLOCK(mp);
>> >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vget(lvp, LK_EXCL=
USIVE | LK_INTERLOCK, curthread)) {
>> >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vget(lvp, LK_EXCL=
USIVE | LK_NOWAIT | LK_INTERLOCK,
>> >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 curthread)) {
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MNT_=
ILOCK(mp);
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cont=
inue;
>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>> >>>>
>> >>>> If you are running an 8.X system, hopefully you will be able to app=
ly it.
>> >>>
>> >>> =A0 =A0I've applied it, rebuilt and installed the kernel, and trying=
 to
>> >>> repro the case again. Will let you know how things go!
>> >>
>> >> =A0 =A0Happened again with the change. It's really easy to repro:
>> >>
>> >> 1. Get a filesystem with UFS+SU
>> >> 2. Execute something that does a large number of small writes to a pa=
rtition.
>> >> 3. 'dd if=3D/dev/zero of=3DFOO bs=3D10m' on the same partition
>> >>
>> >> =A0 =A0The kernel will panic with the issue I discussed above.
>> >> Thanks!
>> >
>> > Jeff' change is required to avoid LORs, but it is not sufficient to
>> > prevent recursion. We must skip the vnode supplied as a parameter to
>> > softdep_request_cleanup(). Theoretically, other vnodes might be also
>> > locked by curthread, thus I think the change below is needed. Try this=
.
>> >
>> > diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
>> > index a6d4441..25fa5d6 100644
>> > --- a/sys/ufs/ffs/ffs_softdep.c
>> > +++ b/sys/ufs/ffs/ffs_softdep.c
>> > @@ -11380,7 +11380,9 @@ retry:
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MNT_IUNLOCK(mp);
>> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vget(lvp, LK_EXCLUSIVE | LK_=
INTERLOCK, curthread)) {
>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (VOP_ISLOCKED(lvp) ||
>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 vget(lvp, LK_EXCLUSIVE |=
 LK_INTERLOCK | LK_NOWAIT,
>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 curthread)) {
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MNT_ILOCK(mp);
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>>
>> =A0 =A0 =A0 Ran into the same panic after I applied the patch above with=
 the repro steps I described before. One thing that I noticed is that the i=
ssue isn't as easy to reproduce unless you add the dd in parallel with the =
make operation.
>
> Well, I misread your original report. Also, there is another issue
> that is easily reproducable in similar situation. The latest patch
> is below.
>
> diff --git a/sys/sys/mount.h b/sys/sys/mount.h
> index 231e3d6..f064053 100644
> --- a/sys/sys/mount.h
> +++ b/sys/sys/mount.h
> @@ -366,6 +366,8 @@ void =A0 =A0 =A0 =A0 =A0__mnt_vnode_markerfree(struct=
 vnode **mvp, struct mount *mp);
> =A0#define MNT_LAZY =A0 =A0 =A0 3 =A0 =A0 =A0 /* push data not written by=
 filesystem syncer */
> =A0#define MNT_SUSPEND =A0 =A04 =A0 =A0 =A0 /* Suspend file system after =
sync */
>
> +#define =A0 =A0 =A0 =A0MNT_WAIT_ADV =A0 =A00x10000000 =A0 =A0 =A0/* MNT_=
WAIT prevent deadlock */
> +
> =A0/*
> =A0* Generic file handle
> =A0*/
> diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
> index e60514d..87837cc 100644
> --- a/sys/ufs/ffs/ffs_alloc.c
> +++ b/sys/ufs/ffs/ffs_alloc.c
> @@ -420,13 +420,13 @@ nospace:
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0if (reclaimed =3D=3D 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reclaimed =3D 1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 softdep_request_cleanup(fs, vp, cred, FLUSH=
_BLOCKS_WAIT);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 UFS_UNLOCK(ump);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (bp) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 UFS_UNLOCK(ump);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0brelse(bp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bp =3D NULL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 UFS_LOCK(ump);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 UFS_LOCK(ump);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 softdep_request_cleanup(fs, vp, cred, FLUSH=
_BLOCKS_WAIT);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto retry;
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0UFS_UNLOCK(ump);
> diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
> index d819c8a..d12e1dc 100644
> --- a/sys/ufs/ffs/ffs_extern.h
> +++ b/sys/ufs/ffs/ffs_extern.h
> @@ -141,7 +141,7 @@ void =A0 =A0 =A0 =A0softdep_setup_inofree(struct moun=
t *, struct buf *, ino_t,
> =A0void =A0 softdep_setup_sbupdate(struct ufsmount *, struct fs *, struct=
 buf *);
> =A0void =A0 *softdep_setup_trunc(struct vnode *vp, off_t length, int flag=
s);
> =A0void =A0 softdep_fsync_mountdev(struct vnode *);
> -int =A0 =A0softdep_sync_metadata(struct vnode *);
> +int =A0 =A0softdep_sync_metadata(struct vnode *, int flags);
> =A0int =A0 =A0 softdep_process_worklist(struct mount *, int);
> =A0int =A0 =A0 softdep_fsync(struct vnode *);
> =A0int =A0 =A0softdep_waitidle(struct mount *);
> diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
> index a6d4441..0b66e68 100644
> --- a/sys/ufs/ffs/ffs_softdep.c
> +++ b/sys/ufs/ffs/ffs_softdep.c
> @@ -492,7 +492,7 @@ softdep_flushworklist(oldmnt, countp, td)
> =A0}
>
> =A0int
> -softdep_sync_metadata(struct vnode *vp)
> +softdep_sync_metadata(struct vnode *vp, int flags)
> =A0{
>
> =A0 =A0 =A0 =A0return (0);
> @@ -733,7 +733,7 @@ static =A0 =A0 =A0void unlinked_inodedep(struct mount=
 *, struct inodedep *);
> =A0static void clear_unlinked_inodedep(struct inodedep *);
> =A0static struct inodedep *first_unlinked_inodedep(struct ufsmount *);
> =A0static int flush_pagedep_deps(struct vnode *, struct mount *,
> - =A0 =A0 =A0 =A0 =A0 struct diraddhd *);
> + =A0 =A0 =A0 =A0 =A0 struct diraddhd *, int);
> =A0static void free_pagedep(struct pagedep *);
> =A0static int flush_newblk_dep(struct vnode *, struct mount *, ufs_lbn_t)=
;
> =A0static int flush_inodedep_deps(struct mount *, ino_t);
> @@ -10662,7 +10662,7 @@ restart:
> =A0* associated with the file. If any I/O errors occur, they are returned=
.
> =A0*/
> =A0int
> -softdep_sync_metadata(struct vnode *vp)
> +softdep_sync_metadata(struct vnode *vp, int flags)
> =A0{
> =A0 =A0 =A0 =A0struct pagedep *pagedep;
> =A0 =A0 =A0 =A0struct allocindir *aip;
> @@ -10792,7 +10792,8 @@ loop:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0continue;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((error=
 =3D
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fl=
ush_pagedep_deps(vp, wk->wk_mp,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 &pagedep->pd_diraddhd[i]))) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 &pagedep->pd_diraddhd[i],
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 flags))) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0FREE_LOCK(&lk);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0goto loop_end;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> @@ -11056,10 +11057,11 @@ flush_newblk_dep(vp, mp, lbn)
> =A0* Called with splbio blocked.
> =A0*/
> =A0static int
> -flush_pagedep_deps(pvp, mp, diraddhdp)
> +flush_pagedep_deps(pvp, mp, diraddhdp, flags)
> =A0 =A0 =A0 =A0struct vnode *pvp;
> =A0 =A0 =A0 =A0struct mount *mp;
> =A0 =A0 =A0 =A0struct diraddhd *diraddhdp;
> + =A0 =A0 =A0 int flags;
> =A0{
> =A0 =A0 =A0 =A0struct inodedep *inodedep;
> =A0 =A0 =A0 =A0struct inoref *inoref;
> @@ -11069,8 +11071,13 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
> =A0 =A0 =A0 =A0int error =3D 0;
> =A0 =A0 =A0 =A0struct buf *bp;
> =A0 =A0 =A0 =A0ino_t inum;
> + =A0 =A0 =A0 int lkflags;
>
> =A0 =A0 =A0 =A0ump =3D VFSTOUFS(mp);
> + =A0 =A0 =A0 lkflags =3D LK_EXCLUSIVE;
> + =A0 =A0 =A0 if ((flags & MNT_WAIT_ADV) !=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 lkflags |=3D LK_NOWAIT;
> +
> =A0restart:
> =A0 =A0 =A0 =A0while ((dap =3D LIST_FIRST(diraddhdp)) !=3D NULL) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*
> @@ -11112,7 +11119,7 @@ restart:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dap->da_state & MKDIR_BODY) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FREE_LOCK(&lk);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D ffs_vgetf(mp=
, inum, LK_EXCLUSIVE, &vp,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D ffs_vgetf(mp=
, inum, lkflags, &vp,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FFSV_FORCEINSMQ)))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D flush_newblk_dep=
(vp, mp, 0);
> @@ -11176,7 +11183,7 @@ retry:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dap =3D=3D LIST_FIRST(diraddhdp)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FREE_LOCK(&lk);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D ffs_vgetf(mp=
, inum, LK_EXCLUSIVE, &vp,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D ffs_vgetf(mp=
, inum, lkflags, &vp,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FFSV_FORCEINSMQ)))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D ffs_update(vp, M=
NT_WAIT);
> @@ -11379,17 +11386,17 @@ retry:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VI_UNLOCK(=
lvp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MNT_IUNLOCK(mp);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vget(lvp, LK_EXCLUSIVE =
| LK_INTERLOCK, curthread)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MNT_ILOCK(m=
p);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vget(lvp, LK_EXCLUSIVE =
| LK_INTERLOCK | LK_NOWAIT,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 curthread)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MNT_IUNLOCK(mp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (lvp->v_vflag & VV_NOSY=
NC) { /* unlinked */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vput(lvp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MNT_ILOCK(=
mp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (void) ffs_syncvnode(lvp, M=
NT_WAIT);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (void) ffs_syncvnode(lvp, M=
NT_WAIT | MNT_WAIT_ADV);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vput(lvp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MNT_ILOCK(mp);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
> index cf6a5a8..c73e2a5 100644
> --- a/sys/ufs/ffs/ffs_vnops.c
> +++ b/sys/ufs/ffs/ffs_vnops.c
> @@ -216,9 +216,11 @@ ffs_syncvnode(struct vnode *vp, int waitfor)
> =A0 =A0 =A0 =A0struct bufobj *bo;
> =A0 =A0 =A0 =A0struct buf *bp;
> =A0 =A0 =A0 =A0struct buf *nbp;
> - =A0 =A0 =A0 int s, error, wait, passes, skipmeta;
> + =A0 =A0 =A0 int s, error, wait, passes, skipmeta, wait_adv;
> =A0 =A0 =A0 =A0ufs_lbn_t lbn;
>
> + =A0 =A0 =A0 wait_adv =3D waitfor & MNT_WAIT_ADV;
> + =A0 =A0 =A0 waitfor &=3D ~MNT_WAIT_ADV;
> =A0 =A0 =A0 =A0wait =3D (waitfor =3D=3D MNT_WAIT);
> =A0 =A0 =A0 =A0lbn =3D lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize =
- 1));
> =A0 =A0 =A0 =A0bo =3D &vp->v_bufobj;
> @@ -328,7 +330,7 @@ loop:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * with the vnode has been written.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0splx(s);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D softdep_sync_metadata(vp)) !=
=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((error =3D softdep_sync_metadata(vp, wa=
it_adv)) !=3D 0)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (error);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0s =3D splbio();

    Things look ok with that patch and the one that Jeff provided for
the LOR, taking into account your style change with the flag list.
Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTi=Gm%2BGwi6XpAQfe_AieHz=VBY2v=Q>