i386/123768: [panic] [vm] 7.0-STABLE locking issue on Soekris
net4801 (sys/vm/vm_pageout.c)
Tor Egge
Tor.Egge at cvsup.no.freebsd.org
Tue Oct 21 02:00:09 UTC 2008
The following reply was made to PR i386/123768; it has been noted by GNATS.
From: Tor Egge <Tor.Egge at cvsup.no.freebsd.org>
To: nagilum at nagilum.org
Cc: FreeBSD-gnats-submit at freebsd.org, kib at freebsd.org, alc at 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)----
More information about the freebsd-i386
mailing list