Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2008 02:00:08 GMT
From:      Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
To:        freebsd-i386@FreeBSD.org
Subject:   Re: i386/123768: [panic] [vm] 7.0-STABLE locking issue on Soekris net4801 (sys/vm/vm_pageout.c)
Message-ID:  <200810210200.m9L208fI059587@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/123768; it has been noted by GNATS.

From: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
To: nagilum@nagilum.org
Cc: FreeBSD-gnats-submit@freebsd.org, kib@freebsd.org, alc@freebsd.org
Subject: Re: i386/123768: [panic] [vm] 7.0-STABLE locking issue on Soekris
 net4801 (sys/vm/vm_pageout.c)
Date: Tue, 21 Oct 2008 01:51:01 +0000 (UTC)

 ----Next_Part(Tue_Oct_21_01_51_01_2008_475)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 
 The semantics of vn_start_write() doesn't match what is expected from it
 in vm_pageout_scan().
 
 If vn_start_write() is called with V_NOWAIT or PCATCH flags and the file system
 is suspending or suspended then it can return an error without clearing *mpp.
 vm_pageout_scan() expects it to be cleared on all errors.
 
 Either mp should be set to NULL in vm_pageout.c after a vn_start_write()
 failure, or vn_start_write() should be changed to clear *mpp on all failures
 where vp is not NULL.
 
 - Tor Egge
 
 ----Next_Part(Tue_Oct_21_01_51_01_2008_475)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline; filename="vnops2.diff"
 
 Index: vfs_vnops.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/kern/vfs_vnops.c,v
 retrieving revision 1.267
 diff -u -r1.267 vfs_vnops.c
 --- vfs_vnops.c	20 Sep 2008 19:48:24 -0000	1.267
 +++ vfs_vnops.c	21 Oct 2008 01:46:38 -0000
 @@ -963,12 +963,17 @@
  		while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) {
  			if (flags & V_NOWAIT) {
  				error = EWOULDBLOCK;
 +				if (vp != NULL)
 +					*mpp = NULL;
  				goto unlock;
  			}
  			error = msleep(&mp->mnt_flag, MNT_MTX(mp),
  			    (PUSER - 1) | (flags & PCATCH), "suspfs", 0);
 -			if (error)
 +			if (error) {
 +				if (vp != NULL)
 +					*mpp = NULL;
  				goto unlock;
 +			}
  		}
  	}
  	if (flags & V_XSLEEP)
 @@ -1024,6 +1029,8 @@
  	if (flags & V_NOWAIT) {
  		MNT_REL(mp);
  		MNT_IUNLOCK(mp);
 +		if (vp != NULL)
 +			*mpp = NULL;
  		return (EWOULDBLOCK);
  	}
  	/*
 @@ -1034,6 +1041,8 @@
  	vfs_rel(mp);
  	if (error == 0)
  		goto retry;
 +	if (vp != NULL)
 +		*mpp = NULL;
  	return (error);
  }
  
 
 ----Next_Part(Tue_Oct_21_01_51_01_2008_475)----



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