Re: svn commit: r248571 - in head: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cm

2013-04-01 Thread Jaakko Heinonen

Hi,

On 2013-03-21, Martin Matuska wrote:
   Merge libzfs_core branch:
 includes MFV 238590, 238592, 247580

I am getting the following error after this commit:

# zpool list
failed to read pool configuration: bad address
no pools available
# zfs list
failed to read pool configuration: bad address

Reverting sys/cddl to r248570 makes it work again.

From dmesg:

ZFS filesystem version: 5
ZFS storage pool version: features support (5000)

-- 
Jaakko
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248967 - head/sys/fs/nfsclient

2013-04-01 Thread Konstantin Belousov
Author: kib
Date: Mon Apr  1 09:56:48 2013
New Revision: 248967
URL: http://svnweb.freebsd.org/changeset/base/248967

Log:
  Strip the unnneeded spaces, mostly at the end of lines.
  
  MFC after:3 days

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==
--- head/sys/fs/nfsclient/nfs_clbio.c   Mon Apr  1 09:56:20 2013
(r248966)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Mon Apr  1 09:56:48 2013
(r248967)
@@ -74,7 +74,7 @@ int ncl_pbuf_freecnt = -1;/* start out 
 
 static struct buf *nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size,
 struct thread *td);
-static int nfs_directio_write(struct vnode *vp, struct uio *uiop, 
+static int nfs_directio_write(struct vnode *vp, struct uio *uiop,
 struct ucred *cred, int ioflag);
 
 /*
@@ -121,7 +121,7 @@ ncl_getpages(struct vop_getpages_args *a
 
mtx_lock(nmp-nm_mtx);
if ((nmp-nm_flag  NFSMNT_NFSV3) != 0 
-   (nmp-nm_state  NFSSTA_GOTFSINFO) == 0) {  
+   (nmp-nm_state  NFSSTA_GOTFSINFO) == 0) {
mtx_unlock(nmp-nm_mtx);
/* We'll never get here for v4, because we always have fsinfo */
(void)ncl_fsinfo(nmp, vp, cred, td);
@@ -270,7 +270,7 @@ ncl_putpages(struct vop_putpages_args *a
rtvals = ap-a_rtvals;
npages = btoc(count);
offset = IDX_TO_OFF(pages[0]-pindex);
-   
+
mtx_lock(nmp-nm_mtx);
if ((nmp-nm_flag  NFSMNT_NFSV3) != 0 
(nmp-nm_state  NFSSTA_GOTFSINFO) == 0) {
@@ -280,9 +280,9 @@ ncl_putpages(struct vop_putpages_args *a
mtx_unlock(nmp-nm_mtx);
 
mtx_lock(np-n_mtx);
-   if (newnfs_directio_enable  !newnfs_directio_allow_mmap  
+   if (newnfs_directio_enable  !newnfs_directio_allow_mmap 
(np-n_flag  NNONCACHE)  (vp-v_type == VREG)) {
-   mtx_unlock(np-n_mtx); 
+   mtx_unlock(np-n_mtx);
ncl_printf(ncl_putpages: called on noncache-able vnode??\n);
mtx_lock(np-n_mtx);
}
@@ -363,7 +363,7 @@ nfs_bioread_check_cons(struct vnode *vp,
struct vattr vattr;
struct nfsnode *np = VTONFS(vp);
int old_lock;
-   
+
/*
 * Grab the exclusive lock before checking whether the cache is
 * consistent.
@@ -415,7 +415,7 @@ nfs_bioread_check_cons(struct vnode *vp,
}
mtx_unlock(np-n_mtx);
}
-out:   
+out:
ncl_downgrade_vnlock(vp, old_lock);
return error;
 }
@@ -457,10 +457,10 @@ ncl_bioread(struct vnode *vp, struct uio
tmp_off = uio-uio_offset + uio-uio_resid;
if (vp-v_type != VDIR 
(tmp_off  nmp-nm_maxfilesize || tmp_off  uio-uio_offset)) {
-   mtx_unlock(nmp-nm_mtx);   
+   mtx_unlock(nmp-nm_mtx);
return (EFBIG);
}
-   mtx_unlock(nmp-nm_mtx);   
+   mtx_unlock(nmp-nm_mtx);
 
if (newnfs_directio_enable  (ioflag  IO_DIRECT)  (vp-v_type == 
VREG))
/* No caching/ no readaheads. Just read data into the user 
buffer */
@@ -468,17 +468,17 @@ ncl_bioread(struct vnode *vp, struct uio
 
biosize = vp-v_bufobj.bo_bsize;
seqcount = (int)((off_t)(ioflag  IO_SEQSHIFT) * biosize / BKVASIZE);
-   
+
error = nfs_bioread_check_cons(vp, td, cred);
if (error)
return error;
 
do {
u_quad_t nsize;
-   
+
mtx_lock(np-n_mtx);
nsize = np-n_size;
-   mtx_unlock(np-n_mtx); 
+   mtx_unlock(np-n_mtx);
 
switch (vp-v_type) {
case VREG:
@@ -711,13 +711,13 @@ ncl_bioread(struct vnode *vp, struct uio
 }
 
 /*
- * The NFS write path cannot handle iovecs with len  1. So we need to 
+ * The NFS write path cannot handle iovecs with len  1. So we need to
  * break up iovecs accordingly (restricting them to wsize).
- * For the SYNC case, we can do this with 1 copy (user buffer - mbuf). 
- * For the ASYNC case, 2 copies are needed. The first a copy from the 
+ * For the SYNC case, we can do this with 1 copy (user buffer - mbuf).
+ * For the ASYNC case, 2 copies are needed. The first a copy from the
  * user buffer to a staging buffer and then a second copy from the staging
  * buffer to mbufs. This can be optimized by copying from the user buffer
- * directly into mbufs and passing the chain down, but that requires a 
+ * directly into mbufs and passing the chain down, but that requires a
  * fair amount of re-working of the relevant codepaths (and can be done
  * later).
  */
@@ -733,7 +733,7 @@ nfs_directio_write(vp, uiop, cred, iofla
struct thread *td = uiop-uio_td;
int size;
int wsize;
-   
+
mtx_lock(nmp-nm_mtx);
wsize = nmp-nm_wsize;
mtx_unlock(nmp-nm_mtx);
@@ -757,7 

svn commit: r248968 - head/sys/x86/x86

2013-04-01 Thread Konstantin Belousov
Author: kib
Date: Mon Apr  1 09:57:46 2013
New Revision: 248968
URL: http://svnweb.freebsd.org/changeset/base/248968

Log:
  Record the correct error in the trace.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/x86/x86/busdma_machdep.c

Modified: head/sys/x86/x86/busdma_machdep.c
==
--- head/sys/x86/x86/busdma_machdep.c   Mon Apr  1 09:56:48 2013
(r248967)
+++ head/sys/x86/x86/busdma_machdep.c   Mon Apr  1 09:57:46 2013
(r248968)
@@ -251,7 +251,7 @@ bus_dma_tag_create(bus_dma_tag_t parent,
M_ZERO | M_NOWAIT);
if (newtag == NULL) {
CTR4(KTR_BUSDMA, %s returned tag %p tag flags 0x%x error %d,
-   __func__, newtag, 0, error);
+   __func__, newtag, 0, ENOMEM);
return (ENOMEM);
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248969 - head/sys/kern

2013-04-01 Thread Konstantin Belousov
Author: kib
Date: Mon Apr  1 09:59:38 2013
New Revision: 248969
URL: http://svnweb.freebsd.org/changeset/base/248969

Log:
  Do not call the VOP_LOOKUP() for the doomed directory vnode.  The
  vnode could be reclaimed while lock upgrade was performed.
  
  Sponsored by: The FreeBSD Foundation
  Reported and tested by:   pho
  Diagnosed and reviewed by:rmacklem
  MFC after:1 week

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Mon Apr  1 09:57:46 2013(r248968)
+++ head/sys/kern/vfs_lookup.c  Mon Apr  1 09:59:38 2013(r248969)
@@ -698,6 +698,10 @@ unionlookup:
VOP_ISLOCKED(dp) == LK_SHARED 
(cnp-cn_flags  ISLASTCN)  (cnp-cn_flags  LOCKPARENT))
vn_lock(dp, LK_UPGRADE|LK_RETRY);
+   if ((dp-v_iflag  VI_DOOMED) != 0) {
+   error = ENOENT;
+   goto bad;
+   }
/*
 * If we're looking up the last component and we need an exclusive
 * lock, adjust our lkflags.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248971 - head/sys/netpfil/ipfw

2013-04-01 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Apr  1 11:28:52 2013
New Revision: 248971
URL: http://svnweb.freebsd.org/changeset/base/248971

Log:
  Fix ipfw rule validation partially broken by r248552.
  
  Pointed by:   avg
  MFC with: r248552

Modified:
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c   Mon Apr  1 10:45:35 2013
(r248970)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c   Mon Apr  1 11:28:52 2013
(r248971)
@@ -672,10 +672,6 @@ check_ipfw_struct(struct ip_fw *rule, in
case O_IPID:
case O_IPTTL:
case O_IPLEN:
-   case O_DSCP:
-   if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1)
-   goto bad_size;
-   break;
case O_TCPDATALEN:
case O_TCPWIN:
case O_TAGGED:
@@ -683,6 +679,11 @@ check_ipfw_struct(struct ip_fw *rule, in
goto bad_size;
break;
 
+   case O_DSCP:
+   if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1)
+   goto bad_size;
+   break;
+
case O_MAC_TYPE:
case O_IP_SRCPORT:
case O_IP_DSTPORT: /* XXX artificial limit, 30 port pairs */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248552 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw

2013-04-01 Thread Alexander V. Chernikov
On 01.04.2013 00:50, Andriy Gapon wrote:
 on 20/03/2013 12:35 Alexander V. Chernikov said the following:
 Author: melifaro
 Date: Wed Mar 20 10:35:33 2013
 New Revision: 248552
 URL: http://svnweb.freebsd.org/changeset/base/248552

 Log:
   Add ipfw support for setting/matching DiffServ codepoints (DSCP).
   
   Setting DSCP support is done via O_SETDSCP which works for both
   IPv4 and IPv6 packets. Fast checksum recalculation (RFC 1624) is done for 
 IPv4.
   Dscp can be specified by name (AFXY, CSX, BE, EF), by value
   (0..63) or via tablearg.
   
   Matching DSCP is done via another opcode (O_DSCP) which accepts several
   classes at once (af11,af22,be). Classes are stored in bitmask (2 u32 
 words).
 [snip]
 Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
 ==
 --- head/sys/netpfil/ipfw/ip_fw_sockopt.cWed Mar 20 09:56:20 2013
 (r248551)
 +++ head/sys/netpfil/ipfw/ip_fw_sockopt.cWed Mar 20 10:35:33 2013
 (r248552)
 @@ -671,6 +671,10 @@ check_ipfw_struct(struct ip_fw *rule, in
  case O_IPID:
  case O_IPTTL:
  case O_IPLEN:
 +case O_DSCP:
 +if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1)
 +goto bad_size;
 +break;
  case O_TCPDATALEN:
  case O_TCPWIN:
  case O_TAGGED:
 
 Could you please double-check this part of the change?
 Handling of the new O_DSCP opcode is inserted in the middle of the long
 fall-through list of cases and thus it modifies behavior of the preceding 
 cases.
 The commit message does not say anything about that.
Yes, my fault. I've changed O_DSCP token to accept bitmask instead of
single variable and forgot to properly update given part.

Fixed in r248971.
 
 I've just done my bi-monthly release/upgrade and ipfw now chokes on my 
 ruleset.
 There is the following message in system log:
 kernel: ipfw: opcode 0 size 8 wrong
 Offending rule seems to be:
 allow ip from any to any via tun*
 
 Reverting this commit fixes the problem.
 Thank you.
 


-- 
WBR, Alexander
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248972 - head/bin/setfacl

2013-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr  1 13:17:28 2013
New Revision: 248972
URL: http://svnweb.freebsd.org/changeset/base/248972

Log:
  Mention that read_attributes, write_attributes, read_acl and write_acl
  are always permitted for the file owner.
  
  PR:   kern/174948
  MFC after:1 week

Modified:
  head/bin/setfacl/setfacl.1

Modified: head/bin/setfacl/setfacl.1
==
--- head/bin/setfacl/setfacl.1  Mon Apr  1 11:28:52 2013(r248971)
+++ head/bin/setfacl/setfacl.1  Mon Apr  1 13:17:28 2013(r248972)
@@ -26,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 8, 2013
+.Dd April 1, 2013
 .Dt SETFACL 1
 .Os
 .Sh NAME
@@ -401,6 +401,10 @@ NFSv4 ACL entries are evaluated in their
 .Pp
 Multiple ACL entries specified on the command line are
 separated by commas.
+.Pp
+Note that the file owner is always granted the read_acl, write_acl,
+read_attributes, and write_attributes permissions, even if the ACL
+would deny it.
 .Sh EXIT STATUS
 .Ex -std
 .Sh EXAMPLES
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248973 - head/sys/dev/tws

2013-04-01 Thread Alexander Motin
Author: mav
Date: Mon Apr  1 13:18:34 2013
New Revision: 248973
URL: http://svnweb.freebsd.org/changeset/base/248973

Log:
  Slightly tune locking to not call xpt_alloc_ccb() that is allowed to sleep
  while holding the SIM mutex.

Modified:
  head/sys/dev/tws/tws_cam.c
  head/sys/dev/tws/tws_user.c

Modified: head/sys/dev/tws/tws_cam.c
==
--- head/sys/dev/tws/tws_cam.c  Mon Apr  1 13:17:28 2013(r248972)
+++ head/sys/dev/tws/tws_cam.c  Mon Apr  1 13:18:34 2013(r248973)
@@ -217,17 +217,16 @@ tws_bus_scan(struct tws_softc *sc)
 TWS_TRACE_DEBUG(sc, entry, sc, 0);
 if (!(sc-sim))
 return(ENXIO);
-mtx_assert(sc-sim_lock, MA_OWNED);
-if ((ccb = xpt_alloc_ccb()) == NULL)
-   return(ENOMEM);
-
+ccb = xpt_alloc_ccb();
+mtx_lock(sc-sim_lock);
 if (xpt_create_path(ccb-ccb_h.path, xpt_periph, cam_sim_path(sc-sim),
   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+   mtx_unlock(sc-sim_lock);
 xpt_free_ccb(ccb);
 return(EIO);
 }
 xpt_rescan(ccb);
-
+mtx_unlock(sc-sim_lock);
 return(0);
 }
 

Modified: head/sys/dev/tws/tws_user.c
==
--- head/sys/dev/tws/tws_user.c Mon Apr  1 13:17:28 2013(r248972)
+++ head/sys/dev/tws/tws_user.c Mon Apr  1 13:18:34 2013(r248973)
@@ -73,9 +73,7 @@ tws_ioctl(struct cdev *dev, u_long cmd, 
 break;
 case TWS_IOCTL_SCAN_BUS :
 TWS_TRACE_DEBUG(sc, scan-bus, 0, 0);
-mtx_lock(sc-sim_lock);
 error = tws_bus_scan(sc);
-mtx_unlock(sc-sim_lock);
 break;
 default :
 TWS_TRACE_DEBUG(sc, ioctl-aen, cmd, buf);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248975 - head/crypto/openssh

2013-04-01 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Apr  1 13:48:30 2013
New Revision: 248975
URL: http://svnweb.freebsd.org/changeset/base/248975

Log:
  Silence warnings about redefined macros.

Modified:
  head/crypto/openssh/umac128.c

Modified: head/crypto/openssh/umac128.c
==
--- head/crypto/openssh/umac128.c   Mon Apr  1 13:27:49 2013
(r248974)
+++ head/crypto/openssh/umac128.c   Mon Apr  1 13:48:30 2013
(r248975)
@@ -1,7 +1,11 @@
 /* $FreeBSD$ */
 #define UMAC_OUTPUT_LEN16
+#undef umac_new
 #define umac_new   ssh_umac128_new
+#undef umac_update
 #define umac_updatessh_umac128_update
+#undef umac_final
 #define umac_final ssh_umac128_final
+#undef umac_delete
 #define umac_deletessh_umac128_delete
 #include umac.c
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248976 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-04-01 Thread Martin Matuska
Author: mm
Date: Mon Apr  1 16:14:57 2013
New Revision: 248976
URL: http://svnweb.freebsd.org/changeset/base/248976

Log:
  Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held
  
  Submitted by: Andriy Gapon a...@freebsd.org
  MFC after:17 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Apr  1 
13:48:30 2013(r248975)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Apr  1 
16:14:57 2013(r248976)
@@ -2197,8 +2197,10 @@ zvol_create_snapshots(objset_t *os, cons
break;
}
 
+   dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
error = dmu_snapshot_list_next(os, MAXPATHLEN - len,
sname + len, obj, cookie, NULL);
+   dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
if (error != 0) {
if (error == ENOENT)
error = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248977 - in head/sys/dev: nvd nvme

2013-04-01 Thread Jim Harris
Author: jimharris
Date: Mon Apr  1 16:23:34 2013
New Revision: 248977
URL: http://svnweb.freebsd.org/changeset/base/248977

Log:
  Add unmapped bio support to nvme(4) and nvd(4).
  
  Sponsored by: Intel

Modified:
  head/sys/dev/nvd/nvd.c
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ns.c
  head/sys/dev/nvme/nvme_ns_cmd.c
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvd/nvd.c
==
--- head/sys/dev/nvd/nvd.c  Mon Apr  1 16:14:57 2013(r248976)
+++ head/sys/dev/nvd/nvd.c  Mon Apr  1 16:23:34 2013(r248977)
@@ -301,6 +301,11 @@ nvd_new_disk(struct nvme_namespace *ns, 
if (nvme_ns_get_flags(ns)  NVME_NS_FLUSH_SUPPORTED)
disk-d_flags |= DISKFLAG_CANFLUSHCACHE;
 
+/* ifdef used here to ease porting to stable branches at a later point. */
+#ifdef DISKFLAG_UNMAPPED_BIO
+   disk-d_flags |= DISKFLAG_UNMAPPED_BIO;
+#endif
+
strlcpy(disk-d_ident, nvme_ns_get_serial_number(ns),
sizeof(disk-d_ident));
 

Modified: head/sys/dev/nvme/nvme.h
==
--- head/sys/dev/nvme/nvme.hMon Apr  1 16:14:57 2013(r248976)
+++ head/sys/dev/nvme/nvme.hMon Apr  1 16:23:34 2013(r248977)
@@ -758,9 +758,13 @@ void   nvme_ctrlr_cmd_get_log_page(struct 
 intnvme_ns_cmd_write(struct nvme_namespace *ns, void *payload,
  uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn,
  void *cb_arg);
+intnvme_ns_cmd_write_bio(struct nvme_namespace *ns, struct bio *bp,
+ nvme_cb_fn_t cb_fn, void *cb_arg);
 intnvme_ns_cmd_read(struct nvme_namespace *ns, void *payload,
 uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn,
 void *cb_arg);
+intnvme_ns_cmd_read_bio(struct nvme_namespace *ns, struct bio *bp,
+ nvme_cb_fn_t cb_fn, void *cb_arg);
 intnvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload,
   uint8_t num_ranges, nvme_cb_fn_t cb_fn,
   void *cb_arg);

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Mon Apr  1 16:14:57 2013(r248976)
+++ head/sys/dev/nvme/nvme_ns.c Mon Apr  1 16:23:34 2013(r248977)
@@ -150,11 +150,17 @@ nvme_ns_strategy(struct bio *bp)
 
 static struct cdevsw nvme_ns_cdevsw = {
.d_version =D_VERSION,
+#ifdef NVME_UNMAPPED_BIO_SUPPORT
+   .d_flags =  D_DISK | D_UNMAPPED_IO,
+   .d_read =   physread,
+   .d_write =  physwrite,
+#else
.d_flags =  D_DISK,
-   .d_open =   nvme_ns_open,
-   .d_close =  nvme_ns_close,
.d_read =   nvme_ns_physio,
.d_write =  nvme_ns_physio,
+#endif
+   .d_open =   nvme_ns_open,
+   .d_close =  nvme_ns_close,
.d_strategy =   nvme_ns_strategy,
.d_ioctl =  nvme_ns_ioctl
 };
@@ -233,16 +239,10 @@ nvme_ns_bio_process(struct nvme_namespac
 
switch (bp-bio_cmd) {
case BIO_READ:
-   err = nvme_ns_cmd_read(ns, bp-bio_data,
-   bp-bio_offset/nvme_ns_get_sector_size(ns),
-   bp-bio_bcount/nvme_ns_get_sector_size(ns),
-   nvme_ns_bio_done, bp);
+   err = nvme_ns_cmd_read_bio(ns, bp, nvme_ns_bio_done, bp);
break;
case BIO_WRITE:
-   err = nvme_ns_cmd_write(ns, bp-bio_data,
-   bp-bio_offset/nvme_ns_get_sector_size(ns),
-   bp-bio_bcount/nvme_ns_get_sector_size(ns),
-   nvme_ns_bio_done, bp);
+   err = nvme_ns_cmd_write_bio(ns, bp, nvme_ns_bio_done, bp);
break;
case BIO_FLUSH:
err = nvme_ns_cmd_flush(ns, nvme_ns_bio_done, bp);

Modified: head/sys/dev/nvme/nvme_ns_cmd.c
==
--- head/sys/dev/nvme/nvme_ns_cmd.c Mon Apr  1 16:14:57 2013
(r248976)
+++ head/sys/dev/nvme/nvme_ns_cmd.c Mon Apr  1 16:23:34 2013
(r248977)
@@ -54,6 +54,35 @@ nvme_ns_cmd_read(struct nvme_namespace *
 }
 
 int
+nvme_ns_cmd_read_bio(struct nvme_namespace *ns, struct bio *bp,
+nvme_cb_fn_t cb_fn, void *cb_arg)
+{
+   struct nvme_request *req;
+   struct nvme_command *cmd;
+   uint64_tlba;
+   uint64_tlba_count;
+
+   req = nvme_allocate_request_bio(bp, cb_fn, cb_arg);
+
+   if (req == NULL)
+   return (ENOMEM);
+   cmd = req-cmd;
+   cmd-opc = NVME_OPC_READ;
+   cmd-nsid = ns-id;
+
+   lba = bp-bio_offset / nvme_ns_get_sector_size(ns);
+   lba_count = 

Re: svn commit: r248705 - head/sys/dev/ipmi

2013-04-01 Thread John Baldwin
On Monday, March 25, 2013 10:30:34 am Alexander V. Chernikov wrote:
 Author: melifaro
 Date: Mon Mar 25 14:30:34 2013
 New Revision: 248705
 URL: http://svnweb.freebsd.org/changeset/base/248705
 
 Log:
   Unlock IPMI sc while performing requests via KCS and SMIC interfaces.
   It is already done in SSIF interface code.
   This reduces contention/spinning reported by many users.

Eh, this was on purpose to prevent concurrent access to the hardware.  SSIF 
doesn't do this because the smbus driver itself does locking internally.  
There are no followups in the PR to state how this patch helps (or if it was 
tested).

OTOH, we should probably make KCS and SMIC perform their requests 
synchronously rather than kicking them over to a worker thread and only use a 
worker thread for SSIF.  This has the advantage that you could make it
interruptible so you could Ctrl-C ipmiutil and have it do something useful.

Also, the current KCS/SMIC code has a timeout, it shouldn't spin forever.  The 
fact that it is spinning forever is a different bug (possibly recently fixed 
by making 'ticks' volatile).  That different bug is probably what should be 
fixed instead.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248682 - head

2013-04-01 Thread John Baldwin
On Sunday, March 24, 2013 8:39:26 am Antoine Brodin wrote:
 Author: antoine
 Date: Sun Mar 24 12:39:26 2013
 New Revision: 248682
 URL: http://svnweb.freebsd.org/changeset/base/248682
 
 Log:
   Add 2 more obsolete files and a missing date.
 
 Modified:
   head/ObsoleteFiles.inc
 
 Modified: head/ObsoleteFiles.inc
 
==
 --- head/ObsoleteFiles.incSun Mar 24 12:35:12 2013(r248681)
 +++ head/ObsoleteFiles.incSun Mar 24 12:39:26 2013(r248682)
 @@ -38,7 +38,11 @@
  #   xargs -n1 | sort | uniq -d;
  # done
  
 +# 20130316: vinum.4 removed
  OLD_FILES+=usr/share/man/man4/vinum.4.gz
 +# 20130312: fortunes-o removed
 +OLD_FILES+=usr/share/games/fortune/fortunes-o
 +OLD_FILES+=usr/share/games/fortune/fortunes-o.dat

This was intentional so that people may choose to keep fortunes-o locally.  In 
that case it would still be installed in this location (as fortune only looks 
in this directory).

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248751 - head/share/mk

2013-04-01 Thread John Baldwin
On Tuesday, March 26, 2013 4:11:10 pm Ed Maste wrote:
 Author: emaste
 Date: Tue Mar 26 20:11:09 2013
 New Revision: 248751
 URL: http://svnweb.freebsd.org/changeset/base/248751
 
 Log:
   Unconditionally include ${SRCCONF} if overridden
   
   This avoids silently failing to include ${SRCCONF} specified by a make(1)
   invocation.
 
 Modified:
   head/share/mk/bsd.own.mk
 
 Modified: head/share/mk/bsd.own.mk
 
==
 --- head/share/mk/bsd.own.mk  Tue Mar 26 20:04:45 2013(r248750)
 +++ head/share/mk/bsd.own.mk  Tue Mar 26 20:11:09 2013(r248751)
 @@ -117,7 +117,7 @@ __bsd.own.mk__:
  
  .if !defined(_WITHOUT_SRCCONF)
  SRCCONF?=/etc/src.conf
 -.if exists(${SRCCONF})
 +.if exists(${SRCCONF}) || ${SRCCONF} != /etc/src.conf
  .include ${SRCCONF}
  .endif
  .endif

Hmm, I'm confused why this matters?  Was exists() failing for a file that did 
exist?  Can you give a more specific use case?

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248836 - head/gnu/usr.bin/gdb/kgdb

2013-04-01 Thread John Baldwin
On Thursday, March 28, 2013 1:04:59 pm Will Andrews wrote:
 Author: will
 Date: Thu Mar 28 17:04:59 2013
 New Revision: 248836
 URL: http://svnweb.freebsd.org/changeset/base/248836
 
 Log:
   KGDB: Allow modules to be loaded from the specified kernel's directory.
   
   When looking up the absolute path for a kld, call find_kld_path() first.
   This enables locating the module in a different directory than the one
   stored in kernel memory.
   
   With this change, kgdb can now be run on a kernel  vmcore whose 
associated
   modules are located in the same directory as the kernel.  This makes
   independent triaging of problems much easier.
   
   This change also does not break the normal kgdb use case where no 
arguments
   are specified; in that case kgdb loads the running kernel and its modules.
   
   Reviewed by:adrian
   Approved by:ken (mentor)
   Sponsored by:   Spectra Logic
   MFC after:  1 month

Sorry I didn't comment on this earlier (was away from mail).  This looks good 
to me.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248751 - head/share/mk

2013-04-01 Thread Chris Rees
On 1 April 2013 17:17, John Baldwin j...@freebsd.org wrote:
 On Tuesday, March 26, 2013 4:11:10 pm Ed Maste wrote:
 Author: emaste
 Date: Tue Mar 26 20:11:09 2013
 New Revision: 248751
 URL: http://svnweb.freebsd.org/changeset/base/248751

 Log:
   Unconditionally include ${SRCCONF} if overridden

   This avoids silently failing to include ${SRCCONF} specified by a make(1)
   invocation.

 Modified:
   head/share/mk/bsd.own.mk

 Modified: head/share/mk/bsd.own.mk

 ==
 --- head/share/mk/bsd.own.mk  Tue Mar 26 20:04:45 2013(r248750)
 +++ head/share/mk/bsd.own.mk  Tue Mar 26 20:11:09 2013(r248751)
 @@ -117,7 +117,7 @@ __bsd.own.mk__:

  .if !defined(_WITHOUT_SRCCONF)
  SRCCONF?=/etc/src.conf
 -.if exists(${SRCCONF})
 +.if exists(${SRCCONF}) || ${SRCCONF} != /etc/src.conf
  .include ${SRCCONF}
  .endif
  .endif

 Hmm, I'm confused why this matters?  Was exists() failing for a file that did
 exist?  Can you give a more specific use case?

I think it's useful that if you've set SRCCONF in make.conf, the build
should complain about a lack of its existence.

A single character spelling error in the name of SRCCONF will have the
build silently failing to include it, thus resulting in enormous
frustration when your settings aren't applied for some non-obvious
reason...

Chris
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248979 - head/etc/mtree

2013-04-01 Thread Ed Maste
Author: emaste
Date: Mon Apr  1 17:15:04 2013
New Revision: 248979
URL: http://svnweb.freebsd.org/changeset/base/248979

Log:
  Format per etc/mtree/README
  
  - Spaces instead of tabs
  - Sort some i18n entries

Modified:
  head/etc/mtree/BSD.usr.dist

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Mon Apr  1 16:26:20 2013(r248978)
+++ head/etc/mtree/BSD.usr.dist Mon Apr  1 17:15:04 2013(r248979)
@@ -22,14 +22,14 @@
 ..
 engines
 ..
-   i18n
-   ..
+i18n
+..
 ..
 lib32
-   dtrace
-   ..
-   i18n
-   ..
+dtrace
+..
+i18n
+..
 ..
 libdata
 gcc
@@ -40,8 +40,8 @@
 ..
 ..
 libexec
-   bsdinstall
-   ..
+bsdinstall
+..
 lpr
 ru
 ..
@@ -207,7 +207,7 @@
 dtrace
 toolkit
 ..
-..  
+..
 examples
 BSD_daemon
 ..
@@ -330,79 +330,79 @@
 fortune
 ..
 ..
+i18n
+csmapper
+APPLE
+..
+AST
+..
+BIG5
+..
+CNS
+..
+CP
+..
+EBCDIC
+..
+GB
+..
+GEORGIAN
+..
+ISO-8859
+..
+ISO646
+..
+JIS
+..
+KAZAKH
+..
+KOI
+..
+KS
+..
+MISC
+..
+TCVN
+..
+..
+esdb
+APPLE
+..
+AST
+..
+BIG5
+..
+CP
+..
+DEC
+..
+EBCDIC
+..
+EUC
+..
+GB
+..
+GEORGIAN
+..
+ISO-2022
+..
+ISO-8859
+..
+ISO646
+..
+KAZAKH
+..
+KOI
+..
+MISC
+..
+TCVN
+..
+UTF
+..
+..
+..
 info
-   ..
-   i18n
-   csmapper
-   APPLE
-   ..
-   AST
-   ..
-   BIG5
-   ..
-   CNS
-   ..
-   CP
-   ..
-   EBCDIC
-   ..
-   GB
-   ..
-   GEORGIAN
-   ..
-   ISO-8859
-   ..
-   ISO646
-   ..
-   JIS
-   ..
-   KAZAKH
-   ..
-   KOI
-   ..
-   KS
-   ..
-   MISC
-   ..
-   TCVN
-   ..
-   ..
-   esdb
-   APPLE
-   ..
-   AST
-   ..
-   BIG5
-   ..
-   CP
-   ..
-   DEC
-   ..
-   EBCDIC
-   ..
-   EUC
-   ..
-   GB
-   ..
-   GEORGIAN
-   ..
-   ISO-2022
-   ..
-   ISO-8859
-   ..
-   ISO646
-   ..
-   KAZAKH
-   ..
-   KOI
-   ..
-   MISC
-   ..
-   TCVN
-   ..
-   UTF
-   ..
-   ..
 ..
 locale
 UTF-8
@@ -429,26 +429,26 @@
 ..
 ca_AD.ISO8859-1
 ..
-ca_ES.ISO8859-1
-..
-ca_FR.ISO8859-1
+ca_AD.ISO8859-15
 ..
-ca_IT.ISO8859-1
+ca_AD.UTF-8
 ..
-ca_AD.ISO8859-15
+ca_ES.ISO8859-1
 ..
 ca_ES.ISO8859-15
 ..
-ca_FR.ISO8859-15
-..
-ca_IT.ISO8859-15
+ca_ES.UTF-8
 ..
-ca_AD.UTF-8
+ca_FR.ISO8859-1
 ..
-ca_ES.UTF-8
+ca_FR.ISO8859-15
 ..
 ca_FR.UTF-8
 ..
+ca_IT.ISO8859-1
+..
+ca_IT.ISO8859-15
+..
 ca_IT.UTF-8
 ..
 

Re: svn commit: r248751 - head/share/mk

2013-04-01 Thread Ed Maste
On 1 April 2013 12:34, Chris Rees cr...@freebsd.org wrote:
 On 1 April 2013 17:17, John Baldwin j...@freebsd.org wrote:
 On Tuesday, March 26, 2013 4:11:10 pm Ed Maste wrote:
 Author: emaste
 Date: Tue Mar 26 20:11:09 2013
 New Revision: 248751
 URL: http://svnweb.freebsd.org/changeset/base/248751

 Log:
   Unconditionally include ${SRCCONF} if overridden

   This avoids silently failing to include ${SRCCONF} specified by a make(1)
   invocation.

 Modified:
   head/share/mk/bsd.own.mk

 Modified: head/share/mk/bsd.own.mk

 ==
 --- head/share/mk/bsd.own.mk  Tue Mar 26 20:04:45 2013(r248750)
 +++ head/share/mk/bsd.own.mk  Tue Mar 26 20:11:09 2013(r248751)
 @@ -117,7 +117,7 @@ __bsd.own.mk__:

  .if !defined(_WITHOUT_SRCCONF)
  SRCCONF?=/etc/src.conf
 -.if exists(${SRCCONF})
 +.if exists(${SRCCONF}) || ${SRCCONF} != /etc/src.conf
  .include ${SRCCONF}
  .endif
  .endif

 Hmm, I'm confused why this matters?  Was exists() failing for a file that did
 exist?  Can you give a more specific use case?

 I think it's useful that if you've set SRCCONF in make.conf, the build
 should complain about a lack of its existence.

 A single character spelling error in the name of SRCCONF will have the
 build silently failing to include it, thus resulting in enormous
 frustration when your settings aren't applied for some non-obvious
 reason...

Exactly. In my case I had incorrectly specified the path to my
src.conf and it took longer than I'd like to admit to discover the
failure.

-Ed
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248980 - head/bin/sh

2013-04-01 Thread Jilles Tjoelker
Author: jilles
Date: Mon Apr  1 17:18:22 2013
New Revision: 248980
URL: http://svnweb.freebsd.org/changeset/base/248980

Log:
  sh: Fix various compiler warnings.
  
  It now passes WARNS=7 with clang on i386.
  
  GCC 4.2.1 does not understand setjmp() properly so will always trigger
  -Wuninitialized. I will not add the volatile keywords to suppress this.

Modified:
  head/bin/sh/exec.c
  head/bin/sh/expand.c
  head/bin/sh/input.c
  head/bin/sh/input.h
  head/bin/sh/jobs.c
  head/bin/sh/main.c
  head/bin/sh/memalloc.c
  head/bin/sh/memalloc.h
  head/bin/sh/parser.c
  head/bin/sh/parser.h
  head/bin/sh/trap.c

Modified: head/bin/sh/exec.c
==
--- head/bin/sh/exec.c  Mon Apr  1 17:15:04 2013(r248979)
+++ head/bin/sh/exec.c  Mon Apr  1 17:18:22 2013(r248980)
@@ -165,7 +165,7 @@ tryexec(char *cmd, char **argv, char **e
}
}
*argv = cmd;
-   *--argv = _PATH_BSHELL;
+   *--argv = __DECONST(char *, _PATH_BSHELL);
execve(_PATH_BSHELL, argv, envp);
}
errno = e;
@@ -188,7 +188,7 @@ padvance(const char **path, const char *
 {
const char *p, *start;
char *q;
-   int len;
+   size_t len;
 
if (*path == NULL)
return NULL;

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cMon Apr  1 17:15:04 2013(r248979)
+++ head/bin/sh/expand.cMon Apr  1 17:18:22 2013(r248980)
@@ -460,7 +460,7 @@ expbackq(union node *cmd, int quoted, in
int startloc = dest - stackblock();
char const *syntax = quoted? DQSYNTAX : BASESYNTAX;
int quotes = flag  (EXP_FULL | EXP_CASE | EXP_REDIR);
-   int nnl;
+   size_t nnl;
 
INTOFF;
saveifs = ifsfirst;
@@ -1163,9 +1163,9 @@ nometa:
 static void
 expmeta(char *enddir, char *name)
 {
-   char *p;
-   char *q;
-   char *start;
+   const char *p;
+   const char *q;
+   const char *start;
char *endname;
int metaflag;
struct stat statb;
@@ -1229,7 +1229,7 @@ expmeta(char *enddir, char *name)
addfname(expdir);
return;
}
-   endname = p;
+   endname = name + (p - name);
if (start != name) {
p = name;
while (p  start) {
@@ -1412,7 +1412,8 @@ match_charclass(const char *p, wchar_t c
*end = NULL;
p++;
nameend = strstr(p, :]);
-   if (nameend == NULL || nameend - p = sizeof(name) || nameend == p)
+   if (nameend == NULL || (size_t)(nameend - p) = sizeof(name) ||
+   nameend == p)
return 0;
memcpy(name, p, nameend - p);
name[nameend - p] = '\0';

Modified: head/bin/sh/input.c
==
--- head/bin/sh/input.c Mon Apr  1 17:15:04 2013(r248979)
+++ head/bin/sh/input.c Mon Apr  1 17:18:22 2013(r248980)
@@ -66,7 +66,7 @@ __FBSDID($FreeBSD$);
 
 struct strpush {
struct strpush *prev;   /* preceding string on stack */
-   char *prevstring;
+   const char *prevstring;
int prevnleft;
int prevlleft;
struct alias *ap;   /* if push was associated with an alias */
@@ -83,7 +83,7 @@ struct parsefile {
int fd; /* file descriptor (or -1 if string) */
int nleft;  /* number of chars left in this line */
int lleft;  /* number of lines left in this buffer */
-   char *nextc;/* next char in buffer */
+   const char *nextc;  /* next char in buffer */
char *buf;  /* input buffer */
struct strpush *strpush; /* for pushing strings at this level */
struct strpush basestrpush; /* so pushing one is fast */
@@ -93,7 +93,7 @@ struct parsefile {
 int plinno = 1;/* input line number */
 int parsenleft;/* copy of parsefile-nleft */
 MKINIT int parselleft; /* copy of parsefile-lleft */
-char *parsenextc;  /* copy of parsefile-nextc */
+const char *parsenextc;/* copy of parsefile-nextc */
 static char basebuf[BUFSIZ + 1];/* buffer for top level input file */
 static struct parsefile basepf = { /* top level input file */
.nextc = basebuf,
@@ -185,7 +185,7 @@ retry:
nr = el_len;
if (nr  BUFSIZ)
nr = BUFSIZ;
-   memcpy(parsenextc, rl_cp, nr);
+   memcpy(parsefile-buf, rl_cp, nr);
if (nr != el_len) {
el_len -= nr;
rl_cp += nr;
@@ -194,7 +194,7 @@ retry:
}
} else
 

Re: svn commit: r247962 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2013-04-01 Thread Dimitry Andric
On Apr 1, 2013, at 08:07, Andriy Gapon a...@freebsd.org wrote:
 on 08/03/2013 00:43 Dimitry Andric said the following:
 Author: dim
 Date: Thu Mar  7 22:43:50 2013
 New Revision: 247962
 URL: http://svnweb.freebsd.org/changeset/base/247962
 
 Log:
  Fix error in r247960: actually assign the basename to match.iim_file.
 
 I've got some bad news.
 
 First of all, sorry for not being thorough enough when this change was
 originally proposed.  I rebuilt only ctfconvert with the patch, but ctfmerge 
 was
 left alone.
 
 It seems that r247960 + r247962 (this commit) broke ctfmerge in my environment
 (head + clang).  While .o files have expected ctf information, combined files
 miss ctf data for functions.
Do you have a good test case?  I tried building a few kernel modules,
but I do see ctf data for functions, at least in ctfdump output.

Also, a simple test case with a pair of .o files, each containing a
function, seems to work properly when processed with ctfmerge.

 I haven't dug yet into this problem, but I suspect that there is some mismatch
 at another place (or even multiple places) where STT_FILE is used.

The only other place is cddl/contrib/opensolaris/tools/ctf/cvt/input.c,
so I more or less blindly made the attached diff, which might solve the
problem.  Can you please try it in your environment?



ctf-input-stt_file-1.diff
Description: Binary data
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r248751 - head/share/mk

2013-04-01 Thread John Baldwin
On Monday, April 01, 2013 1:17:48 pm Ed Maste wrote:
 On 1 April 2013 12:34, Chris Rees cr...@freebsd.org wrote:
  On 1 April 2013 17:17, John Baldwin j...@freebsd.org wrote:
  On Tuesday, March 26, 2013 4:11:10 pm Ed Maste wrote:
  Author: emaste
  Date: Tue Mar 26 20:11:09 2013
  New Revision: 248751
  URL: http://svnweb.freebsd.org/changeset/base/248751
 
  Log:
Unconditionally include ${SRCCONF} if overridden
 
This avoids silently failing to include ${SRCCONF} specified by a 
make(1)
invocation.
 
  Modified:
head/share/mk/bsd.own.mk
 
  Modified: head/share/mk/bsd.own.mk
 
  
==
  --- head/share/mk/bsd.own.mk  Tue Mar 26 20:04:45 2013(r248750)
  +++ head/share/mk/bsd.own.mk  Tue Mar 26 20:11:09 2013(r248751)
  @@ -117,7 +117,7 @@ __bsd.own.mk__:
 
   .if !defined(_WITHOUT_SRCCONF)
   SRCCONF?=/etc/src.conf
  -.if exists(${SRCCONF})
  +.if exists(${SRCCONF}) || ${SRCCONF} != /etc/src.conf
   .include ${SRCCONF}
   .endif
   .endif
 
  Hmm, I'm confused why this matters?  Was exists() failing for a file that 
did
  exist?  Can you give a more specific use case?
 
  I think it's useful that if you've set SRCCONF in make.conf, the build
  should complain about a lack of its existence.
 
  A single character spelling error in the name of SRCCONF will have the
  build silently failing to include it, thus resulting in enormous
  frustration when your settings aren't applied for some non-obvious
  reason...
 
 Exactly. In my case I had incorrectly specified the path to my
 src.conf and it took longer than I'd like to admit to discover the
 failure.

Ahhh, ok.  That makes sense then.  I had parsed the log message differently
somehow to mean that the file wasn't being included and that that was silent, 
not that there was a lack of an error for a non-existent file that was 
explicitly specified.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248983 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/...

2013-04-01 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr  1 19:13:46 2013
New Revision: 248983
URL: http://svnweb.freebsd.org/changeset/base/248983

Log:
  Dtrace: enablings on defunct providers prevent providers from unregistering
  
  Merge change from illumos:
  
  1368 enablings on defunct providers prevent providers from unregistering
  
  We try to address some underlying differences between the Solaris
  and FreeBSD implementations: dtrace_attach() / dtrace_detach() are
  currently unimplemented in FreeBSD but the new code from illumos
  makes use of taskq so some adaptations were made to dtrace_open()
  and dtrace_close() to handle them appropriately.
  
  Illumos Revision: r13430:8e6add739e38
  
  Reference:
  https://www.illumos.org/issues/1368
  
  Reviewed by:  gnn
  Tested by:Fabian Keil
  Obtained from:Illumos
  MFC after:3 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
 - copied unchanged from r248981, 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
 - copied unchanged from r248981, 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
 - copied unchanged from r248981, 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  head/sys/modules/dtrace/dtrace/Makefile

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst 
Mon Apr  1 19:11:43 2013(r248982)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst 
Mon Apr  1 19:13:46 2013(r248983)
@@ -23,7 +23,6 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident%Z%%M% %I% %E% SMI
 
 # Exception list: names tests that are bypassed when running in Java
 # mode (relative to /opt/SUNWdtrt/tst)
@@ -52,14 +51,17 @@ common/usdt/tst.enabled.ksh
 common/usdt/tst.enabled2.ksh
 common/usdt/tst.entryreturn.ksh
 common/usdt/tst.fork.ksh
-common/usdt/tst.header.ksh
 common/usdt/tst.guess32.ksh
 common/usdt/tst.guess64.ksh
+common/usdt/tst.header.ksh
 common/usdt/tst.linkpriv.ksh
 common/usdt/tst.linkunpriv.ksh
 common/usdt/tst.multiple.ksh
 common/usdt/tst.nodtrace.ksh
+common/usdt/tst.noreap.ksh
+common/usdt/tst.noreapring.ksh
 common/usdt/tst.onlyenabled.ksh
+common/usdt/tst.reap.ksh
 common/usdt/tst.reeval.ksh
 common/usdt/tst.static.ksh
 common/usdt/tst.static2.ksh

Copied: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh 
(from r248981, 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
Mon Apr  1 19:13:46 2013(r248983, copy of r248981, 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh)
@@ -0,0 +1,128 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the License).
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets [] replaced with your own identifying
+# information: Portions Copyright [] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+   echo expected one argument: ''dtrace-path''
+   exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat  test.c EOF
+#include unistd.h
+#include sys/sdt.h
+
+int
+main(int argc, char **argv)
+{
+   DTRACE_PROBE(test_prov, probe1);
+}
+EOF
+
+cat  prov.d EOF
+provider test_prov {
+   probe probe1();
+};
+EOF
+
+gcc -c test.c
+if [ $? -ne 0 ]; then
+   print -u2 failed to compile test.c
+   exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+   print -u2 failed to create DOF
+  

svn commit: r248984 - head/sys/dev/ath

2013-04-01 Thread Adrian Chadd
Author: adrian
Date: Mon Apr  1 20:11:19 2013
New Revision: 248984
URL: http://svnweb.freebsd.org/changeset/base/248984

Log:
  Only unmap the RX mbuf DMA map if there's a buffer here.
  
  The normal RX path (ath_rx_pkt()) will sync and unmap the
  buffer before passing it up the stack.  We only need to do this
  if we're flushing the FIFO during reset/shutdown.

Modified:
  head/sys/dev/ath/if_ath_rx_edma.c

Modified: head/sys/dev/ath/if_ath_rx_edma.c
==
--- head/sys/dev/ath/if_ath_rx_edma.c   Mon Apr  1 19:13:46 2013
(r248983)
+++ head/sys/dev/ath/if_ath_rx_edma.c   Mon Apr  1 20:11:19 2013
(r248984)
@@ -680,10 +680,12 @@ ath_edma_rxbuf_free(struct ath_softc *sc
 
ATH_RX_LOCK_ASSERT(sc);
 
-   /* We're doing this multiple times? */
-   bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap);
-
+   /*
+* Only unload the frame if we haven't consumed
+* the mbuf via ath_rx_pkt().
+*/
if (bf-bf_m) {
+   bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap);
m_freem(bf-bf_m);
bf-bf_m = NULL;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248985 - head/sys/dev/ath

2013-04-01 Thread Adrian Chadd
Author: adrian
Date: Mon Apr  1 20:12:21 2013
New Revision: 248985
URL: http://svnweb.freebsd.org/changeset/base/248985

Log:
  Use ATH_MAX_SCATTER rather than ATH_TXDESC.
  
  ATH_MAX_SCATTER is used to size the ath_buf DMA segment array.
  We thus should use it when checking sizes of things.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Apr  1 20:11:19 2013(r248984)
+++ head/sys/dev/ath/if_ath.c   Mon Apr  1 20:12:21 2013(r248985)
@@ -3276,7 +3276,7 @@ ath_desc_alloc(struct ath_softc *sc)
int error;
 
error = ath_descdma_setup(sc, sc-sc_txdma, sc-sc_txbuf,
-   tx, sc-sc_tx_desclen, ath_txbuf, ATH_TXDESC);
+   tx, sc-sc_tx_desclen, ath_txbuf, ATH_MAX_SCATTER);
if (error != 0) {
return error;
}

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cMon Apr  1 20:11:19 2013
(r248984)
+++ head/sys/dev/ath/if_ath_tx.cMon Apr  1 20:12:21 2013
(r248985)
@@ -312,7 +312,7 @@ ath_tx_dmasetup(struct ath_softc *sc, st
 BUS_DMA_NOWAIT);
if (error == EFBIG) {
/* XXX packet requires too many descriptors */
-   bf-bf_nseg = ATH_TXDESC+1;
+   bf-bf_nseg = ATH_MAX_SCATTER + 1;
} else if (error != 0) {
sc-sc_stats.ast_tx_busdma++;
ath_freetx(m0);
@@ -323,9 +323,9 @@ ath_tx_dmasetup(struct ath_softc *sc, st
 * require too many TX descriptors.  We try to convert
 * the latter to a cluster.
 */
-   if (bf-bf_nseg  ATH_TXDESC) { /* too many desc's, linearize */
+   if (bf-bf_nseg  ATH_MAX_SCATTER) {/* too many desc's, 
linearize */
sc-sc_stats.ast_tx_linear++;
-   m = m_collapse(m0, M_NOWAIT, ATH_TXDESC);
+   m = m_collapse(m0, M_NOWAIT, ATH_MAX_SCATTER);
if (m == NULL) {
ath_freetx(m0);
sc-sc_stats.ast_tx_nombuf++;
@@ -340,7 +340,7 @@ ath_tx_dmasetup(struct ath_softc *sc, st
ath_freetx(m0);
return error;
}
-   KASSERT(bf-bf_nseg = ATH_TXDESC,
+   KASSERT(bf-bf_nseg = ATH_MAX_SCATTER,
(too many segments after defrag; nseg %u, bf-bf_nseg));
} else if (bf-bf_nseg == 0) {  /* null packet, discard */
sc-sc_stats.ast_tx_nodata++;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248983 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl

2013-04-01 Thread Andriy Gapon
on 01/04/2013 22:13 Pedro F. Giffuni said the following:
 Dtrace: enablings on defunct providers prevent providers from unregistering

Unfortunately, we have some much larger problems in this area of the FreeBSD 
port.

-- 
Andriy Gapon
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r247962 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2013-04-01 Thread Jim Harris
On Mon, Apr 1, 2013 at 11:04 AM, Dimitry Andric d...@freebsd.org wrote:

 On Apr 1, 2013, at 08:07, Andriy Gapon a...@freebsd.org wrote:
  on 08/03/2013 00:43 Dimitry Andric said the following:
  Author: dim
  Date: Thu Mar  7 22:43:50 2013
  New Revision: 247962
  URL: http://svnweb.freebsd.org/changeset/base/247962
 
  Log:
   Fix error in r247960: actually assign the basename to match.iim_file.
 
  I've got some bad news.
 
  First of all, sorry for not being thorough enough when this change was
  originally proposed.  I rebuilt only ctfconvert with the patch, but
 ctfmerge was
  left alone.
 
  It seems that r247960 + r247962 (this commit) broke ctfmerge in my
 environment
  (head + clang).  While .o files have expected ctf information, combined
 files
  miss ctf data for functions.
 Do you have a good test case?  I tried building a few kernel modules,
 but I do see ctf data for functions, at least in ctfdump output.

 Also, a simple test case with a pair of .o files, each containing a
 function, seems to work properly when processed with ctfmerge.

  I haven't dug yet into this problem, but I suspect that there is some
 mismatch
  at another place (or even multiple places) where STT_FILE is used.

 The only other place is cddl/contrib/opensolaris/tools/ctf/cvt/input.c,
 so I more or less blindly made the attached diff, which might solve the
 problem.  Can you please try it in your environment?


I'm not sure if this is the same problem seen by avg@, but without your
patch, I was getting lots of the following when doing dtrace -lv:

fbt_getargdesc(1309): Unknown function!

Your patch fixes this issue for me.

Thanks,

-Jim
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248986 - head/sys/dev/ath

2013-04-01 Thread Adrian Chadd
Author: adrian
Date: Mon Apr  1 20:44:21 2013
New Revision: 248986
URL: http://svnweb.freebsd.org/changeset/base/248986

Log:
  Remove an un-needed comment.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Apr  1 20:12:21 2013(r248985)
+++ head/sys/dev/ath/if_ath.c   Mon Apr  1 20:44:21 2013(r248986)
@@ -2510,12 +2510,6 @@ _ath_getbuf_locked(struct ath_softc *sc,
  * so the link is correct.
  *
  * The caller must free the buffer using ath_freebuf().
- *
- * XXX TODO: this call shouldn't fail as it'll cause packet loss
- * XXX in the TX pathway when retries are needed.
- * XXX Figure out how to keep some buffers free, or factor the
- * XXX number of busy buffers into the xmit path (ath_start())
- * XXX so we don't over-commit.
  */
 struct ath_buf *
 ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r247962 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2013-04-01 Thread Andriy Gapon
on 01/04/2013 23:38 Jim Harris said the following:
 
 
 
 On Mon, Apr 1, 2013 at 11:04 AM, Dimitry Andric d...@freebsd.org
 mailto:d...@freebsd.org wrote:
 
 On Apr 1, 2013, at 08:07, Andriy Gapon a...@freebsd.org
 mailto:a...@freebsd.org wrote:
  on 08/03/2013 00:43 Dimitry Andric said the following:
  Author: dim
  Date: Thu Mar  7 22:43:50 2013
  New Revision: 247962
  URL: http://svnweb.freebsd.org/changeset/base/247962
 
  Log:
   Fix error in r247960: actually assign the basename to match.iim_file.
 
  I've got some bad news.
 
  First of all, sorry for not being thorough enough when this change was
  originally proposed.  I rebuilt only ctfconvert with the patch, but
 ctfmerge was
  left alone.
 
  It seems that r247960 + r247962 (this commit) broke ctfmerge in my 
 environment
  (head + clang).  While .o files have expected ctf information, combined 
 files
  miss ctf data for functions.
 Do you have a good test case?  I tried building a few kernel modules,
 but I do see ctf data for functions, at least in ctfdump output.
 
 Also, a simple test case with a pair of .o files, each containing a
 function, seems to work properly when processed with ctfmerge.

Were any of the functions that you looked at static?
For me there were tons of the test cases.  To pick at random metaslab_activate
was found in metaslab.o, but not in zfs.ko.

  I haven't dug yet into this problem, but I suspect that there is some 
 mismatch
  at another place (or even multiple places) where STT_FILE is used.
 
 The only other place is cddl/contrib/opensolaris/tools/ctf/cvt/input.c,
 so I more or less blindly made the attached diff, which might solve the
 problem.  Can you please try it in your environment?

This patch does help.  Thank you!

 I'm not sure if this is the same problem seen by avg@, but without your 
 patch, I
 was getting lots of the following when doing dtrace -lv:
 
 fbt_getargdesc(1309): Unknown function!

This is a consequence of the ctfmerge problem.

 Your patch fixes this issue for me.


-- 
Andriy Gapon
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248987 - in head: lib/libc/gen tools/regression/lib/libc/gen

2013-04-01 Thread Jilles Tjoelker
Author: jilles
Date: Mon Apr  1 20:50:07 2013
New Revision: 248987
URL: http://svnweb.freebsd.org/changeset/base/248987

Log:
  wordexp(): Remove wrong IFS usage.
  
  Words in shell script are separated by spaces or tabs independent of the
  value of IFS. The value of IFS is only relevant for the result of
  substitutions. Therefore, there should be a space between 'wordexp' and the
  words to be expanded, not an IFS character.
  
  Paranoia might dictate that the shell ignore IFS from the environment (even
  though our sh currently uses it), so do not depend on it in the new test
  case.

Modified:
  head/lib/libc/gen/wordexp.c
  head/tools/regression/lib/libc/gen/test-wordexp.c

Modified: head/lib/libc/gen/wordexp.c
==
--- head/lib/libc/gen/wordexp.c Mon Apr  1 20:44:21 2013(r248986)
+++ head/lib/libc/gen/wordexp.c Mon Apr  1 20:50:07 2013(r248987)
@@ -114,15 +114,12 @@ we_askshell(const char *words, wordexp_t
int status; /* Child exit status */
int error;  /* Our return value */
int serrno; /* errno to return */
-   char *ifs;  /* IFS env. var. */
char *np, *p;   /* Handy pointers */
char *nstrings; /* Temporary for realloc() */
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
 
serrno = errno;
-   if ((ifs = getenv(IFS)) == NULL)
-   ifs =  \t\n;
 
if (pipe(pdes)  0)
return (WRDE_NOSPACE);  /* XXX */
@@ -150,7 +147,7 @@ we_askshell(const char *words, wordexp_t
if (_dup2(pdes[1], STDOUT_FILENO)  0)
_exit(1);
_close(pdes[1]);
-   if (asprintf(cmd, wordexp%c%s\n, *ifs, words)  0)
+   if (asprintf(cmd, wordexp %s\n, words)  0)
_exit(1);
if ((flags  WRDE_SHOWERR) == 0) {
if ((devnull = _open(_PATH_DEVNULL, O_RDWR, 0666))  0)

Modified: head/tools/regression/lib/libc/gen/test-wordexp.c
==
--- head/tools/regression/lib/libc/gen/test-wordexp.c   Mon Apr  1 20:44:21 
2013(r248986)
+++ head/tools/regression/lib/libc/gen/test-wordexp.c   Mon Apr  1 20:50:07 
2013(r248987)
@@ -208,6 +208,25 @@ main(int argc, char *argv[])
assert(strcmp(we.we_wordv[1], world) == 0);
assert(we.we_wordv[2] == NULL);
wordfree(we);
+   sa.sa_handler = SIG_DFL;
+   r = sigaction(SIGCHLD, sa, NULL);
+   assert(r == 0);
+
+   /*
+* With IFS set to a non-default value (without depending on whether
+* IFS is inherited or not).
+*/
+   r = setenv(IFS, :, 1);
+   assert(r == 0);
+   r = wordexp(hello world, we, 0);
+   assert(r == 0);
+   assert(we.we_wordc == 2);
+   assert(strcmp(we.we_wordv[0], hello) == 0);
+   assert(strcmp(we.we_wordv[1], world) == 0);
+   assert(we.we_wordv[2] == NULL);
+   wordfree(we);
+   r = unsetenv(IFS);
+   assert(r == 0);
 
printf(PASS wordexp()\n);
printf(PASS wordfree()\n);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248988 - head/sys/dev/ath

2013-04-01 Thread Adrian Chadd
Author: adrian
Date: Mon Apr  1 20:57:13 2013
New Revision: 248988
URL: http://svnweb.freebsd.org/changeset/base/248988

Log:
  Ensure that we only call the busdma unmap/flush routines once, when
  the buffer is being freed.
  
  * When buffers are cloned, the original mapping isn't copied but it
wasn't freeing the mapping until later.  To be safe, free the
mapping when the buffer is cloned.
  
  * ath_freebuf() now no longer calls the busdma sync/unmap routines.
  
  * ath_tx_freebuf() now calls sync/unmap.
  
  * Call sync first, before calling unmap.
  
  Tested:
  
  * AR5416, STA mode

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Apr  1 20:50:07 2013(r248987)
+++ head/sys/dev/ath/if_ath.c   Mon Apr  1 20:57:13 2013(r248988)
@@ -2512,7 +2512,7 @@ _ath_getbuf_locked(struct ath_softc *sc,
  * The caller must free the buffer using ath_freebuf().
  */
 struct ath_buf *
-ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf)
+ath_buf_clone(struct ath_softc *sc, struct ath_buf *bf)
 {
struct ath_buf *tbf;
 
@@ -2528,14 +2528,6 @@ ath_buf_clone(struct ath_softc *sc, cons
tbf-bf_flags = bf-bf_flags  ATH_BUF_FLAGS_CLONE;
tbf-bf_status = bf-bf_status;
tbf-bf_m = bf-bf_m;
-   /*
-* XXX Copy the node reference, the caller is responsible
-* for deleting the node reference before it frees its
-* buffer.
-*
-* XXX It's done like this so we don't call the net80211
-* code whilst having active TX queue locks held.
-*/
tbf-bf_node = bf-bf_node;
/* will be setup by the chain/setup function */
tbf-bf_lastds = NULL;
@@ -2547,6 +2539,23 @@ ath_buf_clone(struct ath_softc *sc, cons
 
/* The caller has to re-init the descriptor + links */
 
+   /*
+* Free the DMA mapping here, before we NULL the mbuf.
+* We must only call bus_dmamap_unload() once per mbuf chain
+* or behaviour is undefined.
+*/
+   if (bf-bf_m != NULL) {
+   /*
+* XXX is this POSTWRITE call required?
+*/
+   bus_dmamap_sync(sc-sc_dmat, bf-bf_dmamap,
+   BUS_DMASYNC_POSTWRITE);
+   bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap);
+   }
+
+   bf-bf_m = NULL;
+   bf-bf_node = NULL;
+
/* Copy state */
memcpy(tbf-bf_state, bf-bf_state, sizeof(bf-bf_state));
 
@@ -4220,9 +4229,6 @@ ath_txq_addholdingbuf(struct ath_softc *
 void
 ath_freebuf(struct ath_softc *sc, struct ath_buf *bf)
 {
-   bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap);
-   bus_dmamap_sync(sc-sc_dmat, bf-bf_dmamap, BUS_DMASYNC_POSTWRITE);
-
KASSERT((bf-bf_node == NULL), (%s: bf-bf_node != NULL\n, __func__));
KASSERT((bf-bf_m == NULL), (%s: bf-bf_m != NULL\n, __func__));
 
@@ -4256,6 +4262,17 @@ ath_tx_freebuf(struct ath_softc *sc, str
struct ieee80211_node *ni = bf-bf_node;
struct mbuf *m0 = bf-bf_m;
 
+   /*
+* Make sure that we only sync/unload if there's an mbuf.
+* If not (eg we cloned a buffer), the unload will have already
+* occured.
+*/
+   if (bf-bf_m != NULL) {
+   bus_dmamap_sync(sc-sc_dmat, bf-bf_dmamap,
+   BUS_DMASYNC_POSTWRITE);
+   bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap);
+   }
+
bf-bf_node = NULL;
bf-bf_m = NULL;
 
@@ -4270,13 +4287,9 @@ ath_tx_freebuf(struct ath_softc *sc, str
ieee80211_process_callback(ni, m0, status);
ieee80211_free_node(ni);
}
-   m_freem(m0);
 
-   /*
-* XXX the buffer used to be freed -after-, but the DMA map was
-* freed where ath_freebuf() now is. I've no idea what this
-* will do.
-*/
+   /* Finally, we don't need this mbuf any longer */
+   m_freem(m0);
 }
 
 static struct ath_buf *

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Mon Apr  1 20:50:07 2013
(r248987)
+++ head/sys/dev/ath/if_ath_misc.h  Mon Apr  1 20:57:13 2013
(r248988)
@@ -59,7 +59,7 @@ extern struct ath_buf * ath_getbuf(struc
 extern struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc,
ath_buf_type_t btype);
 extern struct ath_buf * ath_buf_clone(struct ath_softc *sc,
-   const struct ath_buf *bf);
+   struct ath_buf *bf);
 /* XXX change this to NULL the buffer pointer? */
 extern void ath_freebuf(struct ath_softc *sc, struct ath_buf *bf);
 extern void ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf);

Modified: head/sys/dev/ath/if_ath_tx.c

svn commit: r248991 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2013-04-01 Thread Dimitry Andric
Author: dim
Date: Mon Apr  1 21:16:32 2013
New Revision: 248991
URL: http://svnweb.freebsd.org/changeset/base/248991

Log:
  Follow up to r247960 and rr247960 by also amending ctfmerge.  For the
  only other case where STT_FILE symbols are used, in symit_next() in
  cddl/contrib/opensolaris/tools/ctf/cvt/input.c, save the basename of the
  symbol, instead of the full pathname.
  
  Reported by:  avg
  Tested by:avg, jimharris
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/input.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/input.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/input.c Mon Apr  1 21:13:56 
2013(r248990)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/input.c Mon Apr  1 21:16:32 
2013(r248991)
@@ -387,6 +387,7 @@ GElf_Sym *
 symit_next(symit_data_t *si, int type)
 {
GElf_Sym sym;
+   char *bname;
int check_sym = (type == STT_OBJECT || type == STT_FUNC);
 
for (; si-si_next  si-si_nument; si-si_next++) {
@@ -394,8 +395,10 @@ symit_next(symit_data_t *si, int type)
gelf_getsym(si-si_symd, si-si_next, sym);
si-si_curname = (caddr_t)si-si_strd-d_buf + sym.st_name;
 
-   if (GELF_ST_TYPE(sym.st_info) == STT_FILE)
-   si-si_curfile = si-si_curname;
+   if (GELF_ST_TYPE(sym.st_info) == STT_FILE) {
+   bname = strrchr(si-si_curname, '/');
+   si-si_curfile = bname == NULL ? si-si_curname : bname 
+ 1;
+   }
 
if (GELF_ST_TYPE(sym.st_info) != type ||
sym.st_shndx == SHN_UNDEF)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r248983 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl

2013-04-01 Thread Pedro Giffuni

 Da: Andriy Gapon
 
on 01/04/2013 22:13 Pedro F. Giffuni said the following:
 Dtrace: enablings on defunct providers prevent providers from unregistering

Unfortunately, we have some much larger problems in this area of the FreeBSD 
port.


It does help to be in sync with illumos though.

The change seems to be required by this feature:

http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/


Regards,

Pedro.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248992 - head/sys/cam/scsi

2013-04-01 Thread Steven Hartland
Author: smh
Date: Tue Apr  2 00:11:35 2013
New Revision: 248992
URL: http://svnweb.freebsd.org/changeset/base/248992

Log:
  Added ATA Pass-Through support to CAM
  
  sys/cam/scsi/scsi_all.c:
  - Added scsi_ata_pass_16 method
Which use ATA Pass-Through to send commands to the attached disk.
  
  sys/cam/scsi/scsi_all.h:
  - Added defines for all missing ATA Pass-Through commands values.
  
  - Added scsi_ata_pass_16 method.
  
  - Fixed a comment typo while I'm here
  
  Reviewed by:  mav
  Approved by:  pjd (mentor)
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cMon Apr  1 21:16:32 2013
(r248991)
+++ head/sys/cam/scsi/scsi_all.cTue Apr  2 00:11:35 2013
(r248992)
@@ -53,6 +53,7 @@ __FBSDID($FreeBSD$);
 #include cam/cam_queue.h
 #include cam/cam_xpt.h
 #include cam/scsi/scsi_all.h
+#include sys/ata.h
 #include sys/sbuf.h
 #ifndef _KERNEL
 #include camlib.h
@@ -5855,6 +5856,50 @@ scsi_write_same(struct ccb_scsiio *csio,
 }
 
 void
+scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries,
+void (*cbfcnp)(struct cam_periph *, union ccb *),
+u_int32_t flags, u_int8_t tag_action,
+u_int8_t protocol, u_int8_t ata_flags, u_int16_t features,
+u_int16_t sector_count, uint64_t lba, u_int8_t command,
+u_int8_t control, u_int8_t *data_ptr, u_int16_t dxfer_len,
+u_int8_t sense_len, u_int32_t timeout)
+{
+   struct ata_pass_16 *ata_cmd;
+
+   ata_cmd = (struct ata_pass_16 *)csio-cdb_io.cdb_bytes;
+   ata_cmd-opcode = ATA_PASS_16;
+   ata_cmd-protocol = protocol;
+   ata_cmd-flags = ata_flags;
+   ata_cmd-features_ext = features  8;
+   ata_cmd-features = features;
+   ata_cmd-sector_count_ext = sector_count  8;
+   ata_cmd-sector_count = sector_count;
+   ata_cmd-lba_low = lba;
+   ata_cmd-lba_mid = lba  8;
+   ata_cmd-lba_high = lba  16;
+   ata_cmd-device = ATA_DEV_LBA;
+   if (protocol  AP_EXTEND) {
+   ata_cmd-lba_low_ext = lba  24;
+   ata_cmd-lba_mid_ext = lba  32;
+   ata_cmd-lba_high_ext = lba  40;
+   } else
+   ata_cmd-device |= (lba  24)  0x0f;
+   ata_cmd-command = command;
+   ata_cmd-control = control;
+
+   cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ flags,
+ tag_action,
+ data_ptr,
+ dxfer_len,
+ sense_len,
+ sizeof(*ata_cmd),
+ timeout);
+}
+
+void
 scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries,
   void (*cbfcnp)(struct cam_periph *, union ccb *),
   u_int8_t tag_action, u_int8_t byte2,

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hMon Apr  1 21:16:32 2013
(r248991)
+++ head/sys/cam/scsi/scsi_all.hTue Apr  2 00:11:35 2013
(r248992)
@@ -908,6 +908,19 @@ struct scsi_start_stop_unit
 struct ata_pass_12 {
u_int8_t opcode;
u_int8_t protocol;
+#defineAP_PROTO_HARD_RESET (0x00  1)
+#defineAP_PROTO_SRST   (0x01  1)
+#defineAP_PROTO_NON_DATA   (0x03  1)
+#defineAP_PROTO_PIO_IN (0x04  1)
+#defineAP_PROTO_PIO_OUT(0x05  1)
+#defineAP_PROTO_DMA(0x06  1)
+#defineAP_PROTO_DMA_QUEUED (0x07  1)
+#defineAP_PROTO_DEVICE_DIAG(0x08  1)
+#defineAP_PROTO_DEVICE_RESET   (0x09  1)
+#defineAP_PROTO_UDMA_IN(0x10  1)
+#defineAP_PROTO_UDMA_OUT   (0x11  1)
+#defineAP_PROTO_FPDMA  (0x12  1)
+#defineAP_PROTO_RESP_INFO  (0x15  1)
 #defineAP_MULTI0xe0
u_int8_t flags;
 #defineAP_T_LEN0x03
@@ -943,6 +956,15 @@ struct ata_pass_16 {
u_int8_t protocol;
 #defineAP_EXTEND   0x01
u_int8_t flags;
+#defineAP_FLAG_TLEN_NO_DATA(0  0)
+#defineAP_FLAG_TLEN_FEAT   (1  0)
+#defineAP_FLAG_TLEN_SECT_CNT   (2  0)
+#defineAP_FLAG_TLEN_STPSIU (3  0)
+#defineAP_FLAG_BYT_BLOK_BYTES  (0  2)  
+#defineAP_FLAG_BYT_BLOK_BLOCKS (1  2)  
+#defineAP_FLAG_TDIR_TO_DEV (0  3)  
+#defineAP_FLAG_TDIR_FROM_DEV   (1  3)  
+#defineAP_FLAG_CHK_COND(1  5)  
u_int8_t features_ext;
u_int8_t features;
u_int8_t sector_count_ext;
@@ -1064,7 +1086,7 @@ struct ata_pass_16 {
 
 /*
  * This length is the initial inquiry length used by the probe code, as
- * well as the legnth 

svn commit: r248993 - head/sys/dev/bge

2013-04-01 Thread Pyun YongHyeon
Author: yongari
Date: Tue Apr  2 00:57:54 2013
New Revision: 248993
URL: http://svnweb.freebsd.org/changeset/base/248993

Log:
  Fix a typo.
  
  Reported by:  David Imhoff via brad@OpenBSD
  Tested by:hrs
  Reviewed by:  davidch

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Tue Apr  2 00:11:35 2013(r248992)
+++ head/sys/dev/bge/if_bge.c   Tue Apr  2 00:57:54 2013(r248993)
@@ -680,7 +680,7 @@ bge_ape_lock_init(struct bge_softc *sc)
bit = BGE_APE_LOCK_GRANT_DRIVER0;
break;
default:
-   if (sc-bge_func_addr != 0)
+   if (sc-bge_func_addr == 0)
bit = BGE_APE_LOCK_GRANT_DRIVER0;
else
bit = (1  sc-bge_func_addr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r248995 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys usr.sbin/extattr

2013-04-01 Thread Matthew D Fleming
Author: mdf
Date: Tue Apr  2 05:30:41 2013
New Revision: 248995
URL: http://svnweb.freebsd.org/changeset/base/248995

Log:
  Fix return type of extattr_set_* and fix rmextattr(8) utility.
  
  extattr_set_{fd,file,link} is logically a write(2)-like operation and
  should return ssize_t, just like extattr_get_*.  Also, the user-space
  utility was using an int for the return value of extattr_get_* and
  extattr_list_*, both of which return an ssize_t.
  
  MFC after:1 week

Modified:
  head/contrib/libarchive/libarchive/archive_write_disk_posix.c
  head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c
  head/lib/libc/sys/extattr_get_file.2
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master
  head/sys/sys/extattr.h
  head/usr.sbin/extattr/rmextattr.c

Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c
==
--- head/contrib/libarchive/libarchive/archive_write_disk_posix.c   Tue Apr 
 2 04:12:17 2013(r248994)
+++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c   Tue Apr 
 2 05:30:41 2013(r248995)
@@ -3707,7 +3707,7 @@ set_xattrs(struct archive_write_disk *a)
size_t size;
archive_entry_xattr_next(entry, name, value, size);
if (name != NULL) {
-   int e;
+   ssize_t e;
int namespace;
 
if (strncmp(name, user., 5) == 0) {
@@ -3734,7 +3734,7 @@ set_xattrs(struct archive_write_disk *a)
e = 
extattr_set_file(archive_entry_pathname(entry),
namespace, name, value, size);
}
-   if (e != (int)size) {
+   if (e != (ssize_t)size) {
if (errno == ENOTSUP || errno == ENOSYS) {
if (!warning_done) {
warning_done = 1;

Modified: head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c
==
--- head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c  Tue Apr 
 2 04:12:17 2013(r248994)
+++ head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c  Tue Apr 
 2 05:30:41 2013(r248995)
@@ -47,7 +47,8 @@ DEFINE_TEST(test_extattr_freebsd)
struct stat st;
struct archive *a;
struct archive_entry *ae;
-   int n, fd;
+   ssize_t n;
+   int fd;
int extattr_privilege_bug = 0;
 
/*

Modified: head/lib/libc/sys/extattr_get_file.2
==
--- head/lib/libc/sys/extattr_get_file.2Tue Apr  2 04:12:17 2013
(r248994)
+++ head/lib/libc/sys/extattr_get_file.2Tue Apr  2 05:30:41 2013
(r248995)
@@ -50,7 +50,7 @@
 .In sys/extattr.h
 .Ft ssize_t
 .Fn extattr_get_fd int fd int attrnamespace const char *attrname void 
*data size_t nbytes
-.Ft int
+.Ft ssize_t
 .Fn extattr_set_fd int fd int attrnamespace const char *attrname const 
void *data size_t nbytes
 .Ft int
 .Fn extattr_delete_fd int fd int attrnamespace const char *attrname
@@ -58,7 +58,7 @@
 .Fn extattr_list_fd int fd int attrnamespace void *data size_t nbytes
 .Ft ssize_t
 .Fn extattr_get_file const char *path int attrnamespace const char 
*attrname void *data size_t nbytes
-.Ft int
+.Ft ssize_t
 .Fn extattr_set_file const char *path int attrnamespace const char 
*attrname const void *data size_t nbytes
 .Ft int
 .Fn extattr_delete_file const char *path int attrnamespace const char 
*attrname
@@ -66,7 +66,7 @@
 .Fn extattr_list_file const char *path int attrnamespace void *data 
size_t nbytes
 .Ft ssize_t
 .Fn extattr_get_link const char *path int attrnamespace const char 
*attrname void *data size_t nbytes
-.Ft int
+.Ft ssize_t
 .Fn extattr_set_link const char *path int attrnamespace const char 
*attrname const void *data size_t nbytes
 .Ft int
 .Fn extattr_delete_link const char *path int attrnamespace const char 
*attrname

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Tue Apr  2 04:12:17 2013
(r248994)
+++ head/sys/compat/freebsd32/syscalls.master   Tue Apr  2 05:30:41 2013
(r248995)
@@ -634,7 +634,7 @@
 355AUE_EXTATTRCTL  NOPROTO { int extattrctl(const char *path, int cmd, \
const char *filename, int attrnamespace, \
const char *attrname); }
-356AUE_EXTATTR_SET_FILENOPROTO { int extattr_set_file( \
+356AUE_EXTATTR_SET_FILENOPROTO { ssize_t extattr_set_file( \
const char *path, int attrnamespace, \
 

svn commit: r248996 - in head/sys: compat/freebsd32 kern sys

2013-04-01 Thread Matthew D Fleming
Author: mdf
Date: Tue Apr  2 05:30:52 2013
New Revision: 248996
URL: http://svnweb.freebsd.org/changeset/base/248996

Log:
  Regen.
  
  MFC after:1 week

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Tue Apr  2 05:30:41 2013
(r248995)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Apr  2 05:30:52 2013
(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 248599 
2013-03-21 22:59:01Z pjd 
+ * created from FreeBSD
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Apr  2 05:30:41 
2013(r248995)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Apr  2 05:30:52 
2013(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 248599 
2013-03-21 22:59:01Z pjd 
+ * created from FreeBSD
  */
 
 #defineFREEBSD32_SYS_syscall   0

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Apr  2 05:30:41 
2013(r248995)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Apr  2 05:30:52 
2013(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 248599 
2013-03-21 22:59:01Z pjd 
+ * created from FreeBSD
  */
 
 const char *freebsd32_syscallnames[] = {

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cTue Apr  2 05:30:41 
2013(r248995)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cTue Apr  2 05:30:52 
2013(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 248599 
2013-03-21 22:59:01Z pjd 
+ * created from FreeBSD
  */
 
 #include opt_compat.h

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Apr  2 05:30:41 
2013(r248995)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Apr  2 05:30:52 
2013(r248996)
@@ -9493,7 +9493,7 @@ systrace_return_setargdesc(int sysnum, i
/* extattr_set_file */
case 356:
if (ndx == 0 || ndx == 1)
-   p = int;
+   p = ssize_t;
break;
/* extattr_get_file */
case 357:
@@ -9530,7 +9530,7 @@ systrace_return_setargdesc(int sysnum, i
/* extattr_set_fd */
case 371:
if (ndx == 0 || ndx == 1)
-   p = int;
+   p = ssize_t;
break;
/* extattr_get_fd */
case 372:
@@ -9645,7 +9645,7 @@ systrace_return_setargdesc(int sysnum, i
/* extattr_set_link */
case 412:
if (ndx == 0 || ndx == 1)
-   p = int;
+   p = ssize_t;
break;
/* extattr_get_link */
case 413:

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Tue Apr  2 05:30:41 2013(r248995)
+++ head/sys/kern/init_sysent.c Tue Apr  2 05:30:52 2013(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 248599 2013-03-21 
22:59:01Z pjd 
+ * created from FreeBSD
  */
 
 #include opt_compat.h

Modified: head/sys/kern/syscalls.c
==
--- head/sys/kern/syscalls.cTue Apr  2 05:30:41 2013(r248995)
+++ head/sys/kern/syscalls.cTue Apr  2 05:30:52 2013(r248996)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.