netbsd-bugs@netbsd.org
[Top] [All Lists]

Re: kern/38460: fstrans_start code in genfs_do_putpages is racy

Subject: Re: kern/38460: fstrans_start code in genfs_do_putpages is racy
From: YAMAMOTO Takashi
Date: Sat, 19 Apr 2008 10:40:02 +0000 UTC
The following reply was made to PR kern/38460; it has been noted by GNATS.

From: yamt@xxxxxxxxxxxxxxxxx (YAMAMOTO Takashi)
To: hannken@xxxxxxxxxxxxxxx
Cc: gnats-bugs@xxxxxxxxxx, kern-bug-people@xxxxxxxxxx, gnats-admin@xxxxxxxxxx,
        netbsd-bugs@xxxxxxxxxx
Subject: Re: kern/38460: fstrans_start code in genfs_do_putpages is racy
Date: Sat, 19 Apr 2008 19:38:38 +0900 (JST)

 > On Sat, Apr 19, 2008 at 08:05:00AM +0000, yamt@xxxxxxxxxxxxxxxxx wrote:
 > > >Synopsis:       fstrans_start code in genfs_do_putpages is racy
 > 
 > This diff should fix it. Ok?
 
 doesn't it break the existing "goto retry"?
 
 YAMAMOTO Takashi
 
 > -- 
 > Juergen Hannken-Illjes - hannken@xxxxxxxxxxxxxxx - TU Braunschweig (Germany)
 > 
 > Index: genfs_io.c
 > ===================================================================
 > RCS file: /cvsroot/src/sys/miscfs/genfs/genfs_io.c,v
 > retrieving revision 1.5
 > diff -p -u -2 -r1.5 genfs_io.c
 > --- genfs_io.c       18 Jan 2008 11:01:23 -0000      1.5
 > +++ genfs_io.c       19 Apr 2008 09:38:14 -0000
 > @@ -779,7 +779,8 @@ genfs_do_putpages(struct vnode *vp, off_
 >          vp, uobj->uo_npages, startoff, endoff - startoff);
 >  
 > +    has_trans = false;
 > +
 >  retry:
 >      modified = false;
 > -    has_trans = false;
 >      flags = origflags;
 >      KASSERT((vp->v_iflag & VI_ONWORKLST) != 0 ||
 > @@ -791,4 +792,6 @@ retry:
 >                              vn_syncer_remove_from_worklist(vp);
 >              }
 > +            if (has_trans)
 > +                    fstrans_done(vp->v_mount);
 >              mutex_exit(slock);
 >              return (0);
 > @@ -799,5 +802,5 @@ retry:
 >       */
 >  
 > -    if ((flags & PGO_CLEANIT) != 0) {
 > +    if (!has_trans && (flags & PGO_CLEANIT) != 0) {
 >              mutex_exit(slock);
 >              if (pagedaemon) {
 > @@ -809,4 +812,5 @@ retry:
 >              has_trans = true;
 >              mutex_enter(slock);
 > +            goto retry;
 >      }
 >  
 

<Prev in Thread] Current Thread [Next in Thread>