<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.os.freebsd.devel.cvs.src">
    <title>gmane.os.freebsd.devel.cvs.src</title>
    <link>http://blog.gmane.org/gmane.os.freebsd.devel.cvs.src</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165514"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165513"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165512"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165511"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165508"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165507"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165506"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165505"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165503"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165502"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165501"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165500"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165499"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165498"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165497"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165496"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165492"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165489"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165488"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165487"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165514">
    <title>svn commit: r250978 - in stable/9/sys: fs/nullfs kern sys</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165514</link>
    <description>&lt;pre&gt;Author: kib
Date: Sat May 25 11:05:00 2013
New Revision: 250978
URL: http://svnweb.freebsd.org/changeset/base/250978

Log:
  MFC r250505:
  - Fix nullfs vnode reference leak in nullfs_reclaim_lowervp().  The
    null_hashget() obtains the reference on the nullfs vnode, which must
    be dropped.
  
  - Fix a wart which existed from the introduction of the nullfs
    caching, do not unlock lower vnode in the nullfs_reclaim_lowervp().
    It should be innocent, but now it is also formally safe.  Inform the
    nullfs_reclaim() about this using the NULLV_NOUNLOCK flag set on
    nullfs inode.
  
  - Add a callback to the upper filesystems for the lower vnode
    unlinking. When inactivating a nullfs vnode, check if the lower
    vnode was unlinked, indicated by nullfs flag NULLV_DROP or VV_NOSYNC
    on the lower vnode, and reclaim upper vnode if so.  This allows
    nullfs to purge cached vnodes for the unlinked lower vnode, avoiding
    excessive caching.
  
  MFC r250852:
  Do not leak the NULLV_NOUNLOCK flag from the nullfs_unlink_lowervp(),
  for the case when the nullfs vnode is not reclaimed.  Otherwise, later
  reclamation would not unlock the lower vnode.

Modified:
  stable/9/sys/fs/nullfs/null.h
  stable/9/sys/fs/nullfs/null_subr.c
  stable/9/sys/fs/nullfs/null_vfsops.c
  stable/9/sys/fs/nullfs/null_vnops.c
  stable/9/sys/kern/vfs_subr.c
  stable/9/sys/kern/vfs_syscalls.c
  stable/9/sys/sys/mount.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/fs/nullfs/null.h
==============================================================================
--- stable/9/sys/fs/nullfs/null.hSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/fs/nullfs/null.hSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -53,8 +53,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct null_node {
 LIST_ENTRY(null_node)null_hash;/* Hash list */
 struct vnode        *null_lowervp;/* VREFed once */
 struct vnode*null_vnode;/* Back pointer */
+u_intnull_flags;
 };
 
+#defineNULLV_NOUNLOCK0x0001
+#defineNULLV_DROP0x0002
+
 #defineMOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)-&amp;gt;mnt_data))
 #defineVTONULL(vp) ((struct null_node *)(vp)-&amp;gt;v_data)
 #defineNULLTOV(xp) ((xp)-&amp;gt;null_vnode)

Modified: stable/9/sys/fs/nullfs/null_subr.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_subr.cSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/fs/nullfs/null_subr.cSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -251,6 +251,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; null_nodeget(mp, lowervp, vpp)
 
 xp-&amp;gt;null_vnode = vp;
 xp-&amp;gt;null_lowervp = lowervp;
+xp-&amp;gt;null_flags = 0;
 vp-&amp;gt;v_type = lowervp-&amp;gt;v_type;
 vp-&amp;gt;v_data = xp;
 vp-&amp;gt;v_vnlock = lowervp-&amp;gt;v_vnlock;

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.cSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/fs/nullfs/null_vfsops.cSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -65,7 +65,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static vfs_statfs_tnullfs_statfs;
 static vfs_unmount_tnullfs_unmount;
 static vfs_vget_tnullfs_vget;
 static vfs_extattrctl_tnullfs_extattrctl;
-static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp;
 
 /*
  * Mount null layer
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -390,8 +389,49 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nullfs_reclaim_lowervp(struct mount *mp,
 vp = null_hashget(mp, lowervp);
 if (vp == NULL)
 return;
+VTONULL(vp)-&amp;gt;null_flags |= NULLV_NOUNLOCK;
 vgone(vp);
-vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY);
+vput(vp);
+}
+
+static void
+nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp)
+{
+struct vnode *vp;
+struct null_node *xp;
+
+vp = null_hashget(mp, lowervp);
+if (vp == NULL)
+return;
+xp = VTONULL(vp);
+xp-&amp;gt;null_flags |= NULLV_DROP | NULLV_NOUNLOCK;
+vhold(vp);
+vunref(vp);
+
+if (vp-&amp;gt;v_usecount == 0) {
+/*
+ * If vunref() dropped the last use reference on the
+ * nullfs vnode, it must be reclaimed, and its lock
+ * was split from the lower vnode lock.  Need to do
+ * extra unlock before allowing the final vdrop() to
+ * free the vnode.
+ */
+KASSERT((vp-&amp;gt;v_iflag &amp;amp; VI_DOOMED) != 0,
+    ("not reclaimed nullfs vnode %p", vp));
+VOP_UNLOCK(vp, 0);
+} else {
+/*
+ * Otherwise, the nullfs vnode still shares the lock
+ * with the lower vnode, and must not be unlocked.
+ * Also clear the NULLV_NOUNLOCK, the flag is not
+ * relevant for future reclamations.
+ */
+ASSERT_VOP_ELOCKED(vp, "unlink_lowervp");
+KASSERT((vp-&amp;gt;v_iflag &amp;amp; VI_DOOMED) == 0,
+    ("reclaimed nullfs vnode %p", vp));
+xp-&amp;gt;null_flags &amp;amp;= ~NULLV_NOUNLOCK;
+}
+vdrop(vp);
 }
 
 static struct vfsops null_vfsops = {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -407,6 +447,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct vfsops null_vfsops = {
 .vfs_unmount =nullfs_unmount,
 .vfs_vget =nullfs_vget,
 .vfs_reclaim_lowervp =nullfs_reclaim_lowervp,
+.vfs_unlink_lowervp =nullfs_unlink_lowervp,
 };
 
 VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK | VFCF_JAIL);

Modified: stable/9/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vnops.cSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/fs/nullfs/null_vnops.cSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -692,18 +692,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; null_unlock(struct vop_unlock_args *ap)
 static int
 null_inactive(struct vop_inactive_args *ap __unused)
 {
-struct vnode *vp;
+struct vnode *vp, *lvp;
+struct null_node *xp;
 struct mount *mp;
 struct null_mount *xmp;
 
 vp = ap-&amp;gt;a_vp;
+xp = VTONULL(vp);
+lvp = NULLVPTOLOWERVP(vp);
 mp = vp-&amp;gt;v_mount;
 xmp = MOUNTTONULLMOUNT(mp);
-if ((xmp-&amp;gt;nullm_flags &amp;amp; NULLM_CACHE) == 0) {
+if ((xmp-&amp;gt;nullm_flags &amp;amp; NULLM_CACHE) == 0 ||
+    (xp-&amp;gt;null_flags &amp;amp; NULLV_DROP) != 0 ||
+    (lvp-&amp;gt;v_vflag &amp;amp; VV_NOSYNC) != 0) {
 /*
  * If this is the last reference and caching of the
- * nullfs vnodes is not enabled, then free up the
- * vnode so as not to tie up the lower vnodes.
+ * nullfs vnodes is not enabled, or the lower vnode is
+ * deleted, then free up the vnode so as not to tie up
+ * the lower vnodes.
  */
 vp-&amp;gt;v_object = NULL;
 vrecycle(vp, curthread);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -748,7 +754,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; null_reclaim(struct vop_reclaim_args *ap
  */
 if (vp-&amp;gt;v_writecount &amp;gt; 0)
 VOP_ADD_WRITECOUNT(lowervp, -1);
-vput(lowervp);
+if ((xp-&amp;gt;null_flags &amp;amp; NULLV_NOUNLOCK) != 0)
+vunref(lowervp);
+else
+vput(lowervp);
 free(xp, M_NULLFSNODE);
 
 return (0);

Modified: stable/9/sys/kern/vfs_subr.c
==============================================================================
--- stable/9/sys/kern/vfs_subr.cSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/kern/vfs_subr.cSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2756,19 +2756,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; vgone(struct vnode *vp)
 }
 
 static void
-vgonel_reclaim_lowervp_vfs(struct mount *mp __unused,
+notify_lowervp_vfs_dummy(struct mount *mp __unused,
     struct vnode *lowervp __unused)
 {
 }
 
 /*
- * Notify upper mounts about reclaimed vnode.
+ * Notify upper mounts about reclaimed or unlinked vnode.
  */
-static void
-vgonel_reclaim_lowervp(struct vnode *vp)
+void
+vfs_notify_upper(struct vnode *vp, int event)
 {
 static struct vfsops vgonel_vfsops = {
-.vfs_reclaim_lowervp = vgonel_reclaim_lowervp_vfs
+.vfs_reclaim_lowervp = notify_lowervp_vfs_dummy,
+.vfs_unlink_lowervp = notify_lowervp_vfs_dummy,
 };
 struct mount *mp, *ump, *mmp;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2792,7 +2793,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; vgonel_reclaim_lowervp(struct vnode *vp)
 }
 TAILQ_INSERT_AFTER(&amp;amp;mp-&amp;gt;mnt_uppers, ump, mmp, mnt_upper_link);
 MNT_IUNLOCK(mp);
-VFS_RECLAIM_LOWERVP(ump, vp);
+switch (event) {
+case VFS_NOTIFY_UPPER_RECLAIM:
+VFS_RECLAIM_LOWERVP(ump, vp);
+break;
+case VFS_NOTIFY_UPPER_UNLINK:
+VFS_UNLINK_LOWERVP(ump, vp);
+break;
+default:
+KASSERT(0, ("invalid event %d", event));
+break;
+}
 MNT_ILOCK(mp);
 ump = TAILQ_NEXT(mmp, mnt_upper_link);
 TAILQ_REMOVE(&amp;amp;mp-&amp;gt;mnt_uppers, mmp, mnt_upper_link);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2839,7 +2850,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; vgonel(struct vnode *vp)
 active = vp-&amp;gt;v_usecount;
 oweinact = (vp-&amp;gt;v_iflag &amp;amp; VI_OWEINACT);
 VI_UNLOCK(vp);
-vgonel_reclaim_lowervp(vp);
+vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM);
 
 /*
  * Clean out any buffers associated with the vnode.

Modified: stable/9/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/9/sys/kern/vfs_syscalls.cSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/kern/vfs_syscalls.cSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1949,6 +1949,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; restart:
 if (error)
 goto out;
 #endif
+vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK);
 error = VOP_REMOVE(nd.ni_dvp, vp, &amp;amp;nd.ni_cnd);
 #ifdef MAC
 out:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3947,6 +3948,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; restart:
 return (error);
 goto restart;
 }
+vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK);
 error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &amp;amp;nd.ni_cnd);
 vn_finished_write(mp);
 out:

Modified: stable/9/sys/sys/mount.h
==============================================================================
--- stable/9/sys/sys/mount.hSat May 25 10:35:05 2013(r250977)
+++ stable/9/sys/sys/mount.hSat May 25 11:05:00 2013(r250978)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -630,7 +630,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedefint vfs_mount_t(struct mount *mp
 typedef int vfs_sysctl_t(struct mount *mp, fsctlop_t op,
     struct sysctl_req *req);
 typedef void vfs_susp_clean_t(struct mount *mp);
-typedef void vfs_reclaim_lowervp_t(struct mount *mp, struct vnode *lowervp);
+typedef void vfs_notify_lowervp_t(struct mount *mp, struct vnode *lowervp);
 
 struct vfsops {
 vfs_mount_t*vfs_mount;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -648,7 +648,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct vfsops {
 vfs_extattrctl_t*vfs_extattrctl;
 vfs_sysctl_t*vfs_sysctl;
 vfs_susp_clean_t*vfs_susp_clean;
-vfs_reclaim_lowervp_t*vfs_reclaim_lowervp;
+vfs_notify_lowervp_t*vfs_reclaim_lowervp;
+vfs_notify_lowervp_t*vfs_unlink_lowervp;
 };
 
 vfs_statfs_t__vfs_statfs;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -713,6 +714,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; vfs_statfs_t__vfs_statfs;
 mtx_assert(&amp;amp;Giant, MA_OWNED);\
 } while (0)
 
+#defineVFS_UNLINK_LOWERVP(MP, VP) do {\
+if (*(MP)-&amp;gt;mnt_op-&amp;gt;vfs_unlink_lowervp != NULL) {\
+(*(MP)-&amp;gt;mnt_op-&amp;gt;vfs_unlink_lowervp)((MP), (VP));\
+}\
+} while (0)
+
 #define VFS_KNOTE_LOCKED(vp, hint) do\
 {\
 if (((vp)-&amp;gt;v_vflag &amp;amp; VV_NOKNOTE) == 0)\
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -725,6 +732,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; vfs_statfs_t__vfs_statfs;
 VN_KNOTE((vp), (hint), 0);\
 } while (0)
 
+#defineVFS_NOTIFY_UPPER_RECLAIM1
+#defineVFS_NOTIFY_UPPER_UNLINK2
+
 #include &amp;lt;sys/module.h&amp;gt;
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -803,6 +813,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; intvfs_modevent(module_t, int, void *);
 voidvfs_mount_error(struct mount *, const char *, ...);
 voidvfs_mountroot(void);/* mount our root filesystem */
 voidvfs_mountedfrom(struct mount *, const char *from);
+voidvfs_notify_upper(struct vnode *, int);
 voidvfs_oexport_conv(const struct oexport_args *oexp,
     struct export_args *exp);
 voidvfs_ref(struct mount *);
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-25T11:05:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165513">
    <title>svn commit: r250976 - stable/9/usr.sbin/ctladm</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165513</link>
    <description>&lt;pre&gt;Author: jh
Date: Sat May 25 09:47:33 2013
New Revision: 250976
URL: http://svnweb.freebsd.org/changeset/base/250976

Log:
  MFC r250443: Check the return value of sbuf_finish().

Modified:
  stable/9/usr.sbin/ctladm/ctladm.c
Directory Properties:
  stable/9/usr.sbin/ctladm/   (props changed)

Modified: stable/9/usr.sbin/ctladm/ctladm.c
==============================================================================
--- stable/9/usr.sbin/ctladm/ctladm.cSat May 25 07:17:16 2013(r250975)
+++ stable/9/usr.sbin/ctladm/ctladm.cSat May 25 09:47:33 2013(r250976)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -545,7 +545,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; retry:
 }
 if (xml != 0) {
 sbuf_printf(sb, "&amp;lt;/ctlfelist&amp;gt;\n");
-sbuf_finish(sb);
+if (sbuf_finish(sb) != 0)
+err(1, "%s: sbuf_finish", __func__);
 printf("%s", sbuf_data(sb));
 sbuf_delete(sb);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3492,7 +3493,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; cctl_end_element(void *user_data, const 
 errx(1, "%s: no valid sbuf at level %d (name %s)", __func__,
      devlist-&amp;gt;level, name);
 
-sbuf_finish(devlist-&amp;gt;cur_sb[devlist-&amp;gt;level]);
+if (sbuf_finish(devlist-&amp;gt;cur_sb[devlist-&amp;gt;level]) != 0)
+err(1, "%s: sbuf_finish", __func__);
 str = strdup(sbuf_data(devlist-&amp;gt;cur_sb[devlist-&amp;gt;level]));
 if (str == NULL)
 err(1, "%s can't allocate %zd bytes for string", __func__,
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Jaakko Heinonen</dc:creator>
    <dc:date>2013-05-25T09:47:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165512">
    <title>svn commit: r250975 - head/usr.bin/patch</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165512</link>
    <description>&lt;pre&gt;Author: gjb (doc,ports committer)
Date: Sat May 25 07:17:16 2013
New Revision: 250975
URL: http://svnweb.freebsd.org/changeset/base/250975

Log:
  Revert r250972 to fix build.

Modified:
  head/usr.bin/patch/patch.c
  head/usr.bin/patch/util.c

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.cSat May 25 06:28:30 2013(r250974)
+++ head/usr.bin/patch/patch.cSat May 25 07:17:16 2013(r250975)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -303,7 +303,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char *argv[])
     ++fuzz &amp;lt;= mymaxfuzz);
 
 if (skip_rest_of_patch) {/* just got decided */
-if (ferror(ofp) | fclose(ofp)) {
+if (ferror(ofp) || fclose(ofp)) {
 say("Error writing %s\n",
     TMPOUTNAME);
 error = 1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -385,7 +385,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char *argv[])
 }
 }
 }
-if (ferror(rejfp) | fclose(rejfp)) {
+if (ferror(rejfp) || fclose(rejfp)) {
 say("Error writing %s\n", rejname);
 error = 1;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -977,7 +977,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; spew_output(void)
 #endif
 if (input_lines)
 copy_till(input_lines, true);/* dump remainder of file */
-rv = ferror(ofp) == 0 &amp;amp; fclose(ofp) == 0;
+rv = ferror(ofp) == 0 &amp;amp;&amp;amp; fclose(ofp) == 0;
 ofp = NULL;
 return rv;
 }

Modified: head/usr.bin/patch/util.c
==============================================================================
--- head/usr.bin/patch/util.cSat May 25 06:28:30 2013(r250974)
+++ head/usr.bin/patch/util.cSat May 25 07:17:16 2013(r250975)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -412,7 +412,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; checked_in(char *file)
 void
 version(void)
 {
-fprintf(stderr, "patch 2.0-12u9 FreeBSD\n");
+fprintf(stderr, "patch 2.0-12u8 FreeBSD\n");
 my_exit(EXIT_SUCCESS);
 }
 
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Glen Barber</dc:creator>
    <dc:date>2013-05-25T07:17:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165511">
    <title>svn commit: r250974 - head/sys/net80211</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165511</link>
    <description>&lt;pre&gt;Author: adrian
Date: Sat May 25 06:28:30 2013
New Revision: 250974
URL: http://svnweb.freebsd.org/changeset/base/250974

Log:
  Fix net80211 fragment creation.
  
  When creating fragment frames, the header length should honour the
  DATAPAD flag.
  
  This fixes the fragments that are queued to the ath(4) driver but it
  doesn't yet fix fragment transmission.  That requires further changes
  to the ath(4) transmit path.  Well, strictly speaking, it requires
  further changes to _all_ wifi driver transmit paths, but this is at least
  a start.
  
  Tested:
  
  * AR5416, STA mode, w/ fragthreshold set to 256.

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.cFri May 24 18:59:44 2013(r250973)
+++ head/sys/net80211/ieee80211_output.cSat May 25 06:28:30 2013(r250974)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1495,18 +1495,28 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int
 ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0,
 u_int hdrsize, u_int ciphdrsize, u_int mtu)
 {
+struct ieee80211com *ic = vap-&amp;gt;iv_ic;
 struct ieee80211_frame *wh, *whf;
 struct mbuf *m, *prev, *next;
 u_int totalhdrsize, fragno, fragsize, off, remainder, payload;
+u_int hdrspace;
 
 KASSERT(m0-&amp;gt;m_nextpkt == NULL, ("mbuf already chained?"));
 KASSERT(m0-&amp;gt;m_pkthdr.len &amp;gt; mtu,
 ("pktlen %u mtu %u", m0-&amp;gt;m_pkthdr.len, mtu));
 
+/*
+ * Honor driver DATAPAD requirement.
+ */
+if (ic-&amp;gt;ic_flags &amp;amp; IEEE80211_F_DATAPAD)
+hdrspace = roundup(hdrsize, sizeof(uint32_t));
+else
+hdrspace = hdrsize;
+
 wh = mtod(m0, struct ieee80211_frame *);
 /* NB: mark the first frag; it will be propagated below */
 wh-&amp;gt;i_fc[1] |= IEEE80211_FC1_MORE_FRAG;
-totalhdrsize = hdrsize + ciphdrsize;
+totalhdrsize = hdrspace + ciphdrsize;
 fragno = 1;
 off = mtu - ciphdrsize;
 remainder = m0-&amp;gt;m_pkthdr.len - off;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1553,9 +1563,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ieee80211_fragment(struct ieee80211vap *
 
 payload = fragsize - totalhdrsize;
 /* NB: destination is known to be contiguous */
-m_copydata(m0, off, payload, mtod(m, uint8_t *) + hdrsize);
-m-&amp;gt;m_len = hdrsize + payload;
-m-&amp;gt;m_pkthdr.len = hdrsize + payload;
+
+m_copydata(m0, off, payload, mtod(m, uint8_t *) + hdrspace);
+m-&amp;gt;m_len = hdrspace + payload;
+m-&amp;gt;m_pkthdr.len = hdrspace + payload;
 m-&amp;gt;m_flags |= M_FRAG;
 
 /* chain up the fragment */
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Adrian Chadd</dc:creator>
    <dc:date>2013-05-25T06:28:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165508">
    <title>svn commit: r250973 - in stable/9: lib/libc/sys sys/kern</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165508</link>
    <description>&lt;pre&gt;Author: jilles
Date: Fri May 24 18:59:44 2013
New Revision: 250973
URL: http://svnweb.freebsd.org/changeset/base/250973

Log:
  MFC r248593: Allow O_CLOEXEC in posix_openpt() flags.
  
  PR:kern/162374

Modified:
  stable/9/lib/libc/sys/posix_openpt.2
  stable/9/sys/kern/tty_pts.c
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/lib/libc/sys/posix_openpt.2
==============================================================================
--- stable/9/lib/libc/sys/posix_openpt.2Fri May 24 18:54:52 2013(r250972)
+++ stable/9/lib/libc/sys/posix_openpt.2Fri May 24 18:59:44 2013(r250973)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -37,7 +37,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2008
+.Dd March 21, 2013
 .Dt POSIX_OPENPT 2
 .Os
 .Sh NAME
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -71,7 +71,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; Values for
 are constructed by a bitwise-inclusive OR of flags from the following
 list, defined in
 .In fcntl.h :
-.Bl -tag -width ".Dv O_NOCTTY"
+.Bl -tag -width ".Dv O_CLOEXEC"
 .It Dv O_RDWR
 Open for reading and writing.
 .It Dv O_NOCTTY
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -79,6 +79,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; If set
 .Fn posix_openpt
 shall not cause the terminal device to become the controlling terminal
 for the process.
+.It Dv O_CLOEXEC
+Set the close-on-exec flag for the new file descriptor.
 .El
 .Pp
 The
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -116,6 +118,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; The
 .Fn posix_openpt
 function conforms to
 .St -p1003.1-2001 .
+The ability to use
+.Dv O_CLOEXEC
+is an extension to the standard.
 .Sh HISTORY
 The
 .Fn posix_openpt

Modified: stable/9/sys/kern/tty_pts.c
==============================================================================
--- stable/9/sys/kern/tty_pts.cFri May 24 18:54:52 2013(r250972)
+++ stable/9/sys/kern/tty_pts.cFri May 24 18:59:44 2013(r250973)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -825,10 +825,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sys_posix_openpt(struct thread *td, stru
  * POSIX states it's unspecified when other flags are passed. We
  * don't allow this.
  */
-if (uap-&amp;gt;flags &amp;amp; ~(O_RDWR|O_NOCTTY))
+if (uap-&amp;gt;flags &amp;amp; ~(O_RDWR|O_NOCTTY|O_CLOEXEC))
 return (EINVAL);
 
-error = falloc(td, &amp;amp;fp, &amp;amp;fd, 0);
+error = falloc(td, &amp;amp;fp, &amp;amp;fd, uap-&amp;gt;flags);
 if (error)
 return (error);
 
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Jilles Tjoelker</dc:creator>
    <dc:date>2013-05-24T18:59:45</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165507">
    <title>svn commit: r250972 - head/usr.bin/patch</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165507</link>
    <description>&lt;pre&gt;Author: se
Date: Fri May 24 18:54:52 2013
New Revision: 250972
URL: http://svnweb.freebsd.org/changeset/base/250972

Log:
  The error handling for writes to the target file could lead to the final
  fclose() being skipped. Fix this by using boolean "&amp;amp;" and "|" instead of
  short-cut operators "&amp;amp;&amp;amp;" and "||".
  While here, increment the last part of the version string. The reason is
  the fixed output file selection logic in pch.c, which was committed as
  r250943, yesterday.
  
  Reviewed by:pfg

Modified:
  head/usr.bin/patch/patch.c
  head/usr.bin/patch/util.c

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.cFri May 24 18:28:27 2013(r250971)
+++ head/usr.bin/patch/patch.cFri May 24 18:54:52 2013(r250972)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -303,7 +303,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char *argv[])
     ++fuzz &amp;lt;= mymaxfuzz);
 
 if (skip_rest_of_patch) {/* just got decided */
-if (ferror(ofp) || fclose(ofp)) {
+if (ferror(ofp) | fclose(ofp)) {
 say("Error writing %s\n",
     TMPOUTNAME);
 error = 1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -385,7 +385,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char *argv[])
 }
 }
 }
-if (ferror(rejfp) || fclose(rejfp)) {
+if (ferror(rejfp) | fclose(rejfp)) {
 say("Error writing %s\n", rejname);
 error = 1;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -977,7 +977,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; spew_output(void)
 #endif
 if (input_lines)
 copy_till(input_lines, true);/* dump remainder of file */
-rv = ferror(ofp) == 0 &amp;amp;&amp;amp; fclose(ofp) == 0;
+rv = ferror(ofp) == 0 &amp;amp; fclose(ofp) == 0;
 ofp = NULL;
 return rv;
 }

Modified: head/usr.bin/patch/util.c
==============================================================================
--- head/usr.bin/patch/util.cFri May 24 18:28:27 2013(r250971)
+++ head/usr.bin/patch/util.cFri May 24 18:54:52 2013(r250972)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -412,7 +412,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; checked_in(char *file)
 void
 version(void)
 {
-fprintf(stderr, "patch 2.0-12u8 FreeBSD\n");
+fprintf(stderr, "patch 2.0-12u9 FreeBSD\n");
 my_exit(EXIT_SUCCESS);
 }
 
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Stefan Esser</dc:creator>
    <dc:date>2013-05-24T18:54:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165506">
    <title>svn commit: r250971 - stable/8/usr.sbin/pciconf</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165506</link>
    <description>&lt;pre&gt;Author: kib
Date: Fri May 24 18:28:27 2013
New Revision: 250971
URL: http://svnweb.freebsd.org/changeset/base/250971

Log:
  MFC r250741:
  Decode new HT 3.00 and 3.10 capabilities.

Modified:
  stable/8/usr.sbin/pciconf/cap.c
Directory Properties:
  stable/8/usr.sbin/pciconf/   (props changed)

Modified: stable/8/usr.sbin/pciconf/cap.c
==============================================================================
--- stable/8/usr.sbin/pciconf/cap.cFri May 24 18:26:12 2013(r250970)
+++ stable/8/usr.sbin/pciconf/cap.cFri May 24 18:28:27 2013(r250971)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -276,6 +276,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; cap_ht(int fd, struct pci_conf *p, uint8
 case PCIM_HTCAP_X86_ENCODING:
 printf("X86 encoding");
 break;
+case PCIM_HTCAP_GEN3:
+printf("Gen3");
+break;
+case PCIM_HTCAP_FLE:
+printf("function-level extension");
+break;
+case PCIM_HTCAP_PM:
+printf("power management");
+break;
+case PCIM_HTCAP_HIGH_NODE_COUNT:
+printf("high node count");
+break;
 default:
 printf("unknown %02x", command);
 break;
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-24T18:28:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165505">
    <title>svn commit: r250970 - stable/8/sys/dev/pci</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165505</link>
    <description>&lt;pre&gt;Author: kib
Date: Fri May 24 18:26:12 2013
New Revision: 250970
URL: http://svnweb.freebsd.org/changeset/base/250970

Log:
  MFC r250740:
  Add new capability types encodings from HyperTransport I/O Link
  Specification revisions 3.00 and 3.10.

Modified:
  stable/8/sys/dev/pci/pcireg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/pci/   (props changed)

Modified: stable/8/sys/dev/pci/pcireg.h
==============================================================================
--- stable/8/sys/dev/pci/pcireg.hFri May 24 15:53:13 2013(r250969)
+++ stable/8/sys/dev/pci/pcireg.hFri May 24 18:26:12 2013(r250970)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -609,6 +609,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #definePCIM_HTCAP_VCSET0xb800/* 10111 */
 #definePCIM_HTCAP_RETRY_MODE0xc000/* 11000 */
 #definePCIM_HTCAP_X86_ENCODING0xc800/* 11001 */
+#definePCIM_HTCAP_GEN30xd000/* 11010 */
+#definePCIM_HTCAP_FLE0xd800/* 11011 */
+#definePCIM_HTCAP_PM0xe000/* 11100 */
+#definePCIM_HTCAP_HIGH_NODE_COUNT0xe800/* 11101 */
 
 /* HT MSI Mapping Capability definitions. */
 #definePCIM_HTCMD_MSI_ENABLE0x0001
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-24T18:26:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165503">
    <title>svn commit: r250969 - head</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165503</link>
    <description>&lt;pre&gt;Author: marcel
Date: Fri May 24 15:53:13 2013
New Revision: 250969
URL: http://svnweb.freebsd.org/changeset/base/250969

Log:
  Fix building on slightly older -current and stable systems after
  the switch to bmake. The rescue bits are built via crunchgen,
  which didn't respect the MAKE environment variable until r237574
  (i.e. ~11 months ago). This resulted in a failure due to bmake's
  internal -J flag being passed around and not being understood by
  the standard (i.e. host's) make.
  Note that the failure is conditional upon having the jobServer
  feature enabled within bmake.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1Fri May 24 14:57:38 2013(r250968)
+++ head/Makefile.inc1Fri May 24 15:53:13 2013(r250969)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1215,6 +1215,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; _yacc=lib/liby \
 usr.bin/yacc
 .endif
 
+.if ${BOOTSTRAPPING} &amp;lt; 1000014
+_crunch=usr.sbin/crunch
+.endif
+
 .if ${BOOTSTRAPPING} &amp;lt; 1000026
 _nmtree=lib/libnetbsd \
 usr.sbin/nmtree
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1293,6 +1297,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bootstrap-tools:
     usr.bin/xinstall \
     ${_gensnmptree} \
     usr.sbin/config \
+    ${_crunch} \
     ${_nmtree}
 ${_+_}&amp;lt; at &amp;gt;${ECHODIR} "===&amp;gt; ${_tool} (obj,depend,all,install)"; \
 cd ${.CURDIR}/${_tool}; \
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Marcel Moolenaar</dc:creator>
    <dc:date>2013-05-24T15:53:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165502">
    <title>svn commit: r250968 - head/share/man/man8</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165502</link>
    <description>&lt;pre&gt;Author: jamie
Date: Fri May 24 14:57:38 2013
New Revision: 250968
URL: http://svnweb.freebsd.org/changeset/base/250968

Log:
  Mention the "nojailvnet" keyword.
  
  MFC after:3 days

Modified:
  head/share/man/man8/rc.8

Modified: head/share/man/man8/rc.8
==============================================================================
--- head/share/man/man8/rc.8Fri May 24 11:27:06 2013(r250967)
+++ head/share/man/man8/rc.8Fri May 24 14:57:38 2013(r250968)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -124,7 +124,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; Load the configuration files.
 Determine if booting in a jail,
 and add
 .Dq Li nojail
-to the list of KEYWORDS to skip in
+(no jails allowed) or
+.Dq Li nojailvnet
+(only allow vnet-enabled jails) to the list of KEYWORDS to skip in
 .Xr rcorder 8 .
 .It
 Invoke
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Jamie Gritton</dc:creator>
    <dc:date>2013-05-24T14:57:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165501">
    <title>svn commit: r250967 - head/sys/cam/scsi</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165501</link>
    <description>&lt;pre&gt;Author: smh
Date: Fri May 24 11:27:06 2013
New Revision: 250967
URL: http://svnweb.freebsd.org/changeset/base/250967

Log:
  Enforce validation on the selected delete method via sysctl.
  
  This prevents users from selecting a delete method which may cause
  corruption e.g. MPS WS16 on pre P14 firmware.
  
  Reviewed by:pjd (mentor)
  Approved by:pjd (mentor)
  MFC after:2 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.cFri May 24 09:48:42 2013(r250966)
+++ head/sys/cam/scsi/scsi_da.cFri May 24 11:27:06 2013(r250967)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1780,7 +1780,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; dadeletemethodsysctl(SYSCTL_HANDLER_ARGS
 if (error != 0 || req-&amp;gt;newptr == NULL)
 return (error);
 for (i = 0; i &amp;lt;= DA_DELETE_MAX; i++) {
-if (strcmp(buf, da_delete_method_names[i]) != 0)
+if (!(softc-&amp;gt;delete_available &amp;amp; (1 &amp;lt;&amp;lt; i)) ||
+    strcmp(buf, da_delete_method_names[i]) != 0)
 continue;
 dadeletemethodset(softc, i);
 return (0);
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Steven Hartland</dc:creator>
    <dc:date>2013-05-24T11:27:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165500">
    <title>svn commit: r250966 - head/sys/dev/md</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165500</link>
    <description>&lt;pre&gt;Author: kib
Date: Fri May 24 09:48:42 2013
New Revision: 250966
URL: http://svnweb.freebsd.org/changeset/base/250966

Log:
  Fix the data corruption on the swap-backed md.
  
  Assign the rv variable a success code if the pager was not asked for
  the page.  Using an error code from the previous processed page caused
  zeroing of the valid page, when e.g. the previous page was not
  available in the pager.
  
  Reported by:lstewart
  Sponsored by:The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.cFri May 24 09:33:55 2013(r250965)
+++ head/sys/dev/md/md.cFri May 24 09:48:42 2013(r250966)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -829,7 +829,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mdstart_swap(struct md_s *sc, struct bio
 m = vm_page_grab(sc-&amp;gt;object, i, VM_ALLOC_NORMAL |
     VM_ALLOC_RETRY);
 if (bp-&amp;gt;bio_cmd == BIO_READ) {
-if (m-&amp;gt;valid != VM_PAGE_BITS_ALL)
+if (m-&amp;gt;valid == VM_PAGE_BITS_ALL)
+rv = VM_PAGER_OK;
+else
 rv = vm_pager_get_pages(sc-&amp;gt;object, &amp;amp;m, 1, 0);
 if (rv == VM_PAGER_ERROR) {
 vm_page_wakeup(m);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -854,6 +856,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mdstart_swap(struct md_s *sc, struct bio
 } else if (bp-&amp;gt;bio_cmd == BIO_WRITE) {
 if (len != PAGE_SIZE &amp;amp;&amp;amp; m-&amp;gt;valid != VM_PAGE_BITS_ALL)
 rv = vm_pager_get_pages(sc-&amp;gt;object, &amp;amp;m, 1, 0);
+else
+rv = VM_PAGER_OK;
 if (rv == VM_PAGER_ERROR) {
 vm_page_wakeup(m);
 break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -868,6 +872,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mdstart_swap(struct md_s *sc, struct bio
 } else if (bp-&amp;gt;bio_cmd == BIO_DELETE) {
 if (len != PAGE_SIZE &amp;amp;&amp;amp; m-&amp;gt;valid != VM_PAGE_BITS_ALL)
 rv = vm_pager_get_pages(sc-&amp;gt;object, &amp;amp;m, 1, 0);
+else
+rv = VM_PAGER_OK;
 if (rv == VM_PAGER_ERROR) {
 vm_page_wakeup(m);
 break;
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-24T09:48:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165499">
    <title>svn commit: r250965 - stable/9/usr.sbin/pciconf</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165499</link>
    <description>&lt;pre&gt;Author: kib
Date: Fri May 24 09:33:55 2013
New Revision: 250965
URL: http://svnweb.freebsd.org/changeset/base/250965

Log:
  MFC r250741:
  Decode new HT 3.00 and 3.10 capabilities.

Modified:
  stable/9/usr.sbin/pciconf/cap.c
Directory Properties:
  stable/9/usr.sbin/pciconf/   (props changed)

Modified: stable/9/usr.sbin/pciconf/cap.c
==============================================================================
--- stable/9/usr.sbin/pciconf/cap.cFri May 24 09:30:10 2013(r250964)
+++ stable/9/usr.sbin/pciconf/cap.cFri May 24 09:33:55 2013(r250965)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -276,6 +276,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; cap_ht(int fd, struct pci_conf *p, uint8
 case PCIM_HTCAP_X86_ENCODING:
 printf("X86 encoding");
 break;
+case PCIM_HTCAP_GEN3:
+printf("Gen3");
+break;
+case PCIM_HTCAP_FLE:
+printf("function-level extension");
+break;
+case PCIM_HTCAP_PM:
+printf("power management");
+break;
+case PCIM_HTCAP_HIGH_NODE_COUNT:
+printf("high node count");
+break;
 default:
 printf("unknown %02x", command);
 break;
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-24T09:33:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165498">
    <title>svn commit: r250964 - stable/9/sys/dev/pci</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165498</link>
    <description>&lt;pre&gt;Author: kib
Date: Fri May 24 09:30:10 2013
New Revision: 250964
URL: http://svnweb.freebsd.org/changeset/base/250964

Log:
  MFC r250740:
  Add new capability types encodings from HyperTransport I/O Link
  Specification revisions 3.00 and 3.10.

Modified:
  stable/9/sys/dev/pci/pcireg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/pci/pcireg.h
==============================================================================
--- stable/9/sys/dev/pci/pcireg.hFri May 24 09:22:43 2013(r250963)
+++ stable/9/sys/dev/pci/pcireg.hFri May 24 09:30:10 2013(r250964)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -612,6 +612,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #definePCIM_HTCAP_VCSET0xb800/* 10111 */
 #definePCIM_HTCAP_RETRY_MODE0xc000/* 11000 */
 #definePCIM_HTCAP_X86_ENCODING0xc800/* 11001 */
+#definePCIM_HTCAP_GEN30xd000/* 11010 */
+#definePCIM_HTCAP_FLE0xd800/* 11011 */
+#definePCIM_HTCAP_PM0xe000/* 11100 */
+#definePCIM_HTCAP_HIGH_NODE_COUNT0xe800/* 11101 */
 
 /* HT MSI Mapping Capability definitions. */
 #definePCIM_HTCMD_MSI_ENABLE0x0001
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Konstantin Belousov</dc:creator>
    <dc:date>2013-05-24T09:30:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165497">
    <title>svn commit: r250963 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/aacraid sys/i386/conf sys/ia64/conf sys/modules sys/modules/aacraid sys/modules/aacraid/aacraid_linux</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165497</link>
    <description>&lt;pre&gt;Author: achim
Date: Fri May 24 09:22:43 2013
New Revision: 250963
URL: http://svnweb.freebsd.org/changeset/base/250963

Log:
  Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver.
  
  Approved by:scottl (mentor)

Added:
  head/share/man/man4/aacraid.4   (contents, props changed)
  head/sys/dev/aacraid/
  head/sys/dev/aacraid/aacraid.c   (contents, props changed)
  head/sys/dev/aacraid/aacraid_cam.c   (contents, props changed)
  head/sys/dev/aacraid/aacraid_debug.c   (contents, props changed)
  head/sys/dev/aacraid/aacraid_debug.h   (contents, props changed)
  head/sys/dev/aacraid/aacraid_linux.c   (contents, props changed)
  head/sys/dev/aacraid/aacraid_pci.c   (contents, props changed)
  head/sys/dev/aacraid/aacraid_reg.h   (contents, props changed)
  head/sys/dev/aacraid/aacraid_var.h   (contents, props changed)
  head/sys/modules/aacraid/
  head/sys/modules/aacraid/Makefile   (contents, props changed)
  head/sys/modules/aacraid/Makefile.inc   (contents, props changed)
  head/sys/modules/aacraid/aacraid_linux/
  head/sys/modules/aacraid/aacraid_linux/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/NOTES
  head/sys/ia64/conf/GENERIC
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/MakefileFri May 24 09:21:18 2013(r250962)
+++ head/share/man/man4/MakefileFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4,6 +4,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 .include &amp;lt;bsd.own.mk&amp;gt;
 
 MAN=aac.4 \
+aacraid.4 \
 acpi.4 \
 ${_acpi_asus.4} \
 ${_acpi_asus_wmi.4} \

Added: head/share/man/man4/aacraid.4
==============================================================================
--- /dev/null00:00:00 1970(empty, because file is newly added)
+++ head/share/man/man4/aacraid.4Fri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,139 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+.\" Copyright (c) 2013 Achim Leubner
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.Dd April 09, 2013
+.Dt AACRAID 4
+.Os
+.Sh NAME
+.Nm aacraid
+.Nd Adaptec AACRAID Controller driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device pci
+.Cd device aacraid
+.Pp
+To compile in debugging code:
+.Cd options AACRAID_DEBUG=N
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+aacraid_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the Adaptec by PMC RAID controllers,
+including Series 6/7/8 and upcoming families.
+.Pp
+The RAID containers are handled via the 
+.Nm aacraidp0
+bus.
+The physical buses are represented by the 
+.Nm aacraidp?
+devices (beginning with aacraidp1). These devices enable the
+SCSI pass-thru interface and allows devices connected
+to the card such as CD-ROMs to be available via the CAM
+.Xr scsi 4
+subsystem.
+Note that not all cards allow this interface to be enabled.
+.Pp
+The
+.Pa /dev/aacraid?
+device nodes provide access to the management interface of the controller.
+One node exists per installed card.
+If the kernel is compiled with the
+.Dv COMPAT_LINUX
+option, or the
+.Pa aacraid_linux.ko
+and
+.Pa linux.ko
+modules are loaded, the
+Linux-compatible
+.Xr ioctl 2
+interface for the management device will be enabled and will allow
+Linux-based management applications to control the card.
+.Sh HARDWARE
+Controllers supported by the
+.Nm
+driver include:
+.Pp
+.Bl -bullet -compact
+.It
+Adaptec ASR-6405(T|E)
+.It
+Adaptec ASR-6445
+.It
+Adaptec ASR-6805(T|E|Q|TQ)
+.It
+Adaptec ASR-7085
+.It
+Adaptec ASR-7805(Q)
+.It
+Adaptec ASR-70165
+.It
+Adaptec ASR-71605(E|Q)
+.It
+Adaptec ASR-71685
+.It
+Adaptec ASR-72405
+.It
+Adaptec Series 8 cards
+.El
+.Sh FILES
+.Bl -tag -width /boot/kernel/aacraid.ko -compact
+.It Pa /dev/aacraid?
+aacraid management interface
+.El
+.Sh DIAGNOSTICS
+Compiling with
+.Dv AACRAID_DEBUG
+set to a number between 0 and 3
+will enable increasingly verbose debug messages.
+.Pp
+The adapter can send status and alert messages asynchronously
+to the driver.
+These messages are printed on the system console,
+and are also queued for retrieval by a management application.
+.Sh SEE ALSO
+.Xr kld 4 ,
+.Xr linux 4 ,
+.Xr scsi 4 ,
+.Xr kldload 8
+.Sh AUTHORS
+.An Achim Leubner
+.Aq achim&amp;lt; at &amp;gt;FreeBSD.org
+.An Ed Maste
+.Aq emaste&amp;lt; at &amp;gt;FreeBSD.org
+.An Scott Long
+.Aq scottl&amp;lt; at &amp;gt;FreeBSD.org
+.Sh BUGS
+.Pp
+The controller is not actually paused on suspend/resume.

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERICFri May 24 09:21:18 2013(r250962)
+++ head/sys/amd64/conf/GENERICFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -158,6 +158,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; devicetws# LSI 3ware 9750 SATA+SAS 6
 # RAID controllers
 deviceaac# Adaptec FSA RAID
 deviceaacp# SCSI passthrough for aac (requires CAM)
+deviceaacraid# Adaptec by PMC RAID
 deviceida# Compaq Smart RAID
 devicemfi# LSI MegaRAID SAS
 devicemlx# Mylex DAC960 family

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTESFri May 24 09:21:18 2013(r250962)
+++ head/sys/amd64/conf/NOTESFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -406,6 +406,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; deviceaac
 deviceaacp# SCSI Passthrough interface (optional, CAM required)
 
 #
+# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families
+deviceaacraid# Container interface, CAM required
+
+#
 # Highpoint RocketRAID 27xx.
 devicehpt27xx
 

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/filesFri May 24 09:21:18 2013(r250962)
+++ head/sys/conf/filesFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -573,6 +573,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; dev/aac/aac_debug.coptional aac
 dev/aac/aac_disk.coptional aac
 dev/aac/aac_linux.coptional aac compat_linux
 dev/aac/aac_pci.coptional aac pci
+dev/aacraid/aacraid.coptional aacraid
+dev/aacraid/aacraid_cam.coptional aacraid scbus
+dev/aacraid/aacraid_debug.coptional aacraid
+dev/aacraid/aacraid_linux.coptional aacraid compat_linux
+dev/aacraid/aacraid_pci.coptional aacraid pci
 dev/acpi_support/acpi_wmi.coptional acpi_wmi acpi
 dev/acpi_support/acpi_asus.coptional acpi_asus acpi
 dev/acpi_support/acpi_asus_wmi.coptional acpi_asus_wmi acpi

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/optionsFri May 24 09:21:18 2013(r250962)
+++ head/sys/conf/optionsFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -31,6 +31,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 # opt_&amp;lt;name-of-option-in-lower-case&amp;gt;.h
 
 AAC_DEBUGopt_aac.h
+AACRAID_DEBUGopt_aacraid.h
 AHC_ALLOW_MEMIOopt_aic7xxx.h
 AHC_TMODE_ENABLEopt_aic7xxx.h
 AHC_DUMP_EEPROMopt_aic7xxx.h

Added: head/sys/dev/aacraid/aacraid.c
==============================================================================
--- /dev/null00:00:00 1970(empty, because file is newly added)
+++ head/sys/dev/aacraid/aacraid.cFri May 24 09:22:43 2013(r250963)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,3501 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*-
+ * Copyright (c) 2000 Michael Smith
+ * Copyright (c) 2001 Scott Long
+ * Copyright (c) 2000 BSDi
+ * Copyright (c) 2001-2010 Adaptec, Inc.
+ * Copyright (c) 2010-2012 PMC-Sierra, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include &amp;lt;sys/cdefs.h&amp;gt;
+__FBSDID("$FreeBSD$");
+
+/*
+ * Driver for the Adaptec by PMC Series 6,7,8,... families of RAID controllers
+ */
+#define AAC_DRIVERNAME"aacraid"
+
+#include "opt_aacraid.h"
+
+/* #include &amp;lt;stddef.h&amp;gt; */
+#include &amp;lt;sys/param.h&amp;gt;
+#include &amp;lt;sys/systm.h&amp;gt;
+#include &amp;lt;sys/malloc.h&amp;gt;
+#include &amp;lt;sys/kernel.h&amp;gt;
+#include &amp;lt;sys/kthread.h&amp;gt;
+#include &amp;lt;sys/sysctl.h&amp;gt;
+#include &amp;lt;sys/poll.h&amp;gt;
+#include &amp;lt;sys/ioccom.h&amp;gt;
+
+#include &amp;lt;sys/bus.h&amp;gt;
+#include &amp;lt;sys/conf.h&amp;gt;
+#include &amp;lt;sys/signalvar.h&amp;gt;
+#include &amp;lt;sys/time.h&amp;gt;
+#include &amp;lt;sys/eventhandler.h&amp;gt;
+#include &amp;lt;sys/rman.h&amp;gt;
+
+#include &amp;lt;machine/bus.h&amp;gt;
+#include &amp;lt;sys/bus_dma.h&amp;gt;
+#include &amp;lt;machine/resource.h&amp;gt;
+
+#include &amp;lt;dev/pci/pcireg.h&amp;gt;
+#include &amp;lt;dev/pci/pcivar.h&amp;gt;
+
+#include &amp;lt;dev/aacraid/aacraid_reg.h&amp;gt;
+#include &amp;lt;sys/aac_ioctl.h&amp;gt;
+#include &amp;lt;dev/aacraid/aacraid_debug.h&amp;gt;
+#include &amp;lt;dev/aacraid/aacraid_var.h&amp;gt;
+
+#ifndef FILTER_HANDLED
+#define FILTER_HANDLED0x02
+#endif
+
+static voidaac_add_container(struct aac_softc *sc,
+  struct aac_mntinforesp *mir, int f, 
+  u_int32_t uid);
+static voidaac_get_bus_info(struct aac_softc *sc);
+static voidaac_container_bus(struct aac_softc *sc);
+static voidaac_daemon(void *arg);
+static int aac_convert_sgraw2(struct aac_softc *sc, struct aac_raw_io2 *raw,
+  int pages, int nseg, int nseg_new);
+
+/* Command Processing */
+static voidaac_timeout(struct aac_softc *sc);
+static voidaac_command_thread(struct aac_softc *sc);
+static intaac_sync_fib(struct aac_softc *sc, u_int32_t command,
+     u_int32_t xferstate, struct aac_fib *fib,
+     u_int16_t datasize);
+/* Command Buffer Management */
+static voidaac_map_command_helper(void *arg, bus_dma_segment_t *segs,
+       int nseg, int error);
+static intaac_alloc_commands(struct aac_softc *sc);
+static voidaac_free_commands(struct aac_softc *sc);
+static voidaac_unmap_command(struct aac_command *cm);
+
+/* Hardware Interface */
+static intaac_alloc(struct aac_softc *sc);
+static voidaac_common_map(void *arg, bus_dma_segment_t *segs, int nseg,
+       int error);
+static intaac_check_firmware(struct aac_softc *sc);
+static intaac_init(struct aac_softc *sc);
+static intaac_setup_intr(struct aac_softc *sc);
+
+/* PMC SRC interface */
+static intaac_src_get_fwstatus(struct aac_softc *sc);
+static voidaac_src_qnotify(struct aac_softc *sc, int qbit);
+static intaac_src_get_istatus(struct aac_softc *sc);
+static voidaac_src_clear_istatus(struct aac_softc *sc, int mask);
+static voidaac_src_set_mailbox(struct aac_softc *sc, u_int32_t command,
+    u_int32_t arg0, u_int32_t arg1,
+    u_int32_t arg2, u_int32_t arg3);
+static intaac_src_get_mailbox(struct aac_softc *sc, int mb);
+static voidaac_src_set_interrupts(struct aac_softc *sc, int enable);
+static int aac_src_send_command(struct aac_softc *sc, struct aac_command *cm);
+static int aac_src_get_outb_queue(struct aac_softc *sc);
+static void aac_src_set_outb_queue(struct aac_softc *sc, int index);
+
+struct aac_interface aacraid_src_interface = {
+aac_src_get_fwstatus,
+aac_src_qnotify,
+aac_src_get_istatus,
+aac_src_clear_istatus,
+aac_src_set_mailbox,
+aac_src_get_mailbox,
+aac_src_set_interrupts,
+aac_src_send_command,
+aac_src_get_outb_queue,
+aac_src_set_outb_queue
+};
+
+/* PMC SRCv interface */
+static voidaac_srcv_set_mailbox(struct aac_softc *sc, u_int32_t command,
+    u_int32_t arg0, u_int32_t arg1,
+    u_int32_t arg2, u_int32_t arg3);
+static intaac_srcv_get_mailbox(struct aac_softc *sc, int mb);
+
+struct aac_interface aacraid_srcv_interface = {
+aac_src_get_fwstatus,
+aac_src_qnotify,
+aac_src_get_istatus,
+aac_src_clear_istatus,
+aac_srcv_set_mailbox,
+aac_srcv_get_mailbox,
+aac_src_set_interrupts,
+aac_src_send_command,
+aac_src_get_outb_queue,
+aac_src_set_outb_queue
+};
+
+/* Debugging and Diagnostics */
+static struct aac_code_lookup aac_cpu_variant[] = {
+{"i960JX",CPUI960_JX},
+{"i960CX",CPUI960_CX},
+{"i960HX",CPUI960_HX},
+{"i960RX",CPUI960_RX},
+{"i960 80303",CPUI960_80303},
+{"StrongARM SA110",CPUARM_SA110},
+{"PPC603e",CPUPPC_603e},
+{"XScale 80321",CPU_XSCALE_80321},
+{"MIPS 4KC",CPU_MIPS_4KC},
+{"MIPS 5KC",CPU_MIPS_5KC},
+{"Unknown StrongARM",CPUARM_xxx},
+{"Unknown PowerPC",CPUPPC_xxx},
+{NULL, 0},
+{"Unknown processor",0}
+};
+
+static struct aac_code_lookup aac_battery_platform[] = {
+{"required battery present",PLATFORM_BAT_REQ_PRESENT},
+{"REQUIRED BATTERY NOT PRESENT",PLATFORM_BAT_REQ_NOTPRESENT},
+{"optional battery present",PLATFORM_BAT_OPT_PRESENT},
+{"optional battery not installed",PLATFORM_BAT_OPT_NOTPRESENT},
+{"no battery support",PLATFORM_BAT_NOT_SUPPORTED},
+{NULL, 0},
+{"unknown battery platform",0}
+};
+static voidaac_describe_controller(struct aac_softc *sc);
+static char*aac_describe_code(struct aac_code_lookup *table,
+   u_int32_t code);
+
+/* Management Interface */
+static d_open_taac_open;
+static d_ioctl_taac_ioctl;
+static d_poll_taac_poll;
+#if __FreeBSD_version &amp;gt;= 702000
+static voidaac_cdevpriv_dtor(void *arg);
+#else
+static d_close_taac_close;
+#endif
+static intaac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib);
+static intaac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg);
+static voidaac_handle_aif(struct aac_softc *sc, struct aac_fib *fib);
+static voidaac_request_aif(struct aac_softc *sc);
+static intaac_rev_check(struct aac_softc *sc, caddr_t udata);
+static intaac_open_aif(struct aac_softc *sc, caddr_t arg);
+static intaac_close_aif(struct aac_softc *sc, caddr_t arg);
+static intaac_getnext_aif(struct aac_softc *sc, caddr_t arg);
+static intaac_return_aif(struct aac_softc *sc,
+       struct aac_fib_context *ctx, caddr_t uptr);
+static intaac_query_disk(struct aac_softc *sc, caddr_t uptr);
+static intaac_get_pci_info(struct aac_softc *sc, caddr_t uptr);
+static intaac_supported_features(struct aac_softc *sc, caddr_t uptr);
+static voidaac_ioctl_event(struct aac_softc *sc,
+struct aac_event *event, void *arg);
+static intaac_reset_adapter(struct aac_softc *sc);
+static intaac_get_container_info(struct aac_softc *sc, 
+       struct aac_fib *fib, int cid,
+       struct aac_mntinforesp *mir, 
+       u_int32_t *uid);
+static u_int32_t
+aac_check_adapter_health(struct aac_softc *sc, u_int8_t *bled);
+
+static struct cdevsw aacraid_cdevsw = {
+.d_version =D_VERSION,
+.d_flags =D_NEEDGIANT,
+.d_open =aac_open,
+#if __FreeBSD_version &amp;lt; 702000
+.d_close =aac_close,
+#endif
+.d_ioctl =aac_ioctl,
+.d_poll =aac_poll,
+.d_name ="aacraid",
+};
+
+MALLOC_DEFINE(M_AACRAIDBUF, "aacraid_buf", "Buffers for the AACRAID driver");
+
+/* sysctl node */
+SYSCTL_NODE(_hw, OID_AUTO, aacraid, CTLFLAG_RD, 0, "AACRAID driver parameters");
+
+/*
+ * Device Interface
+ */
+
+/*
+ * Initialize the controller and softc
+ */
+int
+aacraid_attach(struct aac_softc *sc)
+{
+int error, unit;
+struct aac_fib *fib;
+struct aac_mntinforesp mir;
+int count = 0, i = 0;
+u_int32_t uid;
+
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+sc-&amp;gt;hint_flags = device_get_flags(sc-&amp;gt;aac_dev);
+/*
+ * Initialize per-controller queues.
+ */
+aac_initq_free(sc);
+aac_initq_ready(sc);
+aac_initq_busy(sc);
+
+/* mark controller as suspended until we get ourselves organised */
+sc-&amp;gt;aac_state |= AAC_STATE_SUSPEND;
+
+/*
+ * Check that the firmware on the card is supported.
+ */
+if ((error = aac_check_firmware(sc)) != 0)
+return(error);
+
+/*
+ * Initialize locks
+ */
+mtx_init(&amp;amp;sc-&amp;gt;aac_io_lock, "AACRAID I/O lock", NULL, MTX_DEF);
+TAILQ_INIT(&amp;amp;sc-&amp;gt;aac_container_tqh);
+TAILQ_INIT(&amp;amp;sc-&amp;gt;aac_ev_cmfree);
+
+#if __FreeBSD_version &amp;gt;= 800000
+/* Initialize the clock daemon callout. */
+callout_init_mtx(&amp;amp;sc-&amp;gt;aac_daemontime, &amp;amp;sc-&amp;gt;aac_io_lock, 0);
+#endif
+/*
+ * Initialize the adapter.
+ */
+if ((error = aac_alloc(sc)) != 0)
+return(error);
+if (!(sc-&amp;gt;flags &amp;amp; AAC_FLAGS_SYNC_MODE)) {
+if ((error = aac_init(sc)) != 0)
+return(error);
+}
+
+/*
+ * Allocate and connect our interrupt.
+ */
+if ((error = aac_setup_intr(sc)) != 0)
+return(error);
+
+/*
+ * Print a little information about the controller.
+ */
+aac_describe_controller(sc);
+
+/*
+ * Make the control device.
+ */
+unit = device_get_unit(sc-&amp;gt;aac_dev);
+sc-&amp;gt;aac_dev_t = make_dev(&amp;amp;aacraid_cdevsw, unit, UID_ROOT, GID_OPERATOR,
+ 0640, "aacraid%d", unit);
+sc-&amp;gt;aac_dev_t-&amp;gt;si_drv1 = sc;
+
+/* Create the AIF thread */
+if (aac_kthread_create((void(*)(void *))aac_command_thread, sc,
+   &amp;amp;sc-&amp;gt;aifthread, 0, 0, "aacraid%daif", unit))
+panic("Could not create AIF thread");
+
+/* Register the shutdown method to only be called post-dump */
+if ((sc-&amp;gt;eh = EVENTHANDLER_REGISTER(shutdown_final, aacraid_shutdown,
+    sc-&amp;gt;aac_dev, SHUTDOWN_PRI_DEFAULT)) == NULL)
+device_printf(sc-&amp;gt;aac_dev,
+      "shutdown event registration failed\n");
+
+/* Find containers */
+mtx_lock(&amp;amp;sc-&amp;gt;aac_io_lock);
+aac_alloc_sync_fib(sc, &amp;amp;fib);
+/* loop over possible containers */
+do {
+if ((aac_get_container_info(sc, fib, i, &amp;amp;mir, &amp;amp;uid)) != 0)
+continue;
+if (i == 0) 
+count = mir.MntRespCount;
+aac_add_container(sc, &amp;amp;mir, 0, uid);
+i++;
+} while ((i &amp;lt; count) &amp;amp;&amp;amp; (i &amp;lt; AAC_MAX_CONTAINERS));
+aac_release_sync_fib(sc);
+mtx_unlock(&amp;amp;sc-&amp;gt;aac_io_lock);
+
+/* Register with CAM for the containers */
+TAILQ_INIT(&amp;amp;sc-&amp;gt;aac_sim_tqh);
+aac_container_bus(sc);
+/* Register with CAM for the non-DASD devices */
+if ((sc-&amp;gt;flags &amp;amp; AAC_FLAGS_ENABLE_CAM) != 0) 
+aac_get_bus_info(sc);
+
+/* poke the bus to actually attach the child devices */
+bus_generic_attach(sc-&amp;gt;aac_dev);
+
+/* mark the controller up */
+sc-&amp;gt;aac_state &amp;amp;= ~AAC_STATE_SUSPEND;
+
+/* enable interrupts now */
+AAC_UNMASK_INTERRUPTS(sc);
+
+#if __FreeBSD_version &amp;gt;= 800000
+mtx_lock(&amp;amp;sc-&amp;gt;aac_io_lock);
+callout_reset(&amp;amp;sc-&amp;gt;aac_daemontime, 60 * hz, aac_daemon, sc);
+mtx_unlock(&amp;amp;sc-&amp;gt;aac_io_lock);
+#else
+{
+struct timeval tv;
+tv.tv_sec = 60;
+tv.tv_usec = 0;
+sc-&amp;gt;timeout_id = timeout(aac_daemon, (void *)sc, tvtohz(&amp;amp;tv));
+}
+#endif
+
+return(0);
+}
+
+static void
+aac_daemon(void *arg)
+{
+struct aac_softc *sc;
+struct timeval tv;
+struct aac_command *cm;
+struct aac_fib *fib;
+
+sc = arg;
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+
+#if __FreeBSD_version &amp;gt;= 800000
+mtx_assert(&amp;amp;sc-&amp;gt;aac_io_lock, MA_OWNED);
+if (callout_pending(&amp;amp;sc-&amp;gt;aac_daemontime) ||
+    callout_active(&amp;amp;sc-&amp;gt;aac_daemontime) == 0)
+return;
+#else
+mtx_lock(&amp;amp;sc-&amp;gt;aac_io_lock);
+#endif
+getmicrotime(&amp;amp;tv);
+
+if (!aacraid_alloc_command(sc, &amp;amp;cm)) {
+fib = cm-&amp;gt;cm_fib;
+cm-&amp;gt;cm_timestamp = time_uptime;
+cm-&amp;gt;cm_datalen = 0;
+cm-&amp;gt;cm_flags |= AAC_CMD_WAIT;
+
+fib-&amp;gt;Header.Size = 
+sizeof(struct aac_fib_header) + sizeof(u_int32_t);
+fib-&amp;gt;Header.XferState =
+AAC_FIBSTATE_HOSTOWNED   |
+AAC_FIBSTATE_INITIALISED |
+AAC_FIBSTATE_EMPTY |
+AAC_FIBSTATE_FROMHOST |
+AAC_FIBSTATE_REXPECTED   |
+AAC_FIBSTATE_NORM |
+AAC_FIBSTATE_ASYNC |
+AAC_FIBSTATE_FAST_RESPONSE;
+fib-&amp;gt;Header.Command = SendHostTime;
+*(uint32_t *)fib-&amp;gt;data = tv.tv_sec;
+
+aacraid_map_command_sg(cm, NULL, 0, 0);
+aacraid_release_command(cm);
+}
+
+#if __FreeBSD_version &amp;gt;= 800000
+callout_schedule(&amp;amp;sc-&amp;gt;aac_daemontime, 30 * 60 * hz);
+#else
+mtx_unlock(&amp;amp;sc-&amp;gt;aac_io_lock);
+tv.tv_sec = 30 * 60;
+tv.tv_usec = 0;
+sc-&amp;gt;timeout_id = timeout(aac_daemon, (void *)sc, tvtohz(&amp;amp;tv));
+#endif
+}
+
+void
+aacraid_add_event(struct aac_softc *sc, struct aac_event *event)
+{
+
+switch (event-&amp;gt;ev_type &amp;amp; AAC_EVENT_MASK) {
+case AAC_EVENT_CMFREE:
+TAILQ_INSERT_TAIL(&amp;amp;sc-&amp;gt;aac_ev_cmfree, event, ev_links);
+break;
+default:
+device_printf(sc-&amp;gt;aac_dev, "aac_add event: unknown event %d\n",
+    event-&amp;gt;ev_type);
+break;
+}
+
+return;
+}
+
+/*
+ * Request information of container #cid
+ */
+static int
+aac_get_container_info(struct aac_softc *sc, struct aac_fib *sync_fib, int cid,
+       struct aac_mntinforesp *mir, u_int32_t *uid)
+{
+struct aac_command *cm;
+struct aac_fib *fib;
+struct aac_mntinfo *mi;
+struct aac_cnt_config *ccfg;
+
+if (sync_fib == NULL) {
+if (aacraid_alloc_command(sc, &amp;amp;cm)) {
+device_printf(sc-&amp;gt;aac_dev,
+"Warning, no free command available\n");
+return (-1);
+}
+fib = cm-&amp;gt;cm_fib;
+} else {
+fib = sync_fib;
+}
+
+mi = (struct aac_mntinfo *)&amp;amp;fib-&amp;gt;data[0];
+/* 4KB support?, 64-bit LBA? */
+if (sc-&amp;gt;aac_support_opt2 &amp;amp; AAC_SUPPORTED_VARIABLE_BLOCK_SIZE)
+mi-&amp;gt;Command = VM_NameServeAllBlk;
+else if (sc-&amp;gt;flags &amp;amp; AAC_FLAGS_LBA_64BIT) 
+mi-&amp;gt;Command = VM_NameServe64;
+else
+mi-&amp;gt;Command = VM_NameServe;
+mi-&amp;gt;MntType = FT_FILESYS;
+mi-&amp;gt;MntCount = cid;
+
+if (sync_fib) {
+if (aac_sync_fib(sc, ContainerCommand, 0, fib,
+ sizeof(struct aac_mntinfo))) {
+device_printf(sc-&amp;gt;aac_dev, "Error probing container %d\n", cid);
+return (-1);
+}
+} else {
+cm-&amp;gt;cm_timestamp = time_uptime;
+cm-&amp;gt;cm_datalen = 0;
+
+fib-&amp;gt;Header.Size = 
+sizeof(struct aac_fib_header) + sizeof(struct aac_mntinfo);
+fib-&amp;gt;Header.XferState =
+AAC_FIBSTATE_HOSTOWNED   |
+AAC_FIBSTATE_INITIALISED |
+AAC_FIBSTATE_EMPTY |
+AAC_FIBSTATE_FROMHOST |
+AAC_FIBSTATE_REXPECTED   |
+AAC_FIBSTATE_NORM |
+AAC_FIBSTATE_ASYNC |
+AAC_FIBSTATE_FAST_RESPONSE;
+fib-&amp;gt;Header.Command = ContainerCommand;
+if (aacraid_wait_command(cm) != 0) {
+device_printf(sc-&amp;gt;aac_dev, "Error probing container %d\n", cid);
+aacraid_release_command(cm);
+return (-1);
+}
+}
+bcopy(&amp;amp;fib-&amp;gt;data[0], mir, sizeof(struct aac_mntinforesp));
+
+/* UID */
+*uid = cid;
+if (mir-&amp;gt;MntTable[0].VolType != CT_NONE &amp;amp;&amp;amp; 
+!(mir-&amp;gt;MntTable[0].ContentState &amp;amp; AAC_FSCS_HIDDEN)) {
+if (!(sc-&amp;gt;aac_support_opt2 &amp;amp; AAC_SUPPORTED_VARIABLE_BLOCK_SIZE))
+mir-&amp;gt;MntTable[0].ObjExtension.BlockSize = 0x200;
+
+ccfg = (struct aac_cnt_config *)&amp;amp;fib-&amp;gt;data[0];
+bzero(ccfg, sizeof (*ccfg) - CT_PACKET_SIZE);
+ccfg-&amp;gt;Command = VM_ContainerConfig;
+ccfg-&amp;gt;CTCommand.command = CT_CID_TO_32BITS_UID;
+ccfg-&amp;gt;CTCommand.param[0] = cid;
+
+if (sync_fib) {
+if (aac_sync_fib(sc, ContainerCommand, 0, fib,
+sizeof(struct aac_cnt_config) == 0) &amp;amp;&amp;amp;
+ccfg-&amp;gt;CTCommand.param[0] == ST_OK &amp;amp;&amp;amp;
+mir-&amp;gt;MntTable[0].VolType != CT_PASSTHRU)
+*uid = ccfg-&amp;gt;CTCommand.param[1];
+} else {
+fib-&amp;gt;Header.Size = 
+sizeof(struct aac_fib_header) + sizeof(struct aac_cnt_config);
+fib-&amp;gt;Header.XferState =
+AAC_FIBSTATE_HOSTOWNED   |
+AAC_FIBSTATE_INITIALISED |
+AAC_FIBSTATE_EMPTY |
+AAC_FIBSTATE_FROMHOST |
+AAC_FIBSTATE_REXPECTED   |
+AAC_FIBSTATE_NORM |
+AAC_FIBSTATE_ASYNC |
+AAC_FIBSTATE_FAST_RESPONSE;
+fib-&amp;gt;Header.Command = ContainerCommand;
+if (aacraid_wait_command(cm) == 0 &amp;amp;&amp;amp;
+ccfg-&amp;gt;CTCommand.param[0] == ST_OK &amp;amp;&amp;amp;
+mir-&amp;gt;MntTable[0].VolType != CT_PASSTHRU)
+*uid = ccfg-&amp;gt;CTCommand.param[1];
+aacraid_release_command(cm);
+}
+}
+
+return (0);
+}
+
+/*
+ * Create a device to represent a new container
+ */
+static void
+aac_add_container(struct aac_softc *sc, struct aac_mntinforesp *mir, int f, 
+  u_int32_t uid)
+{
+struct aac_container *co;
+
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); 
+
+/*
+ * Check container volume type for validity.  Note that many of
+ * the possible types may never show up.
+ */
+if ((mir-&amp;gt;Status == ST_OK) &amp;amp;&amp;amp; (mir-&amp;gt;MntTable[0].VolType != CT_NONE)) {
+co = (struct aac_container *)malloc(sizeof *co, M_AACRAIDBUF,
+       M_NOWAIT | M_ZERO);
+if (co == NULL) {
+panic("Out of memory?!");
+}
+
+co-&amp;gt;co_found = f;
+bcopy(&amp;amp;mir-&amp;gt;MntTable[0], &amp;amp;co-&amp;gt;co_mntobj,
+      sizeof(struct aac_mntobj));
+co-&amp;gt;co_uid = uid;
+TAILQ_INSERT_TAIL(&amp;amp;sc-&amp;gt;aac_container_tqh, co, co_link);
+}
+}
+
+/*
+ * Allocate resources associated with (sc)
+ */
+static int
+aac_alloc(struct aac_softc *sc)
+{
+bus_size_t maxsize;
+
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+
+/*
+ * Create DMA tag for mapping buffers into controller-addressable space.
+ */
+if (bus_dma_tag_create(sc-&amp;gt;aac_parent_dmat, /* parent */
+       1, 0, /* algnmnt, boundary */
+       (sc-&amp;gt;flags &amp;amp; AAC_FLAGS_SG_64BIT) ?
+       BUS_SPACE_MAXADDR :
+       BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
+       BUS_SPACE_MAXADDR, /* highaddr */
+       NULL, NULL, /* filter, filterarg */
+       MAXBSIZE,/* maxsize */
+       sc-&amp;gt;aac_sg_tablesize,/* nsegments */
+       MAXBSIZE,/* maxsegsize */
+       BUS_DMA_ALLOCNOW,/* flags */
+       busdma_lock_mutex,/* lockfunc */
+       &amp;amp;sc-&amp;gt;aac_io_lock,/* lockfuncarg */
+       &amp;amp;sc-&amp;gt;aac_buffer_dmat)) {
+device_printf(sc-&amp;gt;aac_dev, "can't allocate buffer DMA tag\n");
+return (ENOMEM);
+}
+
+/*
+ * Create DMA tag for mapping FIBs into controller-addressable space..
+ */
+if (sc-&amp;gt;flags &amp;amp; AAC_FLAGS_NEW_COMM_TYPE1) 
+maxsize = sc-&amp;gt;aac_max_fibs_alloc * (sc-&amp;gt;aac_max_fib_size +
+sizeof(struct aac_fib_xporthdr) + 31);
+else
+maxsize = sc-&amp;gt;aac_max_fibs_alloc * (sc-&amp;gt;aac_max_fib_size + 31);
+if (bus_dma_tag_create(sc-&amp;gt;aac_parent_dmat,/* parent */
+       1, 0, /* algnmnt, boundary */
+       (sc-&amp;gt;flags &amp;amp; AAC_FLAGS_4GB_WINDOW) ?
+       BUS_SPACE_MAXADDR_32BIT :
+       0x7fffffff,/* lowaddr */
+       BUS_SPACE_MAXADDR, /* highaddr */
+       NULL, NULL, /* filter, filterarg */
+       maxsize,  /* maxsize */
+       1,/* nsegments */
+       maxsize,/* maxsize */
+       0,/* flags */
+       NULL, NULL,/* No locking needed */
+       &amp;amp;sc-&amp;gt;aac_fib_dmat)) {
+device_printf(sc-&amp;gt;aac_dev, "can't allocate FIB DMA tag\n");
+return (ENOMEM);
+}
+
+/*
+ * Create DMA tag for the common structure and allocate it.
+ */
+maxsize = sizeof(struct aac_common);
+maxsize += sc-&amp;gt;aac_max_fibs * sizeof(u_int32_t);
+if (bus_dma_tag_create(sc-&amp;gt;aac_parent_dmat, /* parent */
+       1, 0,/* algnmnt, boundary */
+       (sc-&amp;gt;flags &amp;amp; AAC_FLAGS_4GB_WINDOW) ?
+       BUS_SPACE_MAXADDR_32BIT :
+       0x7fffffff,/* lowaddr */
+       BUS_SPACE_MAXADDR, /* highaddr */
+       NULL, NULL, /* filter, filterarg */
+       maxsize, /* maxsize */
+       1,/* nsegments */
+       maxsize,/* maxsegsize */
+       0,/* flags */
+       NULL, NULL,/* No locking needed */
+       &amp;amp;sc-&amp;gt;aac_common_dmat)) {
+device_printf(sc-&amp;gt;aac_dev,
+      "can't allocate common structure DMA tag\n");
+return (ENOMEM);
+}
+if (bus_dmamem_alloc(sc-&amp;gt;aac_common_dmat, (void **)&amp;amp;sc-&amp;gt;aac_common,
+     BUS_DMA_NOWAIT, &amp;amp;sc-&amp;gt;aac_common_dmamap)) {
+device_printf(sc-&amp;gt;aac_dev, "can't allocate common structure\n");
+return (ENOMEM);
+}
+
+(void)bus_dmamap_load(sc-&amp;gt;aac_common_dmat, sc-&amp;gt;aac_common_dmamap,
+sc-&amp;gt;aac_common, maxsize,
+aac_common_map, sc, 0);
+bzero(sc-&amp;gt;aac_common, maxsize);
+
+/* Allocate some FIBs and associated command structs */
+TAILQ_INIT(&amp;amp;sc-&amp;gt;aac_fibmap_tqh);
+sc-&amp;gt;aac_commands = malloc(sc-&amp;gt;aac_max_fibs * sizeof(struct aac_command),
+  M_AACRAIDBUF, M_WAITOK|M_ZERO);
+mtx_lock(&amp;amp;sc-&amp;gt;aac_io_lock);
+while (sc-&amp;gt;total_fibs &amp;lt; sc-&amp;gt;aac_max_fibs) {
+if (aac_alloc_commands(sc) != 0)
+break;
+}
+mtx_unlock(&amp;amp;sc-&amp;gt;aac_io_lock);
+if (sc-&amp;gt;total_fibs == 0)
+return (ENOMEM);
+
+return (0);
+}
+
+/*
+ * Free all of the resources associated with (sc)
+ *
+ * Should not be called if the controller is active.
+ */
+void
+aacraid_free(struct aac_softc *sc)
+{
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+
+/* remove the control device */
+if (sc-&amp;gt;aac_dev_t != NULL)
+destroy_dev(sc-&amp;gt;aac_dev_t);
+
+/* throw away any FIB buffers, discard the FIB DMA tag */
+aac_free_commands(sc);
+if (sc-&amp;gt;aac_fib_dmat)
+bus_dma_tag_destroy(sc-&amp;gt;aac_fib_dmat);
+
+free(sc-&amp;gt;aac_commands, M_AACRAIDBUF);
+
+/* destroy the common area */
+if (sc-&amp;gt;aac_common) {
+bus_dmamap_unload(sc-&amp;gt;aac_common_dmat, sc-&amp;gt;aac_common_dmamap);
+bus_dmamem_free(sc-&amp;gt;aac_common_dmat, sc-&amp;gt;aac_common,
+sc-&amp;gt;aac_common_dmamap);
+}
+if (sc-&amp;gt;aac_common_dmat)
+bus_dma_tag_destroy(sc-&amp;gt;aac_common_dmat);
+
+/* disconnect the interrupt handler */
+if (sc-&amp;gt;aac_intr)
+bus_teardown_intr(sc-&amp;gt;aac_dev, sc-&amp;gt;aac_irq, sc-&amp;gt;aac_intr);
+if (sc-&amp;gt;aac_irq != NULL)
+bus_release_resource(sc-&amp;gt;aac_dev, SYS_RES_IRQ, sc-&amp;gt;aac_irq_rid,
+     sc-&amp;gt;aac_irq);
+
+/* destroy data-transfer DMA tag */
+if (sc-&amp;gt;aac_buffer_dmat)
+bus_dma_tag_destroy(sc-&amp;gt;aac_buffer_dmat);
+
+/* destroy the parent DMA tag */
+if (sc-&amp;gt;aac_parent_dmat)
+bus_dma_tag_destroy(sc-&amp;gt;aac_parent_dmat);
+
+/* release the register window mapping */
+if (sc-&amp;gt;aac_regs_res0 != NULL)
+bus_release_resource(sc-&amp;gt;aac_dev, SYS_RES_MEMORY,
+     sc-&amp;gt;aac_regs_rid0, sc-&amp;gt;aac_regs_res0);
+if (sc-&amp;gt;aac_regs_res1 != NULL)
+bus_release_resource(sc-&amp;gt;aac_dev, SYS_RES_MEMORY,
+     sc-&amp;gt;aac_regs_rid1, sc-&amp;gt;aac_regs_res1);
+}
+
+/*
+ * Disconnect from the controller completely, in preparation for unload.
+ */
+int
+aacraid_detach(device_t dev)
+{
+struct aac_softc *sc;
+struct aac_container *co;
+struct aac_sim*sim;
+int error;
+
+sc = device_get_softc(dev);
+fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+
+#if __FreeBSD_version &amp;gt;= 800000
+callout_drain(&amp;amp;sc-&amp;gt;aac_daemontime);
+#else
+untimeout(aac_daemon, (void *)sc, sc-&amp;gt;timeout_id);
+#endif
+/* Remove the child containers */
+while ((co = TAILQ_FIRST(&amp;amp;sc-&amp;gt;aac_container_tqh)) != NULL) {
+TAILQ_REMOVE(&amp;amp;sc-&amp;gt;aac_container_tqh, co, co_link);
+free(co, M_AACRAIDBUF);
+}
+
+/* Remove the CAM SIMs */
+while ((sim = TAILQ_FIRST(&amp;amp;sc-&amp;gt;aac_sim_tqh)) != NULL) {
+TAILQ_REMOVE(&amp;amp;sc-&amp;gt;aac_sim_tqh, sim, sim_link);
+error = device_delete_child(dev, sim-&amp;gt;sim_dev);
+if (error)
+return (error);
+free(sim, M_AACRAIDBUF);
+}
+
+if (sc-&amp;gt;aifflags &amp;amp; AAC_AIFFLAGS_RUNNING) {
+sc-&amp;gt;aifflags |= AAC_AIFFLAGS_EXIT;
+wakeup(sc-&amp;gt;aifthread);
+tsleep(sc-&amp;gt;aac_dev, PUSER | PCATCH, "aac_dch", 30 * hz);
+}
+
+if (sc-&amp;gt;aifflags &amp;amp; AAC_AIFFLAGS_RUNNING)
+panic("Cannot shutdown AIF thread");
+
+if ((error = aacraid_shutdown(dev)))
+return(error);
+
+EVENTHANDLER_DEREGISTER(shutdown_final, sc-&amp;gt;eh);
+
+aacraid_free(sc);
+
+mtx_destroy(&amp;amp;sc-&amp;gt;aac_io_lock);
+
+return(0);
+}
+
+/*
+ * Bring the controller down to a dormant state and detach all child devices.
+ *
+ * This function is called before detach or system shutdown.
+ *
+ * Note that we can assume that the bioq on the controller is empty, as we won't
+ * allow shutdown if any device is open.
+ */
+int
+aacraid_shutdown(device_t dev)
+{
+struct aac_softc *sc;
+struct aac_fib *fib;
+struct aac_close_command *cc;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Achim Leubner</dc:creator>
    <dc:date>2013-05-24T09:22:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165496">
    <title>svn commit: r250962 - head/sys/netinet</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165496</link>
    <description>&lt;pre&gt;Author: tuexen
Date: Fri May 24 09:21:18 2013
New Revision: 250962
URL: http://svnweb.freebsd.org/changeset/base/250962

Log:
  Withdraw http://svnweb.freebsd.org/changeset/base/250809
  since the real fix is in http://svnweb.freebsd.org/changeset/base/250952.

Modified:
  head/sys/netinet/sctp_os_bsd.h

Modified: head/sys/netinet/sctp_os_bsd.h
==============================================================================
--- head/sys/netinet/sctp_os_bsd.hFri May 24 06:13:36 2013(r250961)
+++ head/sys/netinet/sctp_os_bsd.hFri May 24 09:21:18 2013(r250962)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -435,7 +435,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef struct rtentry sctp_rtentry_t;
 { \
 int o_flgs = IP_RAWOUTPUT; \
 struct sctp_tcb *local_stcb = stcb; \
-M_SETFIB(o_pak, 0); \
 if (local_stcb &amp;amp;&amp;amp; \
     local_stcb-&amp;gt;sctp_ep &amp;amp;&amp;amp; \
     local_stcb-&amp;gt;sctp_ep-&amp;gt;sctp_socket) \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -446,7 +445,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef struct rtentry sctp_rtentry_t;
 #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \
 { \
 struct sctp_tcb *local_stcb = stcb; \
-M_SETFIB(o_pak, 0); \
 if (local_stcb &amp;amp;&amp;amp; local_stcb-&amp;gt;sctp_ep) \
 result = ip6_output(o_pak, \
     ((struct in6pcb *)(local_stcb-&amp;gt;sctp_ep))-&amp;gt;in6p_outputopts, \
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Michael Tuexen</dc:creator>
    <dc:date>2013-05-24T09:21:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165492">
    <title>svn commit: r250961 - stable/9/sys/cam</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165492</link>
    <description>&lt;pre&gt;Author: scottl
Date: Fri May 24 06:13:36 2013
New Revision: 250961
URL: http://svnweb.freebsd.org/changeset/base/250961

Log:
  Revert r250948, it was merged too soon.

Modified:
  stable/9/sys/cam/cam_periph.c

Modified: stable/9/sys/cam/cam_periph.c
==============================================================================
--- stable/9/sys/cam/cam_periph.cFri May 24 04:03:04 2013(r250960)
+++ stable/9/sys/cam/cam_periph.cFri May 24 06:13:36 2013(r250961)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -733,8 +733,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; cam_periph_mapmem(union ccb *ccb, struct
 case XPT_CONT_TARGET_IO:
 if ((ccb-&amp;gt;ccb_h.flags &amp;amp; CAM_DIR_MASK) == CAM_DIR_NONE)
 return(0);
-KASSERT((ccb-&amp;gt;ccb_h.flags &amp;amp; CAM_DATA_MASK) == CAM_DATA_VADDR,
-    ("not VADDR for SCSI_IO %p %x\n", ccb, ccb-&amp;gt;ccb_h.flags));
 
 data_ptrs[0] = &amp;amp;ccb-&amp;gt;csio.data_ptr;
 lengths[0] = ccb-&amp;gt;csio.dxfer_len;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -744,8 +742,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; cam_periph_mapmem(union ccb *ccb, struct
 case XPT_ATA_IO:
 if ((ccb-&amp;gt;ccb_h.flags &amp;amp; CAM_DIR_MASK) == CAM_DIR_NONE)
 return(0);
-KASSERT((ccb-&amp;gt;ccb_h.flags &amp;amp; CAM_DATA_MASK) == CAM_DATA_VADDR,
-    ("not VADDR for ATA_IO %p %x\n", ccb, ccb-&amp;gt;ccb_h.flags));
 
 data_ptrs[0] = &amp;amp;ccb-&amp;gt;ataio.data_ptr;
 lengths[0] = ccb-&amp;gt;ataio.dxfer_len;
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Scott Long</dc:creator>
    <dc:date>2013-05-24T06:13:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165489">
    <title>svn commit: r250953 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165489</link>
    <description>&lt;pre&gt;Author: markj
Date: Fri May 24 03:29:32 2013
New Revision: 250953
URL: http://svnweb.freebsd.org/changeset/base/250953

Log:
  The fasttrap provider cleans up probes asynchronously when a process with
  USDT probes exits. This was previously done with a callout; however, it is
  possible to sleep while holding the DTrace mutexes, so a panic will occur
  on INVARIANTS kernels if the callout handler can't immediately acquire one
  of these mutexes. This panic will be frequently triggered on systems where
  a USDT-enabled program (perl, for instance) is often run.
  
  This revision changes the fasttrap cleanup mechanism so that a dedicated
  thread is used instead of a callout. The old behaviour is otherwise
  preserved.
  
  Reviewed by:rpaulo
  MFC after:1 month

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.cFri May 24 02:18:37 2013(r250952)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.cFri May 24 03:29:32 2013(r250953)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -155,9 +155,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct cdevsw fasttrap_cdevsw = {
 static struct cdev *fasttrap_cdev;
 static dtrace_meta_provider_id_t fasttrap_meta_id;
 
-static struct callout fasttrap_timeout;
+static struct proc *fasttrap_cleanup_proc;
 static struct mtx fasttrap_cleanup_mtx;
-static uint_t fasttrap_cleanup_work;
+static uint_t fasttrap_cleanup_work, fasttrap_cleanup_drain, fasttrap_cleanup_cv;
 
 /*
  * Generation count on modifications to the global tracepoint lookup table.
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -310,8 +310,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_mod_barrier(uint64_t gen)
 }
 
 /*
- * This is the timeout's callback for cleaning up the providers and their
- * probes.
+ * This function performs asynchronous cleanup of fasttrap providers. The
+ * Solaris implementation of this mechanism use a timeout that's activated in
+ * fasttrap_pid_cleanup(), but this doesn't work in FreeBSD: one may sleep while
+ * holding the DTrace mutexes, but it is unsafe to sleep in a callout handler.
+ * Thus we use a dedicated process to perform the cleanup when requested.
  */
 /*ARGSUSED*/
 static void
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -322,11 +325,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_pid_cleanup_cb(void *data)
 dtrace_provider_id_t provid;
 int i, later = 0, rval;
 
-static volatile int in = 0;
-ASSERT(in == 0);
-in = 1;
-
-while (fasttrap_cleanup_work) {
+mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
+while (!fasttrap_cleanup_drain || later &amp;gt; 0) {
 fasttrap_cleanup_work = 0;
 mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -397,39 +397,32 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_pid_cleanup_cb(void *data)
 }
 mutex_exit(&amp;amp;bucket-&amp;gt;ftb_mtx);
 }
-
 mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
-}
 
-#if 0
-ASSERT(fasttrap_timeout != 0);
-#endif
+/*
+ * If we were unable to retire a provider, try again after a
+ * second. This situation can occur in certain circumstances
+ * where providers cannot be unregistered even though they have
+ * no probes enabled because of an execution of dtrace -l or
+ * something similar.
+ */
+if (later &amp;gt; 0 || fasttrap_cleanup_work ||
+    fasttrap_cleanup_drain) {
+mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
+pause("ftclean", hz);
+mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
+} else
+mtx_sleep(&amp;amp;fasttrap_cleanup_cv, &amp;amp;fasttrap_cleanup_mtx,
+    0, "ftcl", 0);
+}
 
 /*
- * If we were unable to remove a retired provider, try again after
- * a second. This situation can occur in certain circumstances where
- * providers cannot be unregistered even though they have no probes
- * enabled because of an execution of dtrace -l or something similar.
- * If the timeout has been disabled (set to 1 because we're trying
- * to detach), we set fasttrap_cleanup_work to ensure that we'll
- * get a chance to do that work if and when the timeout is reenabled
- * (if detach fails).
- */
-if (later &amp;gt; 0) {
-if (callout_active(&amp;amp;fasttrap_timeout)) {
-callout_reset(&amp;amp;fasttrap_timeout, hz,
-    &amp;amp;fasttrap_pid_cleanup_cb, NULL);
-}
- 
-else if (later &amp;gt; 0)
-fasttrap_cleanup_work = 1;
-} else {
-#if !defined(sun)
-/* Nothing to be done for FreeBSD */
-#endif
-}
+ * Wake up the thread in fasttrap_unload() now that we're done.
+ */
+wakeup(&amp;amp;fasttrap_cleanup_drain);
+mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
 
-in = 0;
+kthread_exit();
 }
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -440,8 +433,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_pid_cleanup(void)
 {
 
 mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
-fasttrap_cleanup_work = 1;
-callout_reset(&amp;amp;fasttrap_timeout, 1, &amp;amp;fasttrap_pid_cleanup_cb, NULL);
+if (!fasttrap_cleanup_work) {
+fasttrap_cleanup_work = 1;
+wakeup(&amp;amp;fasttrap_cleanup_cv);
+}
 mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -991,7 +986,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_pid_enable(void *arg, dtrace_id
 proc_t *p = NULL;
 int i, rc;
 
-
 ASSERT(probe != NULL);
 ASSERT(!probe-&amp;gt;ftp_enabled);
 ASSERT(id == probe-&amp;gt;ftp_id);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2272,17 +2266,23 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int
 fasttrap_load(void)
 {
 ulong_t nent;
-int i;
+int i, ret;
 
         /* Create the /dev/dtrace/fasttrap entry. */
         fasttrap_cdev = make_dev(&amp;amp;fasttrap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
             "dtrace/fasttrap");
 
 mtx_init(&amp;amp;fasttrap_cleanup_mtx, "fasttrap clean", "dtrace", MTX_DEF);
-callout_init_mtx(&amp;amp;fasttrap_timeout, &amp;amp;fasttrap_cleanup_mtx, 0);
 mutex_init(&amp;amp;fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT,
     NULL);
 
+ret = kproc_create(fasttrap_pid_cleanup_cb, NULL,
+    &amp;amp;fasttrap_cleanup_proc, 0, 0, "ftcleanup");
+if (ret != 0) {
+destroy_dev(fasttrap_cdev);
+return (ret);
+}
+
 /*
  * Install our hooks into fork(2), exec(2), and exit(2).
  */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2389,15 +2389,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_unload(void)
 return (-1);
 
 /*
- * Prevent any new timeouts from running by setting fasttrap_timeout
- * to a non-zero value, and wait for the current timeout to complete.
- */
-mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
-fasttrap_cleanup_work = 0;
-callout_drain(&amp;amp;fasttrap_timeout);
-mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
-
-/*
  * Iterate over all of our providers. If there's still a process
  * that corresponds to that pid, fail to detach.
  */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2431,26 +2422,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; fasttrap_unload(void)
 }
 
 if (fail) {
-uint_t work;
-/*
- * If we're failing to detach, we need to unblock timeouts
- * and start a new timeout if any work has accumulated while
- * we've been unsuccessfully trying to detach.
- */
-mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
-work = fasttrap_cleanup_work;
-callout_drain(&amp;amp;fasttrap_timeout);
-mtx_unlock(&amp;amp;fasttrap_cleanup_mtx);
-
-if (work)
-fasttrap_pid_cleanup();
-
 (void) dtrace_meta_register("fasttrap", &amp;amp;fasttrap_mops, NULL,
     &amp;amp;fasttrap_meta_id);
 
 return (-1);
 }
 
+mtx_lock(&amp;amp;fasttrap_cleanup_mtx);
+fasttrap_cleanup_drain = 1;
+/* Wait for the cleanup thread to finish up and signal us. */
+wakeup(&amp;amp;fasttrap_cleanup_cv);
+mtx_sleep(&amp;amp;fasttrap_cleanup_drain, &amp;amp;fasttrap_cleanup_mtx, 0, "ftcld",
+    0);
+fasttrap_cleanup_proc = NULL;
+
 #ifdef DEBUG
 mutex_enter(&amp;amp;fasttrap_count_mtx);
 ASSERT(fasttrap_pid_count == 0);
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Mark Johnston</dc:creator>
    <dc:date>2013-05-24T03:29:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165488">
    <title>svn commit: r250952 - head/sys/kern</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165488</link>
    <description>&lt;pre&gt;Author: julian
Date: Fri May 24 02:18:37 2013
New Revision: 250952
URL: http://svnweb.freebsd.org/changeset/base/250952

Log:
  Initialising the new fibnum field to a known value turns out to
  be a GOOD IDEA (TM).
  Apparently MOST users set this (e.g. tcp and friends) but there are a few
  users that just assume that it is a sensible value but then go on to read it.
  These include SCTP, pf and the FLOWTABLE option (and maybe others).

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.cFri May 24 00:49:12 2013(r250951)
+++ head/sys/kern/kern_mbuf.cFri May 24 02:18:37 2013(r250952)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -470,6 +470,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mb_ctor_mbuf(void *mem, int size, void *
 m-&amp;gt;m_pkthdr.tso_segsz = 0;
 m-&amp;gt;m_pkthdr.ether_vtag = 0;
 m-&amp;gt;m_pkthdr.flowid = 0;
+m-&amp;gt;m_pkthdr.fibnum = 0;
 SLIST_INIT(&amp;amp;m-&amp;gt;m_pkthdr.tags);
 #ifdef MAC
 /* If the label init fails, fail the alloc */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -695,6 +696,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mb_ctor_pack(void *mem, int size, void *
 m-&amp;gt;m_pkthdr.tso_segsz = 0;
 m-&amp;gt;m_pkthdr.ether_vtag = 0;
 m-&amp;gt;m_pkthdr.flowid = 0;
+m-&amp;gt;m_pkthdr.fibnum = 0;
 SLIST_INIT(&amp;amp;m-&amp;gt;m_pkthdr.tags);
 #ifdef MAC
 /* If the label init fails, fail the alloc */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -720,6 +722,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; m_pkthdr_init(struct mbuf *m, int how)
 m-&amp;gt;m_pkthdr.header = NULL;
 m-&amp;gt;m_pkthdr.len = 0;
 m-&amp;gt;m_pkthdr.flowid = 0;
+m-&amp;gt;m_pkthdr.fibnum = 0;
 m-&amp;gt;m_pkthdr.csum_flags = 0;
 m-&amp;gt;m_pkthdr.csum_data = 0;
 m-&amp;gt;m_pkthdr.tso_segsz = 0;
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Julian Elischer</dc:creator>
    <dc:date>2013-05-24T02:18:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165487">
    <title>svn commit: r250951 - head/sys/kern</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165487</link>
    <description>&lt;pre&gt;Author: lstewart
Date: Fri May 24 00:49:12 2013
New Revision: 250951
URL: http://svnweb.freebsd.org/changeset/base/250951

Log:
  Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
  avoid a dangling pointer and eventual panic on system shutdown.
  
  Reported by:Ali &amp;lt;comnetboy at gmail.com&amp;gt;
  Tested by:Ali &amp;lt;comnetboy at gmail.com&amp;gt;
  MFC after:1 week

Modified:
  head/sys/kern/kern_alq.c

Modified: head/sys/kern/kern_alq.c
==============================================================================
--- head/sys/kern/kern_alq.cThu May 23 22:52:21 2013(r250950)
+++ head/sys/kern/kern_alq.cFri May 24 00:49:12 2013(r250951)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -99,6 +99,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static LIST_HEAD(, alq) ald_active;
 static int ald_shutingdown = 0;
 struct thread *ald_thread;
 static struct proc *ald_proc;
+static eventhandler_tag alq_eventhandler_tag = NULL;
 
 #defineALD_LOCK()mtx_lock(&amp;amp;ald_mtx)
 #defineALD_UNLOCK()mtx_unlock(&amp;amp;ald_mtx)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -194,8 +195,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ald_daemon(void)
 
 ald_thread = FIRST_THREAD_IN_PROC(ald_proc);
 
-EVENTHANDLER_REGISTER(shutdown_pre_sync, ald_shutdown, NULL,
-    SHUTDOWN_PRI_FIRST);
+alq_eventhandler_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync,
+    ald_shutdown, NULL, SHUTDOWN_PRI_FIRST);
 
 ALD_LOCK();
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -228,6 +229,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ald_shutdown(void *arg, int howto)
 {
 struct alq *alq;
 
+EVENTHANDLER_DEREGISTER(shutdown_pre_sync, alq_eventhandler_tag);
+
 ALD_LOCK();
 
 /* Ensure no new queues can be created. */
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Lawrence Stewart</dc:creator>
    <dc:date>2013-05-24T00:49:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165486">
    <title>svn commit: r250950 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/lib/libzfs/common</title>
    <link>http://comments.gmane.org/gmane.os.freebsd.devel.cvs.src/165486</link>
    <description>&lt;pre&gt;Author: mm
Date: Thu May 23 22:52:21 2013
New Revision: 250950
URL: http://svnweb.freebsd.org/changeset/base/250950

Log:
  Update vendor/illumos/dist and vendor-sys/illumos/dist
  to illumos-gate 14031:e4eb37f33d60
  
  Illumos ZFS issues:
    3699 zfs hold or release of a non-existent snapshot does not output error
    3739 cannot set zfs quota or reservation on pool version &amp;lt; 22

Modified:
  vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c

Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.cThu May 23 22:51:56 2013(r250949)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.cThu May 23 22:52:21 2013(r250950)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -24,6 +24,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  * Copyright (c) 2012 by Delphix. All rights reserved.
  * Copyright (c) 2012 DEY Storage Systems, Inc.  All rights reserved.
  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2013 Martin Matuska. All rights reserved.
  */
 
 #include &amp;lt;ctype.h&amp;gt;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4116,6 +4117,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; zfs_hold(zfs_handle_t *zhp, const char *
 ha.tag = tag;
 ha.recursive = recursive;
 (void) zfs_hold_one(zfs_handle_dup(zhp), &amp;amp;ha);
+
+if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) {
+fnvlist_free(ha.nvl);
+ret = ENOENT;
+if (!enoent_ok) {
+(void) snprintf(errbuf, sizeof (errbuf),
+    dgettext(TEXT_DOMAIN,
+    "cannot hold snapshot '%s&amp;lt; at &amp;gt;%s'"),
+    zhp-&amp;gt;zfs_name, snapname);
+(void) zfs_standard_error(hdl, ret, errbuf);
+}
+return (ret);
+}
+
 ret = lzc_hold(ha.nvl, cleanup_fd, &amp;amp;errors);
 fnvlist_free(ha.nvl);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4217,12 +4232,25 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; zfs_release(zfs_handle_t *zhp, const cha
 nvlist_t *errors;
 nvpair_t *elem;
 libzfs_handle_t *hdl = zhp-&amp;gt;zfs_hdl;
+char errbuf[1024];
 
 ha.nvl = fnvlist_alloc();
 ha.snapname = snapname;
 ha.tag = tag;
 ha.recursive = recursive;
 (void) zfs_release_one(zfs_handle_dup(zhp), &amp;amp;ha);
+
+if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) {
+fnvlist_free(ha.nvl);
+ret = ENOENT;
+(void) snprintf(errbuf, sizeof (errbuf),
+    dgettext(TEXT_DOMAIN,
+    "cannot release hold from snapshot '%s&amp;lt; at &amp;gt;%s'"),
+    zhp-&amp;gt;zfs_name, snapname);
+(void) zfs_standard_error(hdl, ret, errbuf);
+return (ret);
+}
+
 ret = lzc_release(ha.nvl, &amp;amp;errors);
 fnvlist_free(ha.nvl);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4231,8 +4259,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; zfs_release(zfs_handle_t *zhp, const cha
 
 if (nvlist_next_nvpair(errors, NULL) == NULL) {
 /* no hold-specific errors */
-char errbuf[1024];
-
 (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
     "cannot release"));
 switch (errno) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4249,8 +4275,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; zfs_release(zfs_handle_t *zhp, const cha
 for (elem = nvlist_next_nvpair(errors, NULL);
     elem != NULL;
     elem = nvlist_next_nvpair(errors, elem)) {
-char errbuf[1024];
-
 (void) snprintf(errbuf, sizeof (errbuf),
     dgettext(TEXT_DOMAIN,
     "cannot release hold from snapshot '%s'"),
_______________________________________________
svn-src-all&amp;lt; at &amp;gt;freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe&amp;lt; at &amp;gt;freebsd.org"

&lt;/pre&gt;</description>
    <dc:creator>Martin Matuska</dc:creator>
    <dc:date>2013-05-23T22:52:22</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.os.freebsd.devel.cvs.src">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.os.freebsd.devel.cvs.src</link>
  </textinput>
</rdf:RDF>
