svn commit: r302804 - head/sys/dev/hyperv/vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 14 05:49:14 2016
New Revision: 302804
URL: https://svnweb.freebsd.org/changeset/base/302804

Log:
  hyperv/vmbus: Switch to vmbus channel message macros
  
  Prepare for more cleanup.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7094

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/vmbus_reg.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:33:33 2016
(r302803)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:49:14 2016
(r302804)
@@ -52,27 +52,30 @@ static void vmbus_channel_on_offers_deli
 static voidvmbus_chan_msgproc_chrescind(struct vmbus_softc *,
const struct vmbus_message *);
 
-/**
- * Channel message dispatch table
+/*
+ * Vmbus channel message processing.
  */
+
+#define VMBUS_CHANMSG_PROC(name, func) \
+   [VMBUS_CHANMSG_TYPE_##name] = func
+#define VMBUS_CHANMSG_PROC_WAKEUP(name)\
+   VMBUS_CHANMSG_PROC(name, vmbus_msghc_wakeup)
+
 static const vmbus_chanmsg_proc_t
-vmbus_chanmsg_process[HV_CHANNEL_MESSAGE_COUNT] = {
-   [HV_CHANNEL_MESSAGE_OFFER_CHANNEL] =
-   vmbus_channel_on_offer,
-   [HV_CHANNEL_MESSAGE_RESCIND_CHANNEL_OFFER] =
-   vmbus_chan_msgproc_chrescind,
-   [HV_CHANNEL_MESSAGE_ALL_OFFERS_DELIVERED] =
-   vmbus_channel_on_offers_delivered,
-   [HV_CHANNEL_MESSAGE_OPEN_CHANNEL_RESULT] =
-   vmbus_msghc_wakeup,
-   [HV_CHANNEL_MESSAGE_GPADL_CREATED] =
-   vmbus_msghc_wakeup,
-   [HV_CHANNEL_MESSAGE_GPADL_TORNDOWN] =
-   vmbus_msghc_wakeup,
-   [HV_CHANNEL_MESSAGE_VERSION_RESPONSE] =
-   vmbus_msghc_wakeup
+vmbus_chanmsg_process[VMBUS_CHANMSG_TYPE_MAX] = {
+   VMBUS_CHANMSG_PROC(CHOFFER, vmbus_channel_on_offer),
+   VMBUS_CHANMSG_PROC(CHRESCIND,   vmbus_chan_msgproc_chrescind),
+   VMBUS_CHANMSG_PROC(CHOFFER_DONE,vmbus_channel_on_offers_delivered),
+
+   VMBUS_CHANMSG_PROC_WAKEUP(CHOPEN_RESP),
+   VMBUS_CHANMSG_PROC_WAKEUP(GPADL_CONNRESP),
+   VMBUS_CHANMSG_PROC_WAKEUP(GPADL_DISCONNRESP),
+   VMBUS_CHANMSG_PROC_WAKEUP(CONNECT_RESP)
 };
 
+#undef VMBUS_CHANMSG_PROC_WAKEUP
+#undef VMBUS_CHANMSG_PROC
+
 /**
  * @brief Allocate and initialize a vmbus channel object
  */

Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_reg.h   Thu Jul 14 05:33:33 2016
(r302803)
+++ head/sys/dev/hyperv/vmbus/vmbus_reg.h   Thu Jul 14 05:49:14 2016
(r302804)
@@ -125,6 +125,7 @@ struct vmbus_gpa_range {
 #define VMBUS_CHANMSG_TYPE_CHOFFER 1   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHRESCIND   2   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHREQUEST   3   /* REQ */
+#define VMBUS_CHANMSG_TYPE_CHOFFER_DONE4   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHOPEN  5   /* REQ */
 #define VMBUS_CHANMSG_TYPE_CHOPEN_RESP 6   /* RESP */
 #define VMBUS_CHANMSG_TYPE_CHCLOSE 7   /* REQ */
@@ -137,6 +138,7 @@ struct vmbus_gpa_range {
 #define VMBUS_CHANMSG_TYPE_CONNECT 14  /* REQ */
 #define VMBUS_CHANMSG_TYPE_CONNECT_RESP15  /* RESP */
 #define VMBUS_CHANMSG_TYPE_DISCONNECT  16  /* REQ */
+#define VMBUS_CHANMSG_TYPE_MAX 22
 
 struct vmbus_chanmsg_hdr {
uint32_tchm_type;   /* VMBUS_CHANMSG_TYPE_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302803 - head/sys/dev/hyperv/vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 14 05:33:33 2016
New Revision: 302803
URL: https://svnweb.freebsd.org/changeset/base/302803

Log:
  hyperv/vmbus: Move channel offer message definition to vmbus_reg.h
  
  - Avoid bit fields.
  - Avoid unnecessary indirection.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7093

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/vmbus_reg.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:25:31 2016
(r302802)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:33:33 2016
(r302803)
@@ -42,7 +42,7 @@ typedef void  (*vmbus_chanmsg_proc_t)
 
 static struct hv_vmbus_channel *hv_vmbus_allocate_channel(struct vmbus_softc 
*);
 static voidvmbus_channel_on_offer_internal(struct vmbus_softc *,
-   const hv_vmbus_channel_offer_channel *offer);
+   const struct vmbus_chanmsg_choffer *);
 static voidvmbus_chan_detach_task(void *, int);
 
 static voidvmbus_channel_on_offer(struct vmbus_softc *,
@@ -267,18 +267,16 @@ vmbus_channel_select_defcpu(struct hv_vm
 static void
 vmbus_channel_on_offer(struct vmbus_softc *sc, const struct vmbus_message *msg)
 {
-   const hv_vmbus_channel_offer_channel *offer;
-
/* New channel is offered by vmbus */
vmbus_scan_newchan(sc);
 
-   offer = (const hv_vmbus_channel_offer_channel *)msg->msg_data;
-   vmbus_channel_on_offer_internal(sc, offer);
+   vmbus_channel_on_offer_internal(sc,
+   (const struct vmbus_chanmsg_choffer *)msg->msg_data);
 }
 
 static void
 vmbus_channel_on_offer_internal(struct vmbus_softc *sc,
-const hv_vmbus_channel_offer_channel *offer)
+const struct vmbus_chanmsg_choffer *offer)
 {
hv_vmbus_channel* new_channel;
 
@@ -286,14 +284,14 @@ vmbus_channel_on_offer_internal(struct v
 * Allocate the channel object and save this offer
 */
new_channel = hv_vmbus_allocate_channel(sc);
-   new_channel->ch_id = offer->child_rel_id;
-   new_channel->ch_subidx = offer->offer.sub_channel_index;
-   new_channel->ch_guid_type = offer->offer.interface_type;
-   new_channel->ch_guid_inst = offer->offer.interface_instance;
+   new_channel->ch_id = offer->chm_chanid;
+   new_channel->ch_subidx = offer->chm_subidx;
+   new_channel->ch_guid_type = offer->chm_chtype;
+   new_channel->ch_guid_inst = offer->chm_chinst;
 
/* Batch reading is on by default */
new_channel->ch_flags |= VMBUS_CHAN_FLAG_BATCHREAD;
-   if (offer->monitor_allocated)
+   if (offer->chm_flags1 & VMBUS_CHOFFER_FLAG1_HASMNF)
new_channel->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
 
new_channel->ch_monprm = hyperv_dmamem_alloc(
@@ -309,15 +307,15 @@ vmbus_channel_on_offer_internal(struct v
}
new_channel->ch_monprm->mp_connid = VMBUS_CONNID_EVENT;
if (sc->vmbus_version != VMBUS_VERSION_WS2008)
-   new_channel->ch_monprm->mp_connid = offer->connection_id;
+   new_channel->ch_monprm->mp_connid = offer->chm_connid;
 
if (new_channel->ch_flags & VMBUS_CHAN_FLAG_HASMNF) {
new_channel->ch_montrig_idx =
-   offer->monitor_id / VMBUS_MONTRIG_LEN;
+   offer->chm_montrig / VMBUS_MONTRIG_LEN;
if (new_channel->ch_montrig_idx >= VMBUS_MONTRIGS_MAX)
-   panic("invalid monitor id %u", offer->monitor_id);
+   panic("invalid monitor trigger %u", offer->chm_montrig);
new_channel->ch_montrig_mask =
-   1 << (offer->monitor_id % VMBUS_MONTRIG_LEN);
+   1 << (offer->chm_montrig % VMBUS_MONTRIG_LEN);
}
 
/* Select default cpu for this channel. */

Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_reg.h   Thu Jul 14 05:25:31 2016
(r302802)
+++ head/sys/dev/hyperv/vmbus/vmbus_reg.h   Thu Jul 14 05:33:33 2016
(r302803)
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include  /* XXX for hyperv_guid */
 
 /*
  * Hyper-V SynIC message format.
@@ -121,6 +122,7 @@ struct vmbus_gpa_range {
  * - Embedded in hypercall_postmsg_in.hc_data, e.g. request.
  */
 
+#define VMBUS_CHANMSG_TYPE_CHOFFER 1   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHRESCIND   2   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHREQUEST   3   /* REQ */
 #define VMBUS_CHANMSG_TYPE_CHOPEN  5   /* REQ */
@@ -248,4 +250,27 @@ struct vmbus_chanmsg_chrescind {
uint32_tchm_chanid;
 } __packed;
 
+/* VMBUS_CHANMSG_TYPE_CHOFFER */
+struct vmbus_chanmsg_choffer {
+   struct 

svn commit: r302802 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 14 05:25:31 2016
New Revision: 302802
URL: https://svnweb.freebsd.org/changeset/base/302802

Log:
  hyperv: hv_guid -> struct hyperv_guid.
  
  This paves way for the further cleanup/disentangle.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7092

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  head/sys/dev/hyperv/utilities/hv_heartbeat.c
  head/sys/dev/hyperv/utilities/hv_kvp.c
  head/sys/dev/hyperv/utilities/hv_shutdown.c
  head/sys/dev/hyperv/utilities/hv_timesync.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
  head/sys/dev/hyperv/vmbus/hyperv.c
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_if.m

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hThu Jul 14 05:14:12 2016
(r302801)
+++ head/sys/dev/hyperv/include/hyperv.hThu Jul 14 05:25:31 2016
(r302802)
@@ -121,25 +121,13 @@ typedef uint8_t   hv_bool_uint8_t;
((HV_ALIGN_UP(addr+len, PAGE_SIZE) -\
HV_ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT )
 
-typedef struct hv_guid {
-   uint8_t data[16];
-} __packed hv_guid;
+struct hyperv_guid {
+   uint8_t hv_guid[16];
+} __packed;
 
 #define HYPERV_GUID_STRLEN 40
 
-inthyperv_guid2str(const struct hv_guid *, char *, size_t);
-
-#define HV_NIC_GUID\
-   .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,\
-   0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}
-
-#define HV_IDE_GUID\
-   .data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,\
-0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}
-
-#define HV_SCSI_GUID   \
-   .data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,\
-0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}
+inthyperv_guid2str(const struct hyperv_guid *, char *, size_t);
 
 /*
  * At the center of the Channel Management library is
@@ -148,8 +136,8 @@ int hyperv_guid2str(const struct hv_guid
  */
 
 typedef struct hv_vmbus_channel_offer {
-   hv_guid interface_type;
-   hv_guid interface_instance;
+   struct hyperv_guid interface_type;
+   struct hyperv_guid interface_instance;
uint64_tinterrupt_latency_in_100ns_units;
uint32_tinterface_revision;
uint32_tserver_context_area_size; /* in bytes */
@@ -477,8 +465,8 @@ typedef struct hv_vmbus_channel {
TAILQ_ENTRY(hv_vmbus_channel)   ch_link;
uint32_tch_subidx;  /* subchan index */
 
-   struct hv_guid  ch_guid_type;
-   struct hv_guid  ch_guid_inst;
+   struct hyperv_guid  ch_guid_type;
+   struct hyperv_guid  ch_guid_inst;
 
struct sysctl_ctx_list  ch_sysctl_ctx;
 } hv_vmbus_channel;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Jul 14 05:14:12 
2016(r302801)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Jul 14 05:25:31 
2016(r302802)
@@ -399,8 +399,8 @@ hn_ifmedia_sts(struct ifnet *ifp, struct
 }
 
 /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
-static const hv_guid g_net_vsc_device_type = {
-   .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+static const struct hyperv_guid g_net_vsc_device_type = {
+   .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}
 };
 

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cThu Jul 14 
05:14:12 2016(r302801)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cThu Jul 14 
05:25:31 2016(r302802)
@@ -180,14 +180,14 @@ enum hv_storage_type {
 #define HV_STORAGE_SUPPORTS_MULTI_CHANNEL 0x1
 
 /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
-static const hv_guid gStorVscDeviceType={
-   .data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+static const struct hyperv_guid gStorVscDeviceType={
+   .hv_guid = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}
 };
 
 /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
-static const hv_guid gBlkVscDeviceType={
-  

svn commit: r302801 - head/sys/dev/hyperv/include

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 14 05:14:12 2016
New Revision: 302801
URL: https://svnweb.freebsd.org/changeset/base/302801

Log:
  hyperv/vmbus: Remove unused bits
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7091

Modified:
  head/sys/dev/hyperv/include/hyperv.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hThu Jul 14 04:30:42 2016
(r302800)
+++ head/sys/dev/hyperv/include/hyperv.hThu Jul 14 05:14:12 2016
(r302801)
@@ -192,13 +192,6 @@ typedef struct {
uint64_t transaction_id;
 } __packed hv_vm_packet_descriptor;
 
-typedef uint32_t hv_previous_packet_offset;
-
-typedef struct {
-   hv_previous_packet_offset   previous_packet_start_offset;
-   hv_vm_packet_descriptor descriptor;
-} __packed hv_vm_packet_header;
-
 typedef struct {
uint32_t byte_count;
uint32_t byte_offset;
@@ -213,91 +206,6 @@ typedef struct {
hv_vm_transfer_page ranges[1];
 } __packed hv_vm_transfer_page_packet_header;
 
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint32_tgpadl;
-   uint32_treserved;
-} __packed hv_vm_gpadl_packet_header;
-
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint32_tgpadl;
-   uint16_ttransfer_page_set_id;
-   uint16_treserved;
-} __packed hv_vm_add_remove_transfer_page_set;
-
-/*
- * This structure defines a range in guest
- * physical space that can be made
- * to look virtually contiguous.
- */
-
-typedef struct {
-   uint32_t byte_count;
-   uint32_t byte_offset;
-   uint64_t pfn_array[0];
-} __packed hv_gpa_range;
-
-/*
- * This is the format for an Establish Gpadl packet, which contains a handle
- * by which this GPADL will be known and a set of GPA ranges associated with
- * it.  This can be converted to a MDL by the guest OS.  If there are multiple
- * GPA ranges, then the resulting MDL will be "chained," representing multiple
- * VA ranges.
- */
-
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint32_tgpadl;
-   uint32_trange_count;
-   hv_gpa_rangerange[1];
-} __packed hv_vm_establish_gpadl;
-
-/*
- * This is the format for a Teardown Gpadl packet, which indicates that the
- * GPADL handle in the Establish Gpadl packet will never be referenced again.
- */
-
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint32_tgpadl;
-   /* for alignment to a 8-byte boundary */
-   uint32_treserved;
-} __packed hv_vm_teardown_gpadl;
-
-/*
- * This is the format for a GPA-Direct packet, which contains a set of GPA
- * ranges, in addition to commands and/or data.
- */
-
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint32_treserved;
-   uint32_trange_count;
-   hv_gpa_rangerange[1];
-} __packed hv_vm_data_gpa_direct;
-
-/*
- * This is the format for a Additional data Packet.
- */
-typedef struct {
-   hv_vm_packet_descriptor d;
-   uint64_ttotal_bytes;
-   uint32_tbyte_offset;
-   uint32_tbyte_count;
-   uint8_t data[1];
-} __packed hv_vm_additional_data;
-
-typedef union {
-   hv_vm_packet_descriptor simple_header;
-   hv_vm_transfer_page_packet_header   transfer_page_header;
-   hv_vm_gpadl_packet_header   gpadl_header;
-   hv_vm_add_remove_transfer_page_set  add_remove_transfer_page_header;
-   hv_vm_establish_gpadl   establish_gpadl_header;
-   hv_vm_teardown_gpadlteardown_gpadl_header;
-   hv_vm_data_gpa_direct   data_gpa_direct_header;
-} __packed hv_vm_packet_largest_possible_header;
-
 typedef enum {
HV_VMBUS_PACKET_TYPE_INVALID= 0x0,
HV_VMBUS_PACKET_TYPES_SYNCH = 0x1,
@@ -347,14 +255,6 @@ typedef struct {
 } __packed hv_vmbus_channel_msg_header;
 
 /*
- * Query VMBus Version parameters
- */
-typedef struct {
-   hv_vmbus_channel_msg_header header;
-   uint32_tversion;
-} __packed hv_vmbus_channel_query_vmbus_version;
-
-/*
  * Channel Offer parameters
  */
 typedef struct {
@@ -383,20 +283,6 @@ typedef struct {
uint32_tconnection_id;
 } __packed hv_vmbus_channel_offer_channel;
 
-/*
- * Rescind Offer parameters
- */
-typedef struct
-{
-hv_vmbus_channel_msg_headerheader;
-uint32_t   child_rel_id;
-} __packed hv_vmbus_channel_rescind_offer;
-
-typedef struct {
-   hv_vmbus_channel_msg_header header;
-   uint32_t

svn commit: r302800 - stable/10/sbin/kldstat

2016-07-13 Thread Julian Elischer
Author: julian
Date: Thu Jul 14 04:30:42 2016
New Revision: 302800
URL: https://svnweb.freebsd.org/changeset/base/302800

Log:
  MFH: r297023
  
   Add the ability to print out the module specific information in likely 
formats.
  Among other things this gives us the ability to find out the syscall number 
of a dynamically loaded syscall that has a dynamicly allocated vector number.
  
  Sponsored by: Panzura inc.

Modified:
  stable/10/sbin/kldstat/kldstat.8
  stable/10/sbin/kldstat/kldstat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/kldstat/kldstat.8
==
--- stable/10/sbin/kldstat/kldstat.8Thu Jul 14 02:25:29 2016
(r302799)
+++ stable/10/sbin/kldstat/kldstat.8Thu Jul 14 04:30:42 2016
(r302800)
@@ -35,10 +35,12 @@
 .Nm
 .Op Fl q
 .Op Fl v
+.Op Fl d
 .Op Fl i Ar id
 .Op Fl n Ar filename
 .Nm
 .Op Fl q
+.Op Fl d
 .Op Fl m Ar modname
 .Sh DESCRIPTION
 The
@@ -50,6 +52,8 @@ The following options are available:
 .Bl -tag -width indentXX
 .It Fl v
 Be more verbose.
+.It Fl d
+Show the module specific data (as int, unsigned int and unsigned long)
 .It Fl i Ar id
 Display the status of only the file with this ID.
 .It Fl n Ar filename

Modified: stable/10/sbin/kldstat/kldstat.c
==
--- stable/10/sbin/kldstat/kldstat.cThu Jul 14 02:25:29 2016
(r302799)
+++ stable/10/sbin/kldstat/kldstat.cThu Jul 14 04:30:42 2016
(r302800)
@@ -35,19 +35,28 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #definePOINTER_WIDTH   ((int)(sizeof(void *) * 2 + 2))
 
+static int showdata = 0;
+
 static void
 printmod(int modid)
 {
 struct module_stat stat;
 
+bzero(, sizeof(stat));
 stat.version = sizeof(struct module_stat);
 if (modstat(modid, ) < 0)
warn("can't stat module id %d", modid);
 else
-   printf("\t\t%2d %s\n", stat.id, stat.name);
+   if (showdata) {
+   printf("\t\t%2d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, 
+   stat.data.intval, stat.data.uintval, stat.data.ulongval);
+   } else {
+   printf("\t\t%2d %s\n", stat.id, stat.name);
+   }
 }
 
 static void
@@ -78,8 +87,8 @@ printfile(int fileid, int verbose)
 static void
 usage(void)
 {
-fprintf(stderr, "usage: kldstat [-q] [-v] [-i id] [-n filename]\n");
-fprintf(stderr, "   kldstat [-q] [-m modname]\n");
+fprintf(stderr, "usage: kldstat [-d] [-q] [-v] [-i id] [-n filename]\n");
+fprintf(stderr, "   kldstat [-d] [-q] [-m modname]\n");
 exit(1);
 }
 
@@ -94,8 +103,11 @@ main(int argc, char** argv)
 char* modname = NULL;
 char* p;
 
-while ((c = getopt(argc, argv, "i:m:n:qv")) != -1)
+while ((c = getopt(argc, argv, "di:m:n:qv")) != -1)
switch (c) {
+   case 'd':
+   showdata = 1;
+   break;
case 'i':
fileid = (int)strtoul(optarg, , 10);
if (*p != '\0')
@@ -138,8 +150,14 @@ main(int argc, char** argv)
if (modstat(modid, ) < 0)
warn("can't stat module id %d", modid);
else {
-   printf("Id  Refs Name\n");
-   printf("%3d %4d %s\n", stat.id, stat.refs, stat.name);
+   if (showdata) {
+   printf("Id  Refs Name data..(int, uint, ulong)\n");
+   printf("%3d %4d %s (%d, %u, 0x%lx)\n", stat.id, stat.refs, 
stat.name, 
+   stat.data.intval, stat.data.uintval, 
stat.data.ulongval);
+   } else {
+   printf("Id  Refs Name\n");
+   printf("%3d %4d %s\n", stat.id, stat.refs, stat.name);
+   }
}
 
return 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302799 - head/usr.bin/mail

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jul 14 02:25:29 2016
New Revision: 302799
URL: https://svnweb.freebsd.org/changeset/base/302799

Log:
  mail(1): Bring some fixes from other BSDs.
  
  Fix missing forked job changes from r302776 in wait_child().
  
  Obtained from:NetBSD

Modified:
  head/usr.bin/mail/popen.c

Modified: head/usr.bin/mail/popen.c
==
--- head/usr.bin/mail/popen.c   Thu Jul 14 01:16:07 2016(r302798)
+++ head/usr.bin/mail/popen.c   Thu Jul 14 02:25:29 2016(r302799)
@@ -362,21 +362,30 @@ int wait_status;
 int
 wait_child(pid_t pid)
 {
-   sigset_t nset, oset;
struct child *cp;
+   sigset_t nset, oset;
+   pid_t rv = 0;
 
(void)sigemptyset();
(void)sigaddset(, SIGCHLD);
-   (void)sigprocmask(SIG_BLOCK, , ); 
-
+   (void)sigprocmask(SIG_BLOCK, , );
+   /*
+* If we have not already waited on the pid (via sigchild)
+* wait on it now.  Otherwise, use the wait status stashed
+* by sigchild.
+*/
cp = findchild(pid, 1);
-
-   while (!cp->done)
-   (void)sigsuspend();
-   wait_status = cp->status;
-   delchild(cp);
+   if (cp == NULL || !cp->done)
+   rv = waitpid(pid, _status, 0);
+   else
+   wait_status = cp->status;
+   if (cp != NULL)
+   delchild(cp);
(void)sigprocmask(SIG_SETMASK, , NULL);
-   return ((WIFEXITED(wait_status) && WEXITSTATUS(wait_status)) ? -1 : 0);
+   if (rv == -1 || (WIFEXITED(wait_status) && WEXITSTATUS(wait_status)))
+   return -1;
+   else
+   return 0;
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302798 - head/etc/defaults

2016-07-13 Thread Cy Schubert
Author: cy
Date: Thu Jul 14 01:16:07 2016
New Revision: 302798
URL: https://svnweb.freebsd.org/changeset/base/302798

Log:
  Restore lost comment from r301295.
  
  PR:   211027
  Reported by:  trond.endres...@ximalas.info
  Pointy hat to:cy@ (me)
  MFC after:3 days

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==
--- head/etc/defaults/periodic.conf Thu Jul 14 00:42:27 2016
(r302797)
+++ head/etc/defaults/periodic.conf Thu Jul 14 01:16:07 2016
(r302798)
@@ -137,6 +137,7 @@ daily_status_mail_rejects_shorten="NO"  
 # 480.leapfile-ntpd
 daily_ntpd_leapfile_enable="YES"   # Fetch NTP leapfile
 daily_ntpd_avoid_congestion="YES"  # Avoid congesting
+   # leapfile sources
 
 # 480.status-ntpd
 daily_status_ntpd_enable="NO"  # Check NTP status
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302790 - head/usr.sbin/bsdinstall/scripts

2016-07-13 Thread Nathan Whitehorn



On 07/13/16 17:41, Allan Jude wrote:

On 2016-07-13 20:18, Nathan Whitehorn wrote:

Can you please make this dialog default to "skip" for people with
systems where the time is set correctly? I realize "OK" is usually a
no-op, so the "just press enter" is maintained, but "skip" is even more
of a no-op.
-Nathan

On 07/13/16 16:49, Allan Jude wrote:

Author: allanjude
Date: Wed Jul 13 23:49:45 2016
New Revision: 302790
URL: https://svnweb.freebsd.org/changeset/base/302790

Log:
bsdinstall: Prompt user to set the date and time after selecting
timezone
   Not having the correct date and time makes many PKI based things
not work
   In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start
   Submitted by:des (original patch)
MFC after:7 days

Modified:
head/usr.sbin/bsdinstall/scripts/time


Changed to --defaultno for both in r302795.



Thanks!
-Nathan
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302797 - head/share/man/man4

2016-07-13 Thread Mark Johnston
Author: markj
Date: Thu Jul 14 00:42:27 2016
New Revision: 302797
URL: https://svnweb.freebsd.org/changeset/base/302797

Log:
  Document DDB's "alltrace" and "show all trace" commands.
  
  MFC after:3 days

Modified:
  head/share/man/man4/ddb.4

Modified: head/share/man/man4/ddb.4
==
--- head/share/man/man4/ddb.4   Thu Jul 14 00:41:37 2016(r302796)
+++ head/share/man/man4/ddb.4   Thu Jul 14 00:42:27 2016(r302797)
@@ -60,7 +60,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2016
+.Dd July 13, 2016
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -535,6 +535,11 @@ modifier will alter the display to show 
 addresses for the process and not show other information.
 .\"
 .Pp
+.It Ic show Cm all trace
+.It Ic alltrace
+.Xc
+Show a stack trace for every thread in the system.
+.Pp
 .It Ic show Cm all ttys
 Show all TTY's within the system.
 Output is similar to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302790 - head/usr.sbin/bsdinstall/scripts

2016-07-13 Thread Allan Jude
On 2016-07-13 20:18, Nathan Whitehorn wrote:
> Can you please make this dialog default to "skip" for people with
> systems where the time is set correctly? I realize "OK" is usually a
> no-op, so the "just press enter" is maintained, but "skip" is even more
> of a no-op.
> -Nathan
> 
> On 07/13/16 16:49, Allan Jude wrote:
>> Author: allanjude
>> Date: Wed Jul 13 23:49:45 2016
>> New Revision: 302790
>> URL: https://svnweb.freebsd.org/changeset/base/302790
>>
>> Log:
>>bsdinstall: Prompt user to set the date and time after selecting
>> timezone
>>   Not having the correct date and time makes many PKI based things
>> not work
>>   In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start
>>   Submitted by:des (original patch)
>>MFC after:7 days
>>
>> Modified:
>>head/usr.sbin/bsdinstall/scripts/time
>>

Changed to --defaultno for both in r302795.


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r302796 - in head: etc/defaults share/man/man5

2016-07-13 Thread Mark Johnston
Author: markj
Date: Thu Jul 14 00:41:37 2016
New Revision: 302796
URL: https://svnweb.freebsd.org/changeset/base/302796

Log:
  Remove more references to mroute6d, which was removed in r298512.

Modified:
  head/etc/defaults/rc.conf
  head/share/man/man5/rc.conf.5

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Thu Jul 14 00:41:19 2016(r302795)
+++ head/etc/defaults/rc.conf   Thu Jul 14 00:41:37 2016(r302796)
@@ -512,12 +512,6 @@ rtadvd_enable="NO" # Set to YES to enab
# this router becomes a possible candidate
# IPv6 default router for local subnets.
 rtadvd_interfaces=""   # Interfaces rtadvd sends RA packets.
-mroute6d_enable="NO"   # Do IPv6 multicast routing.
-mroute6d_program="/usr/local/sbin/pim6dd"  # Name of IPv6 multicast
-   # routing daemon.  You need to
-   # install it from package or
-   # port.
-mroute6d_flags=""  # Flags to IPv6 multicast routing daemon.
 stf_interface_ipv4addr=""  # Local IPv4 addr for 6to4 IPv6 over IPv4
# tunneling interface. Specify this entry
# to enable 6to4 interface.

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Thu Jul 14 00:41:19 2016
(r302795)
+++ head/share/man/man5/rc.conf.5   Thu Jul 14 00:41:37 2016
(r302796)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 8, 2016
+.Dd July 13, 2016
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -2818,35 +2818,6 @@ these are the flags to pass to the routi
 .Pq Vt str
 The IPv6 equivalent of
 .Va routed_flags .
-.It Va mroute6d_enable
-.Pq Vt bool
-If set to
-.Dq Li YES ,
-run the IPv6 multicast routing daemon.
-.Pp
-Note that multicast routing daemons are no longer included in the
-.Fx
-base system, however, both
-.Xr mrouted 8
-and
-.Xr pim6dd 8
-may be installed from the
-.Fx
-Ports Collection.
-.It Va mroute6d_flags
-.Pq Vt str
-If
-.Va mroute6d_enable
-is set to
-.Dq Li YES ,
-these are the flags passed to the IPv6 multicast routing daemon.
-.It Va mroute6d_program
-.Pq Vt str
-If
-.Va mroute6d_enable
-is set to
-.Dq Li YES ,
-this is the path to the IPv6 multicast routing daemon.
 .It Va rtadvd_enable
 .Pq Vt bool
 If set to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302795 - head/usr.sbin/bsdinstall/scripts

2016-07-13 Thread Allan Jude
Author: allanjude
Date: Thu Jul 14 00:41:19 2016
New Revision: 302795
URL: https://svnweb.freebsd.org/changeset/base/302795

Log:
  Make the new 'set date and time' dialog default to skip
  
  X-MFC-With:   302790
  Requested by: nwhitehorn

Modified:
  head/usr.sbin/bsdinstall/scripts/time

Modified: head/usr.sbin/bsdinstall/scripts/time
==
--- head/usr.sbin/bsdinstall/scripts/time   Thu Jul 14 00:40:24 2016
(r302794)
+++ head/usr.sbin/bsdinstall/scripts/time   Thu Jul 14 00:41:19 2016
(r302795)
@@ -40,6 +40,7 @@ DATE=$(dialog --backtitle 'FreeBSD Insta
--title 'Time & Date' \
--ok-label 'Set Date' \
--cancel-label 'Skip' \
+   --defaultno \
--date-format '%Y%m%d%H%M.%S' \
--calendar '' 2 40 \
 2>&1 1>&3) && date $DATE
@@ -51,6 +52,7 @@ TIME=$(dialog --backtitle 'FreeBSD Insta
--title 'Time & Date' \
--ok-label 'Set Time' \
--cancel-label 'Skip' \
+   --defaultno \
--time-format '%H%M.%S' \
--timebox '' 2 40 \
 2>&1 1>&3) && date $TIME
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302794 - head/sys/geom/mirror

2016-07-13 Thread Mark Johnston
Author: markj
Date: Thu Jul 14 00:40:24 2016
New Revision: 302794
URL: https://svnweb.freebsd.org/changeset/base/302794

Log:
  Move some gmirror metadata update messages to a higher debug level.
  
  These can be printed quite frequently from a mostly-idle mirror, cluttering
  the console.
  
  MFC after:1 week

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Thu Jul 14 00:38:04 2016
(r302793)
+++ head/sys/geom/mirror/g_mirror.c Thu Jul 14 00:40:24 2016
(r302794)
@@ -829,7 +829,7 @@ g_mirror_idle(struct g_mirror_softc *sc,
LIST_FOREACH(disk, >sc_disks, d_next) {
if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE)
continue;
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as clean.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as clean.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags &= ~G_MIRROR_DISK_FLAG_DIRTY;
g_mirror_update_metadata(disk);
@@ -852,7 +852,7 @@ g_mirror_unidle(struct g_mirror_softc *s
LIST_FOREACH(disk, >sc_disks, d_next) {
if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE)
continue;
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as dirty.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as dirty.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags |= G_MIRROR_DISK_FLAG_DIRTY;
g_mirror_update_metadata(disk);
@@ -1924,12 +1924,12 @@ g_mirror_update_idle(struct g_mirror_sof
if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_NOFAILSYNC) != 0)
return;
if (!sc->sc_idle && (disk->d_flags & G_MIRROR_DISK_FLAG_DIRTY) == 0) {
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as dirty.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as dirty.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags |= G_MIRROR_DISK_FLAG_DIRTY;
} else if (sc->sc_idle &&
(disk->d_flags & G_MIRROR_DISK_FLAG_DIRTY) != 0) {
-   G_MIRROR_DEBUG(1, "Disk %s (device %s) marked as clean.",
+   G_MIRROR_DEBUG(2, "Disk %s (device %s) marked as clean.",
g_mirror_get_diskname(disk), sc->sc_name);
disk->d_flags &= ~G_MIRROR_DISK_FLAG_DIRTY;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302793 - head/sys/x86/acpica

2016-07-13 Thread Mark Johnston
Author: markj
Date: Thu Jul 14 00:38:04 2016
New Revision: 302793
URL: https://svnweb.freebsd.org/changeset/base/302793

Log:
  Allow ACPI wakeup code and page tables to be stored in non-contiguous pages.
  
  Since these pages are allocated from a narrow range of memory, this makes
  the allocation more likely to succeed.
  
  Suggested by: kib
  Reviewed by:  jkim, kib
  MFC after:2 months
  Differential Revision:https://reviews.freebsd.org/D7154

Modified:
  head/sys/x86/acpica/acpi_wakeup.c

Modified: head/sys/x86/acpica/acpi_wakeup.c
==
--- head/sys/x86/acpica/acpi_wakeup.c   Thu Jul 14 00:32:27 2016
(r302792)
+++ head/sys/x86/acpica/acpi_wakeup.c   Thu Jul 14 00:38:04 2016
(r302793)
@@ -88,7 +88,7 @@ static cpuset_t   suspcpus;
 static struct susppcb  **susppcbs;
 #endif
 
-static void*acpi_alloc_wakeup_handler(void);
+static void*acpi_alloc_wakeup_handler(void **);
 static voidacpi_stop_beep(void *);
 
 #ifdef SMP
@@ -97,18 +97,14 @@ static void acpi_wakeup_cpus(struct acp
 #endif
 
 #ifdef __amd64__
-#define ACPI_PAGETABLES3
+#defineACPI_WAKEPAGES  4
 #else
-#define ACPI_PAGETABLES0
+#defineACPI_WAKEPAGES  1
 #endif
 
-#defineWAKECODE_VADDR(sc)  \
-((sc)->acpi_wakeaddr + (ACPI_PAGETABLES * PAGE_SIZE))
-#defineWAKECODE_PADDR(sc)  \
-((sc)->acpi_wakephys + (ACPI_PAGETABLES * PAGE_SIZE))
 #defineWAKECODE_FIXUP(offset, type, val)   do {\
type*addr;  \
-   addr = (type *)(WAKECODE_VADDR(sc) + offset);   \
+   addr = (type *)(sc->acpi_wakeaddr + (offset));  \
*addr = val;\
 } while (0)
 
@@ -125,7 +121,7 @@ static int
 acpi_wakeup_ap(struct acpi_softc *sc, int cpu)
 {
struct pcb *pcb;
-   int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff;
+   int vector = (sc->acpi_wakephys >> 12) & 0xff;
int apic_id = cpu_apic_ids[cpu];
int ms;
 
@@ -168,7 +164,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc)
 
/* setup a vector to our boot code */
*((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET;
-   *((volatile u_short *)WARMBOOT_SEG) = WAKECODE_PADDR(sc) >> 4;
+   *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4;
outb(CMOS_REG, BIOS_RESET);
outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */
 
@@ -209,7 +205,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
if (acpi_resume_beep != 0)
timer_spkr_acquire();
 
-   AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc), 0);
+   AcpiSetFirmwareWakingVector(sc->acpi_wakephys, 0);
 
intr_suspend();
 
@@ -309,11 +305,12 @@ acpi_wakeup_machdep(struct acpi_softc *s
 }
 
 static void *
-acpi_alloc_wakeup_handler(void)
+acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES])
 {
-   void*wakeaddr;
int i;
 
+   memset(wakepages, 0, ACPI_WAKEPAGES * sizeof(*wakepages));
+
/*
 * Specify the region for our wakeup code.  We want it in the low 1 MB
 * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA
@@ -321,18 +318,18 @@ acpi_alloc_wakeup_handler(void)
 * and ROM area (0xa and above).  The temporary page tables must be
 * page-aligned.
 */
-   wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF,
-   M_NOWAIT, 0x500, 0xa, PAGE_SIZE, 0ul);
-   if (wakeaddr == NULL) {
-   printf("%s: can't alloc wake memory\n", __func__);
-   return (NULL);
+   for (i = 0; i < ACPI_WAKEPAGES; i++) {
+   wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT,
+   0x500, 0xa, PAGE_SIZE, 0ul);
+   if (wakepages[i] == NULL) {
+   printf("%s: can't alloc wake memory\n", __func__);
+   goto freepages;
+   }
}
if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL,
EVENTHANDLER_PRI_LAST) == NULL) {
printf("%s: can't register event handler\n", __func__);
-   contigfree(wakeaddr, (ACPI_PAGETABLES + 1) * PAGE_SIZE,
-   M_DEVBUF);
-   return (NULL);
+   goto freepages;
}
susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK);
for (i = 0; i < mp_ncpus; i++) {
@@ -340,39 +337,56 @@ acpi_alloc_wakeup_handler(void)
susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK);
}
 
-   return (wakeaddr);
+   return (wakepages);
+
+freepages:
+   for (i = 0; i < ACPI_WAKEPAGES; i++)
+   if (wakepages[i] != NULL)
+   

svn commit: r302792 - head/usr.bin/gcore

2016-07-13 Thread Mark Johnston
Author: markj
Date: Thu Jul 14 00:32:27 2016
New Revision: 302792
URL: https://svnweb.freebsd.org/changeset/base/302792

Log:
  Remove gcore's -s option.
  
  It has no effect and is always implicitly set since ptrace(2) stops the
  target process.

Modified:
  head/usr.bin/gcore/extern.h
  head/usr.bin/gcore/gcore.1
  head/usr.bin/gcore/gcore.c

Modified: head/usr.bin/gcore/extern.h
==
--- head/usr.bin/gcore/extern.h Thu Jul 14 00:26:57 2016(r302791)
+++ head/usr.bin/gcore/extern.h Thu Jul 14 00:32:27 2016(r302792)
@@ -31,7 +31,6 @@
  */
 
 #definePFLAGS_FULL 0x01
-#definePFLAGS_RESUME   0x02
 
 struct dumpers {
int (*ident)(int efd, pid_t pid, char *binfile);

Modified: head/usr.bin/gcore/gcore.1
==
--- head/usr.bin/gcore/gcore.1  Thu Jul 14 00:26:57 2016(r302791)
+++ head/usr.bin/gcore/gcore.1  Thu Jul 14 00:32:27 2016(r302792)
@@ -28,7 +28,7 @@
 .\"@(#)gcore.1 8.2 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 14, 2010
+.Dd July 13, 2016
 .Dt GCORE 1
 .Os
 .Sh NAME
@@ -37,7 +37,6 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f
-.Op Fl s
 .Op Fl c Ar core
 .Op Ar executable
 .Ar pid
@@ -66,15 +65,6 @@ behavior.
 As a result, this flag should only be used when the behavior of the
 application and any devices it has mapped is fully understood and any side
 effects can be controlled or tolerated.
-.It Fl s
-Stop the process while gathering the core image, and resume it
-when done.
-This guarantees that the resulting core dump will
-be in a consistent state.
-The process is resumed even if it was
-already stopped.
-The same effect can be achieved manually with
-.Xr kill 1 .
 .El
 .Sh FILES
 .Bl -tag -width /var/log/messages -compact

Modified: head/usr.bin/gcore/gcore.c
==
--- head/usr.bin/gcore/gcore.c  Thu Jul 14 00:26:57 2016(r302791)
+++ head/usr.bin/gcore/gcore.c  Thu Jul 14 00:32:27 2016(r302792)
@@ -87,7 +87,7 @@ main(int argc, char *argv[])
 
pflags = 0;
corefile = NULL;
-while ((ch = getopt(argc, argv, "c:fs")) != -1) {
+while ((ch = getopt(argc, argv, "c:f")) != -1) {
 switch (ch) {
 case 'c':
corefile = optarg;
@@ -95,9 +95,6 @@ main(int argc, char *argv[])
case 'f':
pflags |= PFLAGS_FULL;
break;
-   case 's':
-   pflags |= PFLAGS_RESUME;
-   break;
default:
usage();
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302791 - stable/10/sys/dev/ahci

2016-07-13 Thread Alexander Motin
Author: mav
Date: Thu Jul 14 00:26:57 2016
New Revision: 302791
URL: https://svnweb.freebsd.org/changeset/base/302791

Log:
  MFC r302402: Fix ahci(4) driver attach to controller with 32 ports.
  
  Incorrect sign expansion in variables that supposed to be a bit fields
  caused infinite loop.  Fixing this allows system properly detect maximal
  possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
  happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

Modified:
  stable/10/sys/dev/ahci/ahci.c
  stable/10/sys/dev/ahci/ahci.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ahci/ahci.c
==
--- stable/10/sys/dev/ahci/ahci.c   Wed Jul 13 23:49:45 2016
(r302790)
+++ stable/10/sys/dev/ahci/ahci.c   Thu Jul 14 00:26:57 2016
(r302791)
@@ -154,8 +154,8 @@ int
 ahci_attach(device_t dev)
 {
struct ahci_controller *ctlr = device_get_softc(dev);
-   int error, i, u, speed, unit;
-   u_int32_t version;
+   int error, i, speed, unit;
+   uint32_t u, version;
device_t child;
 
ctlr->dev = dev;

Modified: stable/10/sys/dev/ahci/ahci.h
==
--- stable/10/sys/dev/ahci/ahci.h   Wed Jul 13 23:49:45 2016
(r302790)
+++ stable/10/sys/dev/ahci/ahci.h   Thu Jul 14 00:26:57 2016
(r302791)
@@ -472,7 +472,7 @@ struct ahci_enclosure {
uint8_t status[AHCI_MAX_PORTS][4]; /* ArrayDev statuses 
*/
int quirks;
int channels;
-   int ichannels;
+   uint32_tichannels;
 };
 
 /* structure describing a AHCI controller */
@@ -503,7 +503,7 @@ struct ahci_controller {
int quirks;
int numirqs;
int channels;
-   int ichannels;
+   uint32_tichannels;
int ccc;/* CCC timeout */
int cccv;   /* CCC vector */
int direct; /* Direct command completion */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302790 - head/usr.sbin/bsdinstall/scripts

2016-07-13 Thread Nathan Whitehorn
Can you please make this dialog default to "skip" for people with 
systems where the time is set correctly? I realize "OK" is usually a 
no-op, so the "just press enter" is maintained, but "skip" is even more 
of a no-op.

-Nathan

On 07/13/16 16:49, Allan Jude wrote:

Author: allanjude
Date: Wed Jul 13 23:49:45 2016
New Revision: 302790
URL: https://svnweb.freebsd.org/changeset/base/302790

Log:
   bsdinstall: Prompt user to set the date and time after selecting timezone
   
   Not having the correct date and time makes many PKI based things not work
   
   In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start
   
   Submitted by:	des (original patch)

   MFC after:   7 days

Modified:
   head/usr.sbin/bsdinstall/scripts/time

Modified: head/usr.sbin/bsdinstall/scripts/time
==
--- head/usr.sbin/bsdinstall/scripts/time   Wed Jul 13 23:03:34 2016
(r302789)
+++ head/usr.sbin/bsdinstall/scripts/time   Wed Jul 13 23:49:45 2016
(r302790)
@@ -26,4 +26,40 @@
  #
  # $FreeBSD$
  
+# Select timezone

  chroot $BSDINSTALL_CHROOT tzsetup
+
+# Switch to target timezone
+saved_TZ="$TZ"
+TZ="${BSDINSTALL_CHROOT}/etc/localtime"
+export TZ
+
+# Set date
+exec 3>&1
+DATE=$(dialog --backtitle 'FreeBSD Installer' \
+   --title 'Time & Date' \
+   --ok-label 'Set Date' \
+   --cancel-label 'Skip' \
+   --date-format '%Y%m%d%H%M.%S' \
+   --calendar '' 2 40 \
+2>&1 1>&3) && date $DATE
+exec 3>&-
+
+# Set time
+exec 3>&1
+TIME=$(dialog --backtitle 'FreeBSD Installer' \
+   --title 'Time & Date' \
+   --ok-label 'Set Time' \
+   --cancel-label 'Skip' \
+   --time-format '%H%M.%S' \
+   --timebox '' 2 40 \
+2>&1 1>&3) && date $TIME
+exec 3>&-
+
+# Switch back
+if [ -n "$saved_TZ" ]; then
+   TZ="$saved_TZ"
+else
+   unset TZ
+fi
+unset saved_TZ



___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302779 - head/contrib/ldns-host

2016-07-13 Thread Ngie Cooper
On Wed, Jul 13, 2016 at 11:26 AM, Dag-Erling Smørgrav  wrote:
> Author: des
> Date: Wed Jul 13 18:26:05 2016
> New Revision: 302779
> URL: https://svnweb.freebsd.org/changeset/base/302779
>
> Log:
>   merge upstream hg 06347b1f76fe (fix IXFR)
>
>   PR:   209177
>   MFC after:3 days
>
> Modified:
>   head/contrib/ldns-host/ldns-host.c
> Directory Properties:
>   head/contrib/ldns-host/   (props changed)

This change broke gcc. From
https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64/145 ...

--- all_subdir_usr.bin/host ---
cc1: warnings being treated as errors
/builds/workspace/FreeBSD_HEAD_sparc64/src/usr.bin/host/../../contrib/ldns-host/ldns-host.c:
In function 'dozonetransfer':
/builds/workspace/FreeBSD_HEAD_sparc64/src/usr.bin/host/../../contrib/ldns-host/ldns-host.c:891:
warning: 'first_serial' may be used uninitialized in this function
*** [ldns-host.o] Error code 1

bmake[4]: stopped in /builds/workspace/FreeBSD_HEAD_sparc64/src/usr.bin/host
1 error

bmake[4]: stopped in /builds/workspace/FreeBSD_HEAD_sparc64/src/usr.bin/host
*** [all_subdir_usr.bin/host] Error code 2

Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r302577 - head/sys/dev/drm2

2016-07-13 Thread Ngie Cooper
On Wed, Jul 13, 2016 at 4:54 AM, Robert Watson  wrote:
> On Mon, 11 Jul 2016, Garrett Cooper wrote:
>
>>  Add missing default case to capable(..) function definition
>>
>>  By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
>>  aren't possible. Add in a KASSERT safety belt and return false in
>>  !INVARIANTS case if an invalid value is passed in, as it would be a
>>  programmer error.
>>
>>  This fixes a -Wreturn-type error with gcc 5.3.0.
>>
>>  Differential Revision: https://reviews.freebsd.org/D7188
>>  MFC after: 1 week
>>  Reported by:   devel/amd64-gcc (5.3.0)
>>  Reviewed by:   dumbbell
>>  Sponsored by:  EMC / Isilon Storage Division
>
> Per my comment in the review, I think a panic() here would be preferable to
> a KASSERT(), as it would come without perceptible runtime cost, and failstop
> the system if we were violating a design-time security invariant.

Good point. I'll commit the change tonight.
Thanks!
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302790 - head/usr.sbin/bsdinstall/scripts

2016-07-13 Thread Allan Jude
Author: allanjude
Date: Wed Jul 13 23:49:45 2016
New Revision: 302790
URL: https://svnweb.freebsd.org/changeset/base/302790

Log:
  bsdinstall: Prompt user to set the date and time after selecting timezone
  
  Not having the correct date and time makes many PKI based things not work
  
  In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start
  
  Submitted by: des (original patch)
  MFC after:7 days

Modified:
  head/usr.sbin/bsdinstall/scripts/time

Modified: head/usr.sbin/bsdinstall/scripts/time
==
--- head/usr.sbin/bsdinstall/scripts/time   Wed Jul 13 23:03:34 2016
(r302789)
+++ head/usr.sbin/bsdinstall/scripts/time   Wed Jul 13 23:49:45 2016
(r302790)
@@ -26,4 +26,40 @@
 #
 # $FreeBSD$
 
+# Select timezone
 chroot $BSDINSTALL_CHROOT tzsetup
+
+# Switch to target timezone
+saved_TZ="$TZ"
+TZ="${BSDINSTALL_CHROOT}/etc/localtime"
+export TZ
+
+# Set date
+exec 3>&1
+DATE=$(dialog --backtitle 'FreeBSD Installer' \
+   --title 'Time & Date' \
+   --ok-label 'Set Date' \
+   --cancel-label 'Skip' \
+   --date-format '%Y%m%d%H%M.%S' \
+   --calendar '' 2 40 \
+2>&1 1>&3) && date $DATE
+exec 3>&-
+
+# Set time
+exec 3>&1
+TIME=$(dialog --backtitle 'FreeBSD Installer' \
+   --title 'Time & Date' \
+   --ok-label 'Set Time' \
+   --cancel-label 'Skip' \
+   --time-format '%H%M.%S' \
+   --timebox '' 2 40 \
+2>&1 1>&3) && date $TIME
+exec 3>&-
+
+# Switch back
+if [ -n "$saved_TZ" ]; then
+   TZ="$saved_TZ"
+else
+   unset TZ
+fi
+unset saved_TZ
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302789 - in head/sys/arm64: arm64 include

2016-07-13 Thread Andrew Turner
Author: andrew
Date: Wed Jul 13 23:03:34 2016
New Revision: 302789
URL: https://svnweb.freebsd.org/changeset/base/302789

Log:
  Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/mem.c
  head/sys/arm64/include/memdev.h

Modified: head/sys/arm64/arm64/mem.c
==
--- head/sys/arm64/arm64/mem.c  Wed Jul 13 22:53:30 2016(r302788)
+++ head/sys/arm64/arm64/mem.c  Wed Jul 13 23:03:34 2016(r302789)
@@ -114,3 +114,19 @@ memrw(struct cdev *dev, struct uio *uio,
return (error);
 }
 
+/*
+ * allow user processes to MMAP some memory sections
+ * instead of going through read/write
+ */
+/* ARGSUSED */
+int
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+int prot __unused, vm_memattr_t *memattr __unused)
+{
+   if (dev2unit(dev) == CDEV_MINOR_MEM)
+   *paddr = offset;
+   else if (dev2unit(dev) == CDEV_MINOR_KMEM)
+   *paddr = vtophys(offset);
+   /* else panic! */
+   return (0);
+}

Modified: head/sys/arm64/include/memdev.h
==
--- head/sys/arm64/include/memdev.h Wed Jul 13 22:53:30 2016
(r302788)
+++ head/sys/arm64/include/memdev.h Wed Jul 13 23:03:34 2016
(r302789)
@@ -35,6 +35,6 @@
 d_open_t   memopen;
 d_read_t   memrw;
 #definememioctl(d_ioctl_t *)NULL
-#definememmmap (d_mmap_t *)NULL
+d_mmap_t   memmmap;
 
 #endif /* _MACHINE_MEMDEV_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302788 - head/usr.sbin/acpi/acpidump

2016-07-13 Thread Andrew Turner
Author: andrew
Date: Wed Jul 13 22:53:30 2016
New Revision: 302788
URL: https://svnweb.freebsd.org/changeset/base/302788

Log:
  Fix the type used to hold the value returned from getopt. On arm64 char is
  unsigned so will never be -1.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/acpi/acpidump/acpidump.c

Modified: head/usr.sbin/acpi/acpidump/acpidump.c
==
--- head/usr.sbin/acpi/acpidump/acpidump.c  Wed Jul 13 21:27:10 2016
(r302787)
+++ head/usr.sbin/acpi/acpidump/acpidump.c  Wed Jul 13 22:53:30 2016
(r302788)
@@ -55,7 +55,8 @@ int
 main(int argc, char *argv[])
 {
ACPI_TABLE_HEADER *rsdt, *sdt;
-   charc, *progname;
+   int c;
+   char*progname;
char*dsdt_input_file, *dsdt_output_file;
 
dsdt_input_file = dsdt_output_file = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302787 - head/cddl/contrib/opensolaris/cmd/zpool

2016-07-13 Thread Ngie Cooper
On Wed, Jul 13, 2016 at 2:27 PM, Eric van Gyzen  wrote:
> Author: vangyzen
> Date: Wed Jul 13 21:27:10 2016
> New Revision: 302787
> URL: https://svnweb.freebsd.org/changeset/base/302787
>
> Log:
>   zpool(8): update Hot Spares section to mention zfsd(8)

I know it's childish, but it reminds me of these meme :)...
http://i.imgur.com/MAJ2Y5p.jpg .
Cheers :D,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302787 - head/cddl/contrib/opensolaris/cmd/zpool

2016-07-13 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul 13 21:27:10 2016
New Revision: 302787
URL: https://svnweb.freebsd.org/changeset/base/302787

Log:
  zpool(8): update Hot Spares section to mention zfsd(8)
  
  Reviewed and reworded by: asomers
  MFC after:3 days
  Sponsored by: Dell Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jul 13 20:46:54 
2016(r302786)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jul 13 21:27:10 
2016(r302787)
@@ -465,6 +465,15 @@ place in the configuration, and is remov
 pools.
 .Pp
 Spares cannot replace log devices.
+.Pp
+This feature requires a userland helper.
+FreeBSD provides
+.Xr zfsd 8
+for this purpose.
+It must be manually enabled by adding
+.Va zfsd_enable="YES"
+to
+.Pa /etc/rc.conf .
 .Ss Intent Log
 The
 .Tn ZFS
@@ -2023,7 +2032,8 @@ Discarded approximately 29 seconds of tr
 .El
 .Sh SEE ALSO
 .Xr zpool-features 7 ,
-.Xr zfs 8
+.Xr zfs 8 ,
+.Xr zfsd 8
 .Sh AUTHORS
 This manual page is a
 .Xr mdoc 7
@@ -2040,9 +2050,3 @@ The
 .Xr mdoc 7
 implementation of this manual page was initially written by
 .An Martin Matuska Aq m...@freebsd.org .
-.Sh CAVEATS
-The
-.Cm spare
-feature requires a utility to detect zpool degradation and initiate
-disk replacement within the zpool.
-FreeBSD does not provide such a utility at this time.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302786 - head/sys/arm/allwinner

2016-07-13 Thread Jared McNeill
Author: jmcneill
Date: Wed Jul 13 20:46:54 2016
New Revision: 302786
URL: https://svnweb.freebsd.org/changeset/base/302786

Log:
  Allwinner Gigabit EMAC performance improvements.
  
   - Support DEVICE_POLLING
   - Increase TX descriptors to 1024
   - Add support for passing a chain of mbufs to if_input, reducing the
 number of calls to mtx_unlock/mtx_lock under load.
   - Remove duplicate byteswap when setting TX_INT_CTL in TX descriptor.
   - Set undocumented "TX_NEXT_FRAME" bit in TX control 1 register.
 According to the A83T BSP, setting this bit allows the DMA engine to
 operate on a packet while receiving another.
  
  Tested on A83T (1000Mbps PHY) and H3 (100Mbps PHY).
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D7031

Modified:
  head/sys/arm/allwinner/if_awg.c
  head/sys/arm/allwinner/if_awgreg.h

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Wed Jul 13 20:44:02 2016
(r302785)
+++ head/sys/arm/allwinner/if_awg.c Wed Jul 13 20:46:54 2016
(r302786)
@@ -30,6 +30,8 @@
  * Allwinner Gigabit Ethernet MAC (EMAC) controller
  */
 
+#include "opt_device_polling.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -77,7 +79,7 @@ __FBSDID("$FreeBSD$");
 #defineAWG_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED)
 
 #defineDESC_ALIGN  4
-#defineTX_DESC_COUNT   256
+#defineTX_DESC_COUNT   1024
 #defineTX_DESC_SIZE(sizeof(struct emac_desc) * 
TX_DESC_COUNT)
 #defineRX_DESC_COUNT   256
 #defineRX_DESC_SIZE(sizeof(struct emac_desc) * 
RX_DESC_COUNT)
@@ -97,6 +99,7 @@ __FBSDID("$FreeBSD$");
 #defineRX_TX_PRI_DEFAULT   0
 #definePAUSE_TIME_DEFAULT  0x400
 #defineTX_INTERVAL_DEFAULT 64
+#defineRX_BATCH_DEFAULT64
 
 /* Burst length of RX and TX DMA transfers */
 static int awg_burst_len = BURST_LEN_DEFAULT;
@@ -114,6 +117,10 @@ TUNABLE_INT("hw.awg.pause_time", _pa
 static int awg_tx_interval = TX_INTERVAL_DEFAULT;
 TUNABLE_INT("hw.awg.tx_interval", _tx_interval);
 
+/* Maximum number of mbufs to send to if_input */
+static int awg_rx_batch = RX_BATCH_DEFAULT;
+TUNABLE_INT("hw.awg.rx_batch", _rx_batch);
+
 static struct ofw_compat_data compat_data[] = {
{ "allwinner,sun8i-a83t-emac",  1 },
{ NULL, 0 }
@@ -353,7 +360,7 @@ awg_setup_txdesc(struct awg_softc *sc, i
status = TX_DESC_CTL;
size = flags | len;
if ((index & (awg_tx_interval - 1)) == 0)
-   size |= htole32(TX_INT_CTL);
+   size |= TX_INT_CTL;
++sc->tx.queued;
}
 
@@ -617,6 +624,20 @@ awg_setup_rxfilter(struct awg_softc *sc)
 }
 
 static void
+awg_enable_intr(struct awg_softc *sc)
+{
+   /* Enable interrupts */
+   WR4(sc, EMAC_INT_EN, RX_INT_EN | TX_INT_EN | TX_BUF_UA_INT_EN);
+}
+
+static void
+awg_disable_intr(struct awg_softc *sc)
+{
+   /* Disable interrupts */
+   WR4(sc, EMAC_INT_EN, 0);
+}
+
+static void
 awg_init_locked(struct awg_softc *sc)
 {
struct mii_data *mii;
@@ -640,11 +661,18 @@ awg_init_locked(struct awg_softc *sc)
WR4(sc, EMAC_BASIC_CTL_1, val);
 
/* Enable interrupts */
-   WR4(sc, EMAC_INT_EN, RX_INT_EN | TX_INT_EN | TX_BUF_UA_INT_EN);
+#ifdef DEVICE_POLLING
+   if ((if_getcapenable(ifp) & IFCAP_POLLING) == 0)
+   awg_enable_intr(sc);
+   else
+   awg_disable_intr(sc);
+#else
+   awg_enable_intr(sc);
+#endif
 
/* Enable transmit DMA */
val = RD4(sc, EMAC_TX_CTL_1);
-   WR4(sc, EMAC_TX_CTL_1, val | TX_DMA_EN | TX_MD);
+   WR4(sc, EMAC_TX_CTL_1, val | TX_DMA_EN | TX_MD | TX_NEXT_FRAME);
 
/* Enable receive DMA */
val = RD4(sc, EMAC_RX_CTL_1);
@@ -703,7 +731,7 @@ awg_stop(struct awg_softc *sc)
WR4(sc, EMAC_RX_CTL_0, val & ~RX_EN);
 
/* Disable interrupts */
-   WR4(sc, EMAC_INT_EN, 0);
+   awg_disable_intr(sc);
 
/* Disable transmit DMA */
val = RD4(sc, EMAC_TX_CTL_1);
@@ -718,15 +746,18 @@ awg_stop(struct awg_softc *sc)
if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
 }
 
-static void
+static int
 awg_rxintr(struct awg_softc *sc)
 {
if_t ifp;
-   struct mbuf *m, *m0;
-   int error, index, len;
+   struct mbuf *m, *m0, *mh, *mt;
+   int error, index, len, cnt, npkt;
uint32_t status;
 
ifp = sc->ifp;
+   mh = mt = NULL;
+   cnt = 0;
+   npkt = 0;
 
bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -760,9 +791,23 @@ awg_rxintr(struct awg_softc *sc)
}
}
 
-

svn commit: r302785 - head/sys/arm/allwinner/clk

2016-07-13 Thread Jared McNeill
Author: jmcneill
Date: Wed Jul 13 20:44:02 2016
New Revision: 302785
URL: https://svnweb.freebsd.org/changeset/base/302785

Log:
  H3/A83T: Use PLL_PERIPH/2 for AHB2 parent clock.
  
  Reviewed by:  manu

Modified:
  head/sys/arm/allwinner/clk/aw_ahbclk.c

Modified: head/sys/arm/allwinner/clk/aw_ahbclk.c
==
--- head/sys/arm/allwinner/clk/aw_ahbclk.c  Wed Jul 13 19:41:19 2016
(r302784)
+++ head/sys/arm/allwinner/clk/aw_ahbclk.c  Wed Jul 13 20:44:02 2016
(r302785)
@@ -140,10 +140,14 @@ aw_ahbclk_init(struct clknode *clk, devi
A83T_AHB1_CLK_SRC_SEL_SHIFT;
break;
case AW_H3_AHB2:
+   /* Set source to PLL_PERIPH/2 */
+   index = H3_AHB2_CLK_CFG_PLL_PERIPH_DIV2;
DEVICE_LOCK(sc);
AHBCLK_READ(sc, );
+   val &= ~H3_AHB2_CLK_CFG;
+   val |= (index << H3_AHB2_CLK_CFG_SHIFT);
+   AHBCLK_WRITE(sc, val);
DEVICE_UNLOCK(sc);
-   index = (val & H3_AHB2_CLK_CFG) >> H3_AHB2_CLK_CFG_SHIFT;
break;
default:
return (ENXIO);
@@ -189,12 +193,7 @@ aw_ahbclk_recalc_freq(struct clknode *cl
pre_div = 1;
break;
case AW_H3_AHB2:
-   src_sel = (val & H3_AHB2_CLK_CFG) >> H3_AHB2_CLK_CFG_SHIFT;
-   if (src_sel == H3_AHB2_CLK_CFG_PLL_PERIPH_DIV2)
-   div = 2;
-   else
-   div = 1;
-   pre_div = 1;
+   div = pre_div = 1;
break;
default:
div = 1 << ((val & A10_AHB_CLK_DIV_RATIO) >>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302784 - head/sys/netinet6

2016-07-13 Thread Dimitry Andric
Author: dim
Date: Wed Jul 13 19:41:19 2016
New Revision: 302784
URL: https://svnweb.freebsd.org/changeset/base/302784

Log:
  Fix a page fault in ip6_setpktopt(), occurring when the pflog module is
  loaded, and syncthing is started, which uses setsockopt(IPV6_PKGINFO).
  
  This is because pflog interfaces do not normally have an IPv6 address,
  causing the ND_IFINFO() macro to dereference a NULL pointer.
  
  Reviewed by:  ae
  PR:   210943
  MFC after:3 days

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Wed Jul 13 19:19:18 2016
(r302783)
+++ head/sys/netinet6/ip6_output.c  Wed Jul 13 19:41:19 2016
(r302784)
@@ -2659,8 +2659,8 @@ ip6_setpktopt(int optname, u_char *buf, 
if (ifp == NULL)
return (ENXIO);
}
-   if (ifp != NULL && (
-   ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED))
+   if (ifp != NULL && (ifp->if_afdata[AF_INET6] == NULL ||
+   (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) != 0))
return (ENETDOWN);
 
if (ifp != NULL &&
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302783 - in head/sys: amd64/amd64 i386/i386 kern sys x86/x86

2016-07-13 Thread Eric Badger
Author: badger
Date: Wed Jul 13 19:19:18 2016
New Revision: 302783
URL: https://svnweb.freebsd.org/changeset/base/302783

Log:
  Add explicit detection of KVM hypervisor
  
  Set vm_guest to a new enum value (VM_GUEST_KVM) when kvm is detected and use
  vm_guest in conditionals testing for KVM.
  
  Also, fix a conditional checking if we're running in a VM which caught only
  the generic VM case, but not more specific VMs (KVM, VMWare, etc.).  (Spotted
  by: vangyzen).
  
  Differential revision:https://reviews.freebsd.org/D7172
  Sponsored by: Dell Inc.
  Approved by:  kib (mentor), vangyzen (mentor)
  Reviewed by:  alc
  MFC after:4 weeks

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/kern/subr_param.c
  head/sys/sys/systm.h
  head/sys/x86/x86/identcpu.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Jul 13 19:16:32 2016(r302782)
+++ head/sys/amd64/amd64/pmap.c Wed Jul 13 19:19:18 2016(r302783)
@@ -1224,7 +1224,7 @@ pmap_init(void)
 * include at least one feature that is only supported by older Intel
 * or newer AMD processors.
 */
-   if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 &&
+   if (vm_guest != VM_GUEST_NO && (cpu_feature & CPUID_SS) == 0 &&
(cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI |
CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP |
AMDID2_FMA4)) == 0)

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Wed Jul 13 19:16:32 2016(r302782)
+++ head/sys/i386/i386/pmap.c   Wed Jul 13 19:19:18 2016(r302783)
@@ -794,7 +794,7 @@ pmap_init(void)
 * include at least one feature that is only supported by older Intel
 * or newer AMD processors.
 */
-   if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 &&
+   if (vm_guest != VM_GUEST_NO && (cpu_feature & CPUID_SS) == 0 &&
(cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI |
CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP |
AMDID2_FMA4)) == 0)

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Wed Jul 13 19:16:32 2016(r302782)
+++ head/sys/kern/subr_param.c  Wed Jul 13 19:19:18 2016(r302783)
@@ -148,6 +148,7 @@ static const char *const vm_guest_sysctl
"xen",
"hv",
"vmware",
+   "kvm",
NULL
 };
 CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST);

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hWed Jul 13 19:16:32 2016(r302782)
+++ head/sys/sys/systm.hWed Jul 13 19:19:18 2016(r302783)
@@ -74,7 +74,7 @@ extern int vm_guest;  /* Running as virt
  * Keep in sync with vm_guest_sysctl_names[].
  */
 enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV,
-   VM_GUEST_VMWARE, VM_LAST };
+   VM_GUEST_VMWARE, VM_GUEST_KVM, VM_LAST };
 
 #if defined(WITNESS) || defined(INVARIANT_SUPPORT)
 void   kassert_panic(const char *fmt, ...)  __printflike(1, 2);

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Wed Jul 13 19:16:32 2016(r302782)
+++ head/sys/x86/x86/identcpu.c Wed Jul 13 19:19:18 2016(r302783)
@@ -1300,6 +1300,8 @@ identify_hypervisor(void)
vm_guest = VM_GUEST_VMWARE;
else if (strcmp(hv_vendor, "Microsoft Hv") == 0)
vm_guest = VM_GUEST_HV;
+   else if (strcmp(hv_vendor, "KVMKVMKVM") == 0)
+   vm_guest = VM_GUEST_KVM;
}
return;
}

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Wed Jul 13 19:16:32 2016
(r302782)
+++ head/sys/x86/x86/local_apic.c   Wed Jul 13 19:19:18 2016
(r302783)
@@ -499,8 +499,7 @@ native_lapic_init(vm_paddr_t addr)
ver = lapic_read32(LAPIC_VERSION);
if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) {
lapic_eoi_suppression = 1;
-   if (vm_guest == VM_GUEST_VM &&
-   !strcmp(hv_vendor, "KVMKVMKVM")) {
+   if (vm_guest == VM_GUEST_KVM) {
if (bootverbose)
printf(
   "KVM -- disabling lapic eoi suppression\n");

svn commit: r302782 - in head/sys: dev/acpica i386/isa

2016-07-13 Thread Jung-uk Kim
Author: jkim
Date: Wed Jul 13 19:16:32 2016
New Revision: 302782
URL: https://svnweb.freebsd.org/changeset/base/302782

Log:
  Remove a tunable and always reset system clock while resuming with ACPI.
  
  Requested by: bde (long ago)

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/i386/isa/pmtimer.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed Jul 13 19:02:59 2016(r302781)
+++ head/sys/dev/acpica/acpi.c  Wed Jul 13 19:16:32 2016(r302782)
@@ -280,14 +280,6 @@ TUNABLE_INT("debug.acpi.default_register
 SYSCTL_INT(_debug_acpi, OID_AUTO, default_register_width, CTLFLAG_RDTUN,
 _ignore_reg_width, 1, "Ignore register widths set by FADT");
 
-#ifdef __amd64__
-/* Reset system clock while resuming.  XXX Remove once tested. */
-static int acpi_reset_clock = 1;
-TUNABLE_INT("debug.acpi.reset_clock", _reset_clock);
-SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
-_reset_clock, 1, "Reset system clock while resuming.");
-#endif
-
 /* Allow users to override quirks. */
 TUNABLE_INT("debug.acpi.quirks", _quirks);
 
@@ -3027,9 +3019,6 @@ backout:
 static void
 acpi_resync_clock(struct acpi_softc *sc)
 {
-#ifdef __amd64__
-if (!acpi_reset_clock)
-   return;
 
 /*
  * Warm up timecounter again and reset system clock.
@@ -3037,7 +3026,6 @@ acpi_resync_clock(struct acpi_softc *sc)
 (void)timecounter->tc_get_timecount(timecounter);
 (void)timecounter->tc_get_timecount(timecounter);
 inittodr(time_second + sc->acpi_sleep_delay);
-#endif
 }
 
 /* Enable or disable the device's wake GPE. */

Modified: head/sys/i386/isa/pmtimer.c
==
--- head/sys/i386/isa/pmtimer.c Wed Jul 13 19:02:59 2016(r302781)
+++ head/sys/i386/isa/pmtimer.c Wed Jul 13 19:16:32 2016(r302782)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -83,6 +84,9 @@ static int
 pmtimer_suspend(device_t dev)
 {
 
+   if (power_pm_get_type() == POWER_PM_TYPE_ACPI)
+   return (0);
+
microtime(_time);
inittodr(0);
microtime(_time);
@@ -96,6 +100,9 @@ pmtimer_resume(device_t dev)
u_int second, minute, hour;
struct timeval resume_time, tmp_time;
 
+   if (power_pm_get_type() == POWER_PM_TYPE_ACPI)
+   return (0);
+
/* modified for adjkerntz */
timer_restore();/* restore the all timers */
inittodr(0);/* adjust time to RTC */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302781 - head/gnu/usr.bin/grep

2016-07-13 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 13 19:02:59 2016
New Revision: 302781
URL: https://svnweb.freebsd.org/changeset/base/302781

Log:
  After removing collation for [a-z] ranges in r302512, do it here too.
  
  Instead of trying to expand whole range at regcomp() stage as we do,
  GNU regex allocates separate ranges [start,end] set each character
  is checked against, so collation is possible and turned on for ranges here.
  
  When something like that will be implemented or our obsoleted regex code
  will be replaced to something like TRE, and in case we decide to use
  collation in [a-z] ranges, all changes related to r302512 can be backed out,
  but now we need consistency.

Modified:
  head/gnu/usr.bin/grep/dfa.c

Modified: head/gnu/usr.bin/grep/dfa.c
==
--- head/gnu/usr.bin/grep/dfa.c Wed Jul 13 18:51:19 2016(r302780)
+++ head/gnu/usr.bin/grep/dfa.c Wed Jul 13 19:02:59 2016(r302781)
@@ -2547,8 +2547,13 @@ match_mb_charset (struct dfa *d, int s, 
   wcbuf[2] = work_mbc->range_sts[i];
   wcbuf[4] = work_mbc->range_ends[i];
 
+#ifdef __FreeBSD__
+  if (wcscmp(wcbuf, wcbuf+2) >= 0 &&
+ wcscmp(wcbuf+4, wcbuf) >= 0)
+#else
   if (wcscoll(wcbuf, wcbuf+2) >= 0 &&
  wcscoll(wcbuf+4, wcbuf) >= 0)
+#endif
goto charset_matched;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302780 - head/contrib/libgnuregex

2016-07-13 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 13 18:51:19 2016
New Revision: 302780
URL: https://svnweb.freebsd.org/changeset/base/302780

Log:
  After removing collation for [a-z] ranges in r302512, do it here too.
  
  Instead of trying to expand whole range at regcomp() stage as we do,
  GNU regex allocates separate ranges [start,end] set each character
  is checked against, so collation is possible and turned on for ranges here.
  
  When something like that will be implemented or our obsoleted regex code
  will be replaced to something like TRE, and in case we decide to use
  collation in [a-z] ranges, all changes related to r302512 can be backed out,
  but now we need consistency.

Modified:
  head/contrib/libgnuregex/regcomp.c
  head/contrib/libgnuregex/regexec.c

Modified: head/contrib/libgnuregex/regcomp.c
==
--- head/contrib/libgnuregex/regcomp.c  Wed Jul 13 18:26:05 2016
(r302779)
+++ head/contrib/libgnuregex/regcomp.c  Wed Jul 13 18:51:19 2016
(r302780)
@@ -2664,7 +2664,11 @@ build_range_exp (bitset_t sbcset, bracke
   return REG_ECOLLATE;
 cmp_buf[0] = start_wc;
 cmp_buf[4] = end_wc;
+#ifdef __FreeBSD__
+if (wcscmp (cmp_buf, cmp_buf + 4) > 0)
+#else
 if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
+#endif
   return REG_ERANGE;
 
 /* Got valid collation sequence values, add them as a new entry.
@@ -2706,8 +2710,13 @@ build_range_exp (bitset_t sbcset, bracke
 for (wc = 0; wc < SBC_MAX; ++wc)
   {
cmp_buf[2] = wc;
+#ifdef __FreeBSD__
+   if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
+   && wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
+#else
if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
&& wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
+#endif
  bitset_set (sbcset, wc);
   }
   }

Modified: head/contrib/libgnuregex/regexec.c
==
--- head/contrib/libgnuregex/regexec.c  Wed Jul 13 18:26:05 2016
(r302779)
+++ head/contrib/libgnuregex/regexec.c  Wed Jul 13 18:51:19 2016
(r302780)
@@ -3964,8 +3964,13 @@ check_node_accept_bytes (const re_dfa_t 
{
  cmp_buf[0] = cset->range_starts[i];
  cmp_buf[4] = cset->range_ends[i];
+#ifdef __FreeBSD__
+ if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
+ && wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
+#else
  if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
  && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
+#endif
{
  match_len = char_len;
  goto check_node_accept_bytes_match;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271300 - in head/sys: net netinet

2016-07-13 Thread Adrian Chadd
ugh, hm. Wonder how I missed that. I'll go see about fixing it.


-adrian


On 13 July 2016 at 09:18, Andrey V. Elsukov  wrote:
> On 09.09.14 08:18, Adrian Chadd wrote:
>> Author: adrian
>> Date: Tue Sep  9 04:18:20 2014
>> New Revision: 271300
>> URL: http://svnweb.freebsd.org/changeset/base/271300
>>
>> Log:
>>   Update the IPv4 input path to handle reassembled frames and incoming frames
>>   with no RSS hash.
>>
>>   When doing RSS:
>>
>>   * Create a new IPv4 netisr which expects the frames to have been verified;
>> it just directly dispatches to the IPv4 input path.
>>   * Once IPv4 reassembly is done, re-calculate the RSS hash with the new
>> IP and L3 header; then reinject it as appropriate.
>>   * Update the IPv4 netisr to be a CPU affinity netisr with the RSS hash
>> function (rss_soft_m2cpuid) - this will do a software hash if the
>> hardware doesn't provide one.
>>
>>   NICs that don't implement hardware RSS hashing will now benefit from RSS
>>   distribution - it'll inject into the correct destination netisr.
>>
>>   Note: the netisr distribution doesn't work out of the box - netisr doesn't
>>   query RSS for how many CPUs and the affinity setup.  Yes, netisr likely
>>   shouldn't really be doing CPU stuff anymore and should be "some kind of
>>   'thing' that is a workqueue that may or may not have any CPU affinity";
>>   that's for a later commit.
>>
>>   Differential Revision:  https://reviews.freebsd.org/D527
>>   Reviewed by:grehan
>>
>> Modified:
>>   head/sys/net/netisr.h
>>   head/sys/netinet/in_var.h
>>   head/sys/netinet/ip_input.c
>>
>> Modified: head/sys/netinet/ip_input.c
>
> Hi, I am sorry for addressing this old message, but it looks like you
> can not use the same IPCTL_XXX constant for several different oids.
>
> ...
>> @@ -266,6 +292,46 @@ SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQDRO
>   - there
>>  CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_netinet_intr_queue_drops, "I",
>>  "Number of packets dropped from the IP input queue");
>>
>> +SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_direct_queue_maxlen,
>  ^^^ - and there.
>> +CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_direct_queue_maxlen, 
>> "I",
>> +"Maximum size of the IP direct input queue");
>
> User applications use these constants to address specific oids and I
> don't think and don't see that the kernel calls several handlers for one
> oid.
>
> --
> WBR, Andrey V. Elsukov
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302779 - head/contrib/ldns-host

2016-07-13 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Jul 13 18:26:05 2016
New Revision: 302779
URL: https://svnweb.freebsd.org/changeset/base/302779

Log:
  merge upstream hg 06347b1f76fe (fix IXFR)
  
  PR:   209177
  MFC after:3 days

Modified:
  head/contrib/ldns-host/ldns-host.c
Directory Properties:
  head/contrib/ldns-host/   (props changed)

Modified: head/contrib/ldns-host/ldns-host.c
==
--- head/contrib/ldns-host/ldns-host.c  Wed Jul 13 17:09:20 2016
(r302778)
+++ head/contrib/ldns-host/ldns-host.c  Wed Jul 13 18:26:05 2016
(r302779)
@@ -156,6 +156,19 @@ memerr:
 return LDNS_STATUS_MEM_ERR;
 }
 
+static uint32_t
+ldns_rr_soa_get_serial(const ldns_rr *rr)
+{
+const ldns_rdf *rdf;
+  
+if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) return 0;
+if (ldns_rr_rd_count(rr) != 7) return 0;
+rdf = ldns_rr_rdf(rr, 2);
+if (ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_INT32) return 0;
+if (ldns_rdf_size(rdf) != 4) return 0;
+return ldns_rdf2native_int32(rdf);
+}
+
 static ldns_status
 ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) {
 /* This routine is based on ldns_axfr_start, with the major
@@ -873,18 +886,16 @@ dozonetransfer(ldns_resolver *res, ldns_
 ldns_rdf *dname;
 ldns_rr_type rrtype;
 ldns_rr_list *rrl;
-int i, nsoa = 0;
+ldns_rr *rr;
+size_t i, nsoa = 0;
+uint32_t first_serial;
 
 rrtype = o_rrtype;
 o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR;
 dname = search(res, domain, , absolute, false);
 
 for (;;) {
-rrl = ldns_pkt_answer(pkt);
-for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) {
-if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA)
-nsoa++;
-}
+rrl = ldns_rr_list_clone(ldns_pkt_answer(pkt));
 ldns_pkt_filter_answer(pkt, rrtype);
 report(res, dname != NULL ? dname : domain, pkt);
 if ((dname == NULL) ||
@@ -893,9 +904,29 @@ dozonetransfer(ldns_resolver *res, ldns_
 ldns_tcp_close(res);
 return false;
 }
-if (nsoa >= 2) {
-ldns_tcp_close(res);
-return true;
+for (i = 0; i < ldns_rr_list_rr_count(rrl); i++) {
+rr = ldns_rr_list_rr(rrl, i);
+if (nsoa == 0) {
+if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) {
+printf("; Transfer failed. "
+   "Didn't start with SOA answer.\n");
+ldns_tcp_close(res);
+return false;
+}
+first_serial = ldns_rr_soa_get_serial(rr);
+if ((o_mode == M_IXFR) && (first_serial <= o_ixfr_serial)) {
+ldns_tcp_close(res);
+return true;
+}
+}
+if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
+nsoa = nsoa < 2 ? nsoa + 1 : 1;
+if ((nsoa == 2) &&
+(ldns_rr_soa_get_serial(rr) == first_serial)) {
+ldns_tcp_close(res);
+return true;
+}
+}
 }
 if (ldns_tcp_read(, res) != LDNS_STATUS_OK) {
 printf("; Transfer failed.\n");
@@ -904,6 +935,7 @@ dozonetransfer(ldns_resolver *res, ldns_
 ldns_pkt_set_answerfrom(nextpkt,
 ldns_rdf_clone(ldns_pkt_answerfrom(pkt)));
 ldns_pkt_free(pkt);
+ldns_rr_list_free(rrl);
 pkt = nextpkt;
 }
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302778 - in head/usr.sbin/pw: . tests

2016-07-13 Thread Alan Somers
Author: asomers
Date: Wed Jul 13 17:09:20 2016
New Revision: 302778
URL: https://svnweb.freebsd.org/changeset/base/302778

Log:
  pw should sanitize the argument of -w.
  
  Otherwise, it will silently disable the login for the selected account if
  the argument is unrecognizable.
  
  usr.sbin/pw/pw.h
  usr.sbin/pw/pw_conf.c
  usr.sbin/pw/pw_user.c
Use separate rules to validate boolean parameters and passwd
parameters.  Error out if a password parameter cannot be parsed.
  
  usr.sbin/pw/tests/Makefile
  usr.sbin/pw/tests/crypt.c
  usr.sbin/pw/tests/pw_useradd.sh
  usr.sbin/pw/tests/pw_usermod.sh
Add tests for the validation.  Also, enhance existing
password-related tests to actually validate that the correct hash is
written to master.passwd.
  
  Reviewed by:  bapt
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D6840

Added:
  head/usr.sbin/pw/tests/crypt.c   (contents, props changed)
Modified:
  head/usr.sbin/pw/pw.h
  head/usr.sbin/pw/pw_conf.c
  head/usr.sbin/pw/pw_user.c
  head/usr.sbin/pw/tests/Makefile
  head/usr.sbin/pw/tests/pw_useradd.sh
  head/usr.sbin/pw/tests/pw_usermod.sh

Modified: head/usr.sbin/pw/pw.h
==
--- head/usr.sbin/pw/pw.h   Wed Jul 13 16:49:48 2016(r302777)
+++ head/usr.sbin/pw/pw.h   Wed Jul 13 17:09:20 2016(r302778)
@@ -93,6 +93,7 @@ int groupadd(struct userconf *, char *na
 int nis_update(void);
 
 int boolean_val(char const * str, int dflt);
+int passwd_val(char const * str, int dflt);
 char const *boolean_str(int val);
 char *newstr(char const * p);
 

Modified: head/usr.sbin/pw/pw_conf.c
==
--- head/usr.sbin/pw/pw_conf.c  Wed Jul 13 16:49:48 2016(r302777)
+++ head/usr.sbin/pw/pw_conf.c  Wed Jul 13 17:09:20 2016(r302778)
@@ -186,6 +186,22 @@ boolean_val(char const * str, int dflt)
for (i = 0; boolfalse[i]; i++)
if (strcmp(str, boolfalse[i]) == 0)
return 0;
+   }
+   return dflt;
+}
+
+int
+passwd_val(char const * str, int dflt)
+{
+   if ((str = unquote(str)) != NULL) {
+   int i;
+
+   for (i = 0; booltrue[i]; i++)
+   if (strcmp(str, booltrue[i]) == 0)
+   return 1;
+   for (i = 0; boolfalse[i]; i++)
+   if (strcmp(str, boolfalse[i]) == 0)
+   return 0;
 
/*
 * Special cases for defaultpassword
@@ -194,6 +210,8 @@ boolean_val(char const * str, int dflt)
return -1;
if (strcmp(str, "none") == 0)
return -2;
+
+   errx(1, "Invalid value for default password");
}
return dflt;
 }
@@ -258,7 +276,7 @@ read_userconfig(char const * file)
 #endif
switch (i) {
case _UC_DEFAULTPWD:
-   config.default_password = boolean_val(q, 1);
+   config.default_password = passwd_val(q, 1);
break;
case _UC_REUSEUID:
config.reuse_uids = boolean_val(q, 0);

Modified: head/usr.sbin/pw/pw_user.c
==
--- head/usr.sbin/pw/pw_user.c  Wed Jul 13 16:49:48 2016(r302777)
+++ head/usr.sbin/pw/pw_user.c  Wed Jul 13 17:09:20 2016(r302778)
@@ -1315,7 +1315,7 @@ pw_user_add(int argc, char **argv, char 
 
mix_config(cmdcnf, cnf);
if (default_passwd)
-   cmdcnf->default_password = boolean_val(default_passwd,
+   cmdcnf->default_password = passwd_val(default_passwd,
cnf->default_password);
if (genconf) {
if (name != NULL)
@@ -1717,7 +1717,7 @@ pw_user_mod(int argc, char **argv, char 
if (lc == NULL || login_setcryptfmt(lc, "sha512", NULL) == NULL)
warn("setting crypt(3) format");
login_close(lc);
-   cnf->default_password = boolean_val(passwd,
+   cnf->default_password = passwd_val(passwd,
cnf->default_password);
pwd->pw_passwd = pw_password(cnf, pwd->pw_name, dryrun);
edited = true;

Modified: head/usr.sbin/pw/tests/Makefile
==
--- head/usr.sbin/pw/tests/Makefile Wed Jul 13 16:49:48 2016
(r302777)
+++ head/usr.sbin/pw/tests/Makefile Wed Jul 13 17:09:20 2016
(r302778)
@@ -2,6 +2,11 @@
 
 PACKAGE=   tests
 
+BINDIR=${TESTSDIR}
+
+PROGS+=crypt
+LIBADD+= 

svn commit: r302777 - head/contrib/tcsh

2016-07-13 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 13 16:49:48 2016
New Revision: 302777
URL: https://svnweb.freebsd.org/changeset/base/302777

Log:
  After removing collation for [a-z] ranges in r302512, mimic system
  glob() here too.
  
  I try to keep the change minimal to not touch contribed code much.
  I'll send it upstream when it will be merged to the main branches,
  but we need this change now here.

Modified:
  head/contrib/tcsh/glob.c

Modified: head/contrib/tcsh/glob.c
==
--- head/contrib/tcsh/glob.cWed Jul 13 16:45:26 2016(r302776)
+++ head/contrib/tcsh/glob.cWed Jul 13 16:49:48 2016(r302777)
@@ -142,17 +142,23 @@ globcharcoll(__Char c1, __Char c2, int c
c1 = towlower(c1);
c2 = towlower(c2);
 } else {
+#ifndef __FreeBSD__
/* This should not be here, but I'll rather leave it in than engage in
   a LC_COLLATE flamewar about a shell I don't use... */
if (iswlower(c1) && iswupper(c2))
return (1);
if (iswupper(c1) && iswlower(c2))
return (-1);
+#endif
 }
 s1[0] = c1;
 s2[0] = c2;
 s1[1] = s2[1] = '\0';
+#ifdef __FreeBSD__
+return wcscmp(s1, s2);
+#else
 return wcscoll(s1, s2);
+#endif
 # else /* not WIDE_STRINGS */
 char s1[2], s2[2];
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302776 - head/usr.bin/mail

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jul 13 16:45:26 2016
New Revision: 302776
URL: https://svnweb.freebsd.org/changeset/base/302776

Log:
  mail(1): Bring some fixes from other BSDs.
  
  - Use varargs properly
  - Use pid_t
  - Better handling of error conditions on forked jobs.
  - Some prototype and warning cleanups.
  
  Obtained from:NetBSD (some originaly from OpenBSD)

Modified:
  head/usr.bin/mail/cmd1.c
  head/usr.bin/mail/cmd2.c
  head/usr.bin/mail/cmd3.c
  head/usr.bin/mail/edit.c
  head/usr.bin/mail/extern.h
  head/usr.bin/mail/fio.c
  head/usr.bin/mail/getname.c
  head/usr.bin/mail/popen.c

Modified: head/usr.bin/mail/cmd1.c
==
--- head/usr.bin/mail/cmd1.cWed Jul 13 16:24:02 2016(r302775)
+++ head/usr.bin/mail/cmd1.cWed Jul 13 16:45:26 2016(r302776)
@@ -439,7 +439,7 @@ folders(void)
}
if ((cmd = value("LISTER")) == NULL)
cmd = "ls";
-   (void)run_command(cmd, 0, -1, -1, dirname, NULL, NULL);
+   (void)run_command(cmd, 0, -1, -1, dirname, NULL);
return (0);
 }
 

Modified: head/usr.bin/mail/cmd2.c
==
--- head/usr.bin/mail/cmd2.cWed Jul 13 16:24:02 2016(r302775)
+++ head/usr.bin/mail/cmd2.cWed Jul 13 16:45:26 2016(r302776)
@@ -130,8 +130,9 @@ hitit:
  * so we can discard when the user quits.
  */
 int
-save(char str[])
+save(void *v)
 {
+   char *str = v;
 
return (save1(str, 1, "save", saveignore));
 }
@@ -140,8 +141,9 @@ save(char str[])
  * Copy a message to a file without affected its saved-ness
  */
 int
-copycmd(char str[])
+copycmd(void *v)
 {
+   char *str = v;
 
return (save1(str, 0, "copy", saveignore));
 }

Modified: head/usr.bin/mail/cmd3.c
==
--- head/usr.bin/mail/cmd3.cWed Jul 13 16:24:02 2016(r302775)
+++ head/usr.bin/mail/cmd3.cWed Jul 13 16:45:26 2016(r302776)
@@ -79,7 +79,7 @@ dosh(char *str __unused)
 
if ((sh = value("SHELL")) == NULL)
sh = _PATH_CSHELL;
-   (void)run_command(sh, 0, -1, -1, NULL, NULL, NULL);
+   (void)run_command(sh, 0, -1, -1, NULL);
(void)signal(SIGINT, sigint);
printf("\n");
return (0);
@@ -102,7 +102,7 @@ bangexp(char *str, size_t strsize)
n = sizeof(bangbuf);
while (*cp != '\0') {
if (*cp == '!') {
-   if (n < strlen(lastbang)) {
+   if (n < (int)strlen(lastbang)) {
 overf:
printf("Command buffer overflow\n");
return (-1);

Modified: head/usr.bin/mail/edit.c
==
--- head/usr.bin/mail/edit.cWed Jul 13 16:24:02 2016(r302775)
+++ head/usr.bin/mail/edit.cWed Jul 13 16:45:26 2016(r302776)
@@ -180,7 +180,7 @@ run_editor(FILE *fp, off_t size, int typ
nf = NULL;
if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NULL)
edit = type == 'e' ? _PATH_EX : _PATH_VI;
-   if (run_command(edit, 0, -1, -1, tempname, NULL, NULL) < 0) {
+   if (run_command(edit, 0, -1, -1, tempname, NULL) < 0) {
(void)rm(tempname);
goto out;
}

Modified: head/usr.bin/mail/extern.h
==
--- head/usr.bin/mail/extern.h  Wed Jul 13 16:24:02 2016(r302775)
+++ head/usr.bin/mail/extern.h  Wed Jul 13 16:45:26 2016(r302776)
@@ -49,7 +49,7 @@ char  *copyin(char *, char **);
 char   *detract(struct name *, int);
 char   *expand(char *);
 char   *getdeadletter(void);
-char   *getname(int);
+char   *getname(uid_t);
 char   *hfield(const char *, struct message *);
 FILE   *infix(struct header *, FILE *);
 char   *ishfield(char [], char *, const char *);
@@ -95,7 +95,7 @@ void   collhup(int);
 voidcollint(int);
 voidcollstop(int);
 voidcommands(void);
-int copycmd(char []);
+int copycmd(void *v);
 int core(void);
 int count(struct name *);
 int delete(int []);
@@ -130,7 +130,7 @@ int  getfold(char *, int);
 int gethfield(FILE *, char [], int, char **);
 int getmsglist(char *, int *, int);
 int getrawlist(char [], char **, int);
-int getuserid(char []);
+uid_t   getuserid(char []);
 int grabh(struct header *, int);
 int group(char **);
 voidhangup(int);
@@ -198,8 +198,8 @@ int  respond(int *);
 int retfield(char *[]);
 int rexit(int);
 int rm(char *);
-int run_command(char *, sigset_t *, int, int, char *, char *, char *);
-int save(char []);
+int run_command(char *, sigset_t *, int, int, ...);
+int save(void *v);
 int save1(char [], int, const char *, struct ignoretab *);
 void

svn commit: r302775 - stable/9/sys/net

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jul 13 16:24:02 2016
New Revision: 302775
URL: https://svnweb.freebsd.org/changeset/base/302775

Log:
  MFC r302476:
  ng_mppc(4): basic readability cleanups.
  
  No functional change.

Modified:
  stable/9/sys/net/mppcc.c
  stable/9/sys/net/mppcd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/net/   (props changed)

Modified: stable/9/sys/net/mppcc.c
==
--- stable/9/sys/net/mppcc.cWed Jul 13 16:20:18 2016(r302774)
+++ stable/9/sys/net/mppcc.cWed Jul 13 16:24:02 2016(r302775)
@@ -233,7 +233,7 @@ int MPPC_Compress(u_char **src, u_char *
putbits16(*dst, 0xc000|(off-320), 16, , );
} else {/* NOTREACHED */
rtn &= ~MPPC_OK;
-   return rtn;
+   return (rtn);
}
 
/* Encode length of match. */

Modified: stable/9/sys/net/mppcd.c
==
--- stable/9/sys/net/mppcd.cWed Jul 13 16:20:18 2016(r302774)
+++ stable/9/sys/net/mppcd.cWed Jul 13 16:24:02 2016(r302775)
@@ -170,7 +170,7 @@ int MPPC_Decompress(u_char **src, u_char
rtn &= ~MPPC_OK;
return (rtn);
}
-   } else {/* NOTREACHED */
+   } else {/* This shouldn't happen. */
rtn &= ~MPPC_OK;
return (rtn);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302774 - stable/10/sys/net

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jul 13 16:20:18 2016
New Revision: 302774
URL: https://svnweb.freebsd.org/changeset/base/302774

Log:
  MFC r302476:
  ng_mppc(4): basic readability cleanups.
  
  No functional change.

Modified:
  stable/10/sys/net/mppcc.c
  stable/10/sys/net/mppcd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/mppcc.c
==
--- stable/10/sys/net/mppcc.c   Wed Jul 13 15:51:58 2016(r302773)
+++ stable/10/sys/net/mppcc.c   Wed Jul 13 16:20:18 2016(r302774)
@@ -233,7 +233,7 @@ int MPPC_Compress(u_char **src, u_char *
putbits16(*dst, 0xc000|(off-320), 16, , );
} else {/* NOTREACHED */
rtn &= ~MPPC_OK;
-   return rtn;
+   return (rtn);
}
 
/* Encode length of match. */

Modified: stable/10/sys/net/mppcd.c
==
--- stable/10/sys/net/mppcd.c   Wed Jul 13 15:51:58 2016(r302773)
+++ stable/10/sys/net/mppcd.c   Wed Jul 13 16:20:18 2016(r302774)
@@ -170,7 +170,7 @@ int MPPC_Decompress(u_char **src, u_char
rtn &= ~MPPC_OK;
return (rtn);
}
-   } else {/* NOTREACHED */
+   } else {/* This shouldn't happen. */
rtn &= ~MPPC_OK;
return (rtn);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271300 - in head/sys: net netinet

2016-07-13 Thread Andrey V. Elsukov
On 09.09.14 08:18, Adrian Chadd wrote:
> Author: adrian
> Date: Tue Sep  9 04:18:20 2014
> New Revision: 271300
> URL: http://svnweb.freebsd.org/changeset/base/271300
> 
> Log:
>   Update the IPv4 input path to handle reassembled frames and incoming frames
>   with no RSS hash.
>   
>   When doing RSS:
>   
>   * Create a new IPv4 netisr which expects the frames to have been verified;
> it just directly dispatches to the IPv4 input path.
>   * Once IPv4 reassembly is done, re-calculate the RSS hash with the new
> IP and L3 header; then reinject it as appropriate.
>   * Update the IPv4 netisr to be a CPU affinity netisr with the RSS hash
> function (rss_soft_m2cpuid) - this will do a software hash if the
> hardware doesn't provide one.
>   
>   NICs that don't implement hardware RSS hashing will now benefit from RSS
>   distribution - it'll inject into the correct destination netisr.
>   
>   Note: the netisr distribution doesn't work out of the box - netisr doesn't
>   query RSS for how many CPUs and the affinity setup.  Yes, netisr likely
>   shouldn't really be doing CPU stuff anymore and should be "some kind of
>   'thing' that is a workqueue that may or may not have any CPU affinity";
>   that's for a later commit.
>   
>   Differential Revision:  https://reviews.freebsd.org/D527
>   Reviewed by:grehan
> 
> Modified:
>   head/sys/net/netisr.h
>   head/sys/netinet/in_var.h
>   head/sys/netinet/ip_input.c
> 
> Modified: head/sys/netinet/ip_input.c

Hi, I am sorry for addressing this old message, but it looks like you
can not use the same IPCTL_XXX constant for several different oids.

...
> @@ -266,6 +292,46 @@ SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQDRO
  - there
>  CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_netinet_intr_queue_drops, "I",
>  "Number of packets dropped from the IP input queue");
>  
> +SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_direct_queue_maxlen,
 ^^^ - and there.
> +CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_direct_queue_maxlen, 
> "I",
> +"Maximum size of the IP direct input queue");

User applications use these constants to address specific oids and I
don't think and don't see that the kernel calls several handlers for one
oid.

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r302691 - head/release

2016-07-13 Thread Glen Barber
On Wed, Jul 13, 2016 at 09:03:52AM -0700, Nathan Whitehorn wrote:
> >There’s a lot more that could be done to be honest.
> >
> >Here are some other knobs that might help, depending on how
> >people configure their custom installers.
> 
> Yep, this is just a first pass to fix the low-hanging fruit: the 100+ MB
> worth of clang, which is much larger than, say, inetd or fortune. More
> optimization is great, of course (and I think Glen is working on it), though
> we should be careful not to compromise the live system on the CDs too much.

Confirmed, working on this now.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r302691 - head/release

2016-07-13 Thread Adrian Chadd
... does dynamically linking the toolchain reduce its size?


-a
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302691 - head/release

2016-07-13 Thread Nathan Whitehorn



On 07/12/16 19:20, Ngie Cooper (yaneurabeya) wrote:

On Jul 12, 2016, at 19:07, Nathan Whitehorn  wrote:

Author: nwhitehorn
Date: Wed Jul 13 02:07:36 2016
New Revision: 302691
URL: https://svnweb.freebsd.org/changeset/base/302691

Log:
  Reduce the set of things on the disc1 image to those on the bootonly image.
  Notably, this removes the toolchain from the CD-ROM image (it remains on DVD
  images) and pushes the CD-ROM image well below the 700 MB mark.

  MFC after:10 days

Modified:
  head/release/Makefile

There’s a lot more that could be done to be honest.

Here are some other knobs that might help, depending on how people configure 
their custom installers.


Yep, this is just a first pass to fix the low-hanging fruit: the 100+ MB 
worth of clang, which is much larger than, say, inetd or fortune. More 
optimization is great, of course (and I think Glen is working on it), 
though we should be careful not to compromise the live system on the CDs 
too much.

-Nathan



Cheers,
-Ngie

WITHOUT_ACCT=
WITHOUT_AMD=
WITHOUT_APM=
WITHOUT_AT=
WITHOUT_ATM=
WITHOUT_AUTOFS=
WITHOUT_BHYVE=
WITHOUT_BOOTPARAMD=
WITHOUT_BOOTPD=
WITHOUT_BSNMP=
WITHOUT_CVS=
WITHOUT_FINGER=
WITHOUT_GAMES=
WITHOUT_GDB=
WITHOUT_GPIB=
WITHOUT_HAST=
WITHOUT_HESOID=
WITHOUT_HTML=
WITHOUT_HYPERV=
WITHOUT_I4B=
WITHOUT_INETD=
WITHOUT_IPFILTER=
WITHOUT_IPFW=
WITHOUT_IPX=
WITHOUT_ISCSI=
WITHOUT_LIB32=
WITHOUT_LPR=
WITHOUT_NS_CACHING=
WITHOUT_PC_SYSINSTALL=
WITHOUT_PF=
WITHOUT_QUOTAS=
WITHOUT_RADIUS_SUPPORT=
WITHOUT_RBOOTD=
WITHOUT_RCMDS=
WITHOUT_ROUTED=
WITHOUT_SVN=
WITHOUT_SVNLITE=
WITHOUT_TALK=
WITHOUT_TCP_WRAPPERS=
WITHOUT_TFTP=
WITHOUT_TIMED=
WITHOUT_UNBOUND=

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r302773 - stable/11/sys/net

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jul 13 15:51:58 2016
New Revision: 302773
URL: https://svnweb.freebsd.org/changeset/base/302773

Log:
  MFC r302476:
  ng_mppc(4):: basic code readability cleanups.
  
  In particular use __unreachable() to appease static analyzers.
  No functional change.
  
  CID:  1356591
  Approved by:  re (gjb)

Modified:
  stable/11/sys/net/mppcc.c
  stable/11/sys/net/mppcd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/mppcc.c
==
--- stable/11/sys/net/mppcc.c   Wed Jul 13 15:16:51 2016(r302772)
+++ stable/11/sys/net/mppcc.c   Wed Jul 13 15:51:58 2016(r302773)
@@ -232,8 +232,9 @@ int MPPC_Compress(u_char **src, u_char *
} else if (off < 8192) {/* 16-bit offset; 320 <= offset < 8192 
*/
putbits16(*dst, 0xc000|(off-320), 16, , );
} else {/* NOTREACHED */
+   __unreachable();
rtn &= ~MPPC_OK;
-   return rtn;
+   return (rtn);
}
 
/* Encode length of match. */

Modified: stable/11/sys/net/mppcd.c
==
--- stable/11/sys/net/mppcd.c   Wed Jul 13 15:16:51 2016(r302772)
+++ stable/11/sys/net/mppcd.c   Wed Jul 13 15:51:58 2016(r302773)
@@ -170,7 +170,7 @@ int MPPC_Decompress(u_char **src, u_char
rtn &= ~MPPC_OK;
return (rtn);
}
-   } else {/* NOTREACHED */
+   } else {/* This shouldn't happen. */
rtn &= ~MPPC_OK;
return (rtn);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 15:16:51 2016
New Revision: 302772
URL: https://svnweb.freebsd.org/changeset/base/302772

Log:
  re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of snapshot's root
  
  The change has been undone in r301275 on the assumption that it was no
  longer required.  But that was incorrect, because in this case (and only
  in this case) the snapshot root vnode is looked up before z_parent is
  fixed up.
  
  MFC after:5 days

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cWed Jul 
13 14:59:17 2016(r302771)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cWed Jul 
13 15:16:51 2016(r302772)
@@ -1125,6 +1125,7 @@ domount:
 */
ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs);
VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs;
+   (*vpp)->v_flag &= ~VROOT;
}
ZFS_EXIT(zfsvfs);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302771 - head/usr.bin/mail

2016-07-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jul 13 14:59:17 2016
New Revision: 302771
URL: https://svnweb.freebsd.org/changeset/base/302771

Log:
  mail(1): check for out of memory conditions when calling calloc(3).
  
  Suggested by: oshogbo
  MFC after:3 days

Modified:
  head/usr.bin/mail/cmd3.c

Modified: head/usr.bin/mail/cmd3.c
==
--- head/usr.bin/mail/cmd3.cWed Jul 13 14:37:58 2016(r302770)
+++ head/usr.bin/mail/cmd3.cWed Jul 13 14:59:17 2016(r302771)
@@ -463,7 +463,8 @@ group(char **argv)
gname = *argv;
h = hash(gname);
if ((gh = findgroup(gname)) == NULL) {
-   gh = calloc(1, sizeof(*gh));
+   if ((gh = calloc(1, sizeof(*gh))) == NULL)
+   err(1, "Out of memory");
gh->g_name = vcopy(gname);
gh->g_list = NULL;
gh->g_link = groups[h];
@@ -477,7 +478,8 @@ group(char **argv)
 */
 
for (ap = argv+1; *ap != NULL; ap++) {
-   gp = calloc(1, sizeof(*gp));
+   if ((gp = calloc(1, sizeof(*gp))) == NULL)
+   err(1, "Out of memory");
gp->ge_name = vcopy(*ap);
gp->ge_link = gh->g_list;
gh->g_list = gp;
@@ -702,7 +704,8 @@ alternates(char **namelist)
}
if (altnames != 0)
(void)free(altnames);
-   altnames = calloc((unsigned)c, sizeof(char *));
+   if ((altnames = calloc((unsigned)c, sizeof(char *))) == NULL)
+   err(1, "Out of memory");
for (ap = namelist, ap2 = altnames; *ap != NULL; ap++, ap2++) {
cp = calloc((unsigned)strlen(*ap) + 1, sizeof(char));
strcpy(cp, *ap);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302770 - in head: sys/kern sys/sys usr.bin/kdump

2016-07-13 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 13 14:37:58 2016
New Revision: 302770
URL: https://svnweb.freebsd.org/changeset/base/302770

Log:
  Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
  
  Reviewed by:  jhb
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D7158

Modified:
  head/sys/kern/kern_time.c
  head/sys/sys/ktrace.h
  head/usr.bin/kdump/kdump.c

Modified: head/sys/kern/kern_time.c
==
--- head/sys/kern/kern_time.c   Wed Jul 13 12:40:43 2016(r302769)
+++ head/sys/kern/kern_time.c   Wed Jul 13 14:37:58 2016(r302770)
@@ -32,6 +32,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ktrace.h"
+
 #include 
 #include 
 #include 
@@ -54,6 +56,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef KTRACE
+#include 
+#endif
 
 #include 
 #include 
@@ -701,6 +706,10 @@ kern_getitimer(struct thread *td, u_int 
*aitv = p->p_stats->p_timer[which];
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
return (0);
 }
 
@@ -742,6 +751,10 @@ kern_setitimer(struct thread *td, u_int 
 
if (which > ITIMER_PROF)
return (EINVAL);
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
if (itimerfix(>it_value) ||
aitv->it_value.tv_sec > INT32_MAX / 2)
return (EINVAL);
@@ -786,6 +799,10 @@ kern_setitimer(struct thread *td, u_int 
p->p_stats->p_timer[which] = *aitv;
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(oitv);
+#endif
return (0);
 }
 

Modified: head/sys/sys/ktrace.h
==
--- head/sys/sys/ktrace.h   Wed Jul 13 12:40:43 2016(r302769)
+++ head/sys/sys/ktrace.h   Wed Jul 13 14:37:58 2016(r302770)
@@ -270,6 +270,8 @@ voidktrcapfail(enum ktr_cap_fail_type, 
const cap_rights_t *);
 #define ktrcaprights(s) \
ktrstruct("caprights", (s), sizeof(cap_rights_t))
+#definektritimerval(s) \
+   ktrstruct("itimerval", (s), sizeof(struct itimerval))
 #define ktrsockaddr(s) \
ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len)
 #define ktrstat(s) \

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Wed Jul 13 12:40:43 2016(r302769)
+++ head/usr.bin/kdump/kdump.c  Wed Jul 13 14:37:58 2016(r302770)
@@ -109,6 +109,7 @@ void ktruser_malloc(void *);
 void ktruser_rtld(int, void *);
 void ktruser(int, void *);
 void ktrcaprights(cap_rights_t *);
+void ktritimerval(struct itimerval *it);
 void ktrsockaddr(struct sockaddr *);
 void ktrstat(struct stat *);
 void ktrstruct(char *, size_t);
@@ -1562,6 +1563,24 @@ ktrcaprights(cap_rights_t *rightsp)
printf("\n");
 }
 
+static void
+ktrtimeval(struct timeval *tv)
+{
+
+   printf("{%ld, %ld}", (long)tv->tv_sec, tv->tv_usec);
+}
+
+void
+ktritimerval(struct itimerval *it)
+{
+
+   printf("itimerval { .interval = ");
+   ktrtimeval(>it_interval);
+   printf(", .value = ");
+   ktrtimeval(>it_value);
+   printf(" }\n");
+}
+
 void
 ktrsockaddr(struct sockaddr *sa)
 {
@@ -1737,6 +1756,7 @@ ktrstruct(char *buf, size_t buflen)
size_t namelen, datalen;
int i;
cap_rights_t rights;
+   struct itimerval it;
struct stat sb;
struct sockaddr_storage ss;
 
@@ -1761,6 +1781,11 @@ ktrstruct(char *buf, size_t buflen)
goto invalid;
memcpy(, data, datalen);
ktrcaprights();
+   } else if (strcmp(name, "itimerval") == 0) {
+   if (datalen != sizeof(struct itimerval))
+   goto invalid;
+   memcpy(, data, datalen);
+   ktritimerval();
} else if (strcmp(name, "stat") == 0) {
if (datalen != sizeof(struct stat))
goto invalid;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302767 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:58:21 2016
New Revision: 302767
URL: https://svnweb.freebsd.org/changeset/base/302767

Log:
  MFC r286710: 6093 zfsctl_shares_lookup should only VN_RELE() on
  zfs_zget() success

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:18:37 2016(r302766)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:58:21 2016(r302767)
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
  */
 
 /*
@@ -1179,10 +1180,11 @@ zfsctl_shares_lookup(ap)
ZFS_EXIT(zfsvfs);
return (SET_ERROR(ENOTSUP));
}
-   if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, )) == 0)
+   if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, )) == 0) {
error = VOP_LOOKUP(ZTOV(dzp), vpp, cnp);
+   VN_RELE(ZTOV(dzp));
+   }
 
-   VN_RELE(ZTOV(dzp));
ZFS_EXIT(zfsvfs);
 
return (error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302577 - head/sys/dev/drm2

2016-07-13 Thread Robert Watson

On Mon, 11 Jul 2016, Garrett Cooper wrote:


 Add missing default case to capable(..) function definition

 By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
 aren't possible. Add in a KASSERT safety belt and return false in
 !INVARIANTS case if an invalid value is passed in, as it would be a
 programmer error.

 This fixes a -Wreturn-type error with gcc 5.3.0.

 Differential Revision: https://reviews.freebsd.org/D7188
 MFC after: 1 week
 Reported by:   devel/amd64-gcc (5.3.0)
 Reviewed by:   dumbbell
 Sponsored by:  EMC / Isilon Storage Division


Per my comment in the review, I think a panic() here would be preferable to a 
KASSERT(), as it would come without perceptible runtime cost, and failstop the 
system if we were violating a design-time security invariant.


Robert
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302766 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:18:37 2016
New Revision: 302766
URL: https://svnweb.freebsd.org/changeset/base/302766

Log:
  MFC r300145: add vop_print methods to vnode operatios of various zfsctl
  node types

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:16:12 2016(r302765)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:18:37 2016(r302766)
@@ -293,6 +293,22 @@ zfsctl_root(znode_t *zp)
return (zp->z_zfsvfs->z_ctldir);
 }
 
+static int
+zfsctl_common_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   gfs_file_t *fp = vp->v_data;
+
+   printf("parent = %p\n", fp->gfs_parent);
+   printf("type = %d\n", fp->gfs_type);
+   printf("index = %d\n", fp->gfs_index);
+   printf("ino = %ju\n", (uintmax_t)fp->gfs_ino);
+   return (0);
+}
+
 /*
  * Common open routine.  Disallow any write access.
  */
@@ -583,6 +599,17 @@ relookup:
return (err);
 }
 
+static int
+zfsctl_root_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   printf(".zfs node\n");
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 #ifdef illumos
 static int
 zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
@@ -633,6 +660,7 @@ static struct vop_vector zfsctl_ops_root
.vop_pathconf = zfsctl_pathconf,
 #endif
.vop_fid =  zfsctl_common_fid,
+   .vop_print =zfsctl_root_print,
 };
 
 /*
@@ -1366,6 +1394,32 @@ zfsctl_snapdir_reclaim(ap)
return (0);
 }
 
+static int
+zfsctl_shares_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   printf(".zfs/shares node\n");
+   zfsctl_common_print(ap);
+   return (0);
+}
+
+static int
+zfsctl_snapdir_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   zfsctl_snapdir_t *sdp = vp->v_data;
+
+   printf(".zfs/snapshot node\n");
+   printf("number of children = %lu\n", avl_numnodes(>sd_snaps));
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 #ifdef sun
 static const fs_operation_def_t zfsctl_tops_snapdir[] = {
{ VOPNAME_OPEN, { .vop_open = zfsctl_common_open }  },
@@ -1411,6 +1465,7 @@ static struct vop_vector zfsctl_ops_snap
.vop_inactive = VOP_NULL,
.vop_reclaim =  zfsctl_snapdir_reclaim,
.vop_fid =  zfsctl_common_fid,
+   .vop_print =zfsctl_snapdir_print,
 };
 
 static struct vop_vector zfsctl_ops_shares = {
@@ -1425,6 +1480,7 @@ static struct vop_vector zfsctl_ops_shar
.vop_inactive = VOP_NULL,
.vop_reclaim =  gfs_vop_reclaim,
.vop_fid =  zfsctl_shares_fid,
+   .vop_print =zfsctl_shares_print,
 };
 #endif /* !sun */
 
@@ -1561,6 +1617,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
return (error);
 }
 
+static int
+zfsctl_snaphot_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   zfsctl_node_t *zcp = vp->v_data;
+
+   printf(".zfs/snapshot/ node\n");
+   printf("id = %ju\n", (uintmax_t)zcp->zc_id);
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 /*
  * These VP's should never see the light of day.  They should always
  * be covered.
@@ -1570,6 +1641,7 @@ static struct vop_vector zfsctl_ops_snap
.vop_inactive = zfsctl_snapshot_inactive,
.vop_reclaim =  zfsctl_snapshot_reclaim,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
+   .vop_print =zfsctl_snaphot_print,
 };
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302765 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:16:12 2016
New Revision: 302765
URL: https://svnweb.freebsd.org/changeset/base/302765

Log:
  MFC r300134: move zfsctl_freebsd_root_lookup right next to
  zfsctl_root_lookup

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:14:11 2016(r302764)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:16:12 2016(r302765)
@@ -539,46 +539,7 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
return (err);
 }
 
-#ifdef sun
 static int
-zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
-caller_context_t *ct)
-{
-   /*
-* We only care about ACL_ENABLED so that libsec can
-* display ACL correctly and not default to POSIX draft.
-*/
-   if (cmd == _PC_ACL_ENABLED) {
-   *valp = _ACL_ACE_ENABLED;
-   return (0);
-   }
-
-   return (fs_pathconf(vp, cmd, valp, cr, ct));
-}
-#endif /* sun */
-
-#ifdef sun
-static const fs_operation_def_t zfsctl_tops_root[] = {
-   { VOPNAME_OPEN, { .vop_open = zfsctl_common_open }  },
-   { VOPNAME_CLOSE,{ .vop_close = zfsctl_common_close }},
-   { VOPNAME_IOCTL,{ .error = fs_inval }   },
-   { VOPNAME_GETATTR,  { .vop_getattr = zfsctl_root_getattr }  },
-   { VOPNAME_ACCESS,   { .vop_access = zfsctl_common_access }  },
-   { VOPNAME_READDIR,  { .vop_readdir = gfs_vop_readdir }  },
-   { VOPNAME_LOOKUP,   { .vop_lookup = zfsctl_root_lookup }},
-   { VOPNAME_SEEK, { .vop_seek = fs_seek } },
-   { VOPNAME_INACTIVE, { .vop_inactive = gfs_vop_inactive }},
-   { VOPNAME_PATHCONF, { .vop_pathconf = zfsctl_pathconf } },
-   { VOPNAME_FID,  { .vop_fid = zfsctl_common_fid  }   },
-   { NULL }
-};
-#endif /* sun */
-
-/*
- * Special case the handling of "..".
- */
-/* ARGSUSED */
-int
 zfsctl_freebsd_root_lookup(ap)
struct vop_lookup_args /* {
struct vnode *a_dvp;
@@ -622,6 +583,41 @@ relookup:
return (err);
 }
 
+#ifdef illumos
+static int
+zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
+caller_context_t *ct)
+{
+   /*
+* We only care about ACL_ENABLED so that libsec can
+* display ACL correctly and not default to POSIX draft.
+*/
+   if (cmd == _PC_ACL_ENABLED) {
+   *valp = _ACL_ACE_ENABLED;
+   return (0);
+   }
+
+   return (fs_pathconf(vp, cmd, valp, cr, ct));
+}
+#endif /* illumos */
+
+#ifdef illumos
+static const fs_operation_def_t zfsctl_tops_root[] = {
+   { VOPNAME_OPEN, { .vop_open = zfsctl_common_open }  },
+   { VOPNAME_CLOSE,{ .vop_close = zfsctl_common_close }},
+   { VOPNAME_IOCTL,{ .error = fs_inval }   },
+   { VOPNAME_GETATTR,  { .vop_getattr = zfsctl_root_getattr }  },
+   { VOPNAME_ACCESS,   { .vop_access = zfsctl_common_access }  },
+   { VOPNAME_READDIR,  { .vop_readdir = gfs_vop_readdir }  },
+   { VOPNAME_LOOKUP,   { .vop_lookup = zfsctl_root_lookup }},
+   { VOPNAME_SEEK, { .vop_seek = fs_seek } },
+   { VOPNAME_INACTIVE, { .vop_inactive = gfs_vop_inactive }},
+   { VOPNAME_PATHCONF, { .vop_pathconf = zfsctl_pathconf } },
+   { VOPNAME_FID,  { .vop_fid = zfsctl_common_fid  }   },
+   { NULL }
+};
+#endif /* illumos */
+
 static struct vop_vector zfsctl_ops_root = {
.vop_default =  _vnodeops,
.vop_open = zfsctl_common_open,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302764 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:14:11 2016
New Revision: 302764
URL: https://svnweb.freebsd.org/changeset/base/302764

Log:
  MFC r300134: move zfsctl_freebsd_root_lookup right next to
  zfsctl_root_lookup

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:08:50 2016(r302763)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:14:11 2016(r302764)
@@ -557,6 +557,50 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
 }
 
 static int
+zfsctl_freebsd_root_lookup(ap)
+   struct vop_lookup_args /* {
+   struct vnode *a_dvp;
+   struct vnode **a_vpp;
+   struct componentname *a_cnp;
+   } */ *ap;
+{
+   vnode_t *dvp = ap->a_dvp;
+   vnode_t **vpp = ap->a_vpp;
+   cred_t *cr = ap->a_cnp->cn_cred;
+   int flags = ap->a_cnp->cn_flags;
+   int lkflags = ap->a_cnp->cn_lkflags;
+   int nameiop = ap->a_cnp->cn_nameiop;
+   char nm[NAME_MAX + 1];
+   int err;
+
+   if ((flags & ISLASTCN) && (nameiop == RENAME || nameiop == CREATE))
+   return (EOPNOTSUPP);
+
+   ASSERT(ap->a_cnp->cn_namelen < sizeof(nm));
+   strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
+relookup:
+   err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
+   if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
+   if (flags & ISDOTDOT) {
+   VOP_UNLOCK(dvp, 0);
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
+   }
+   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   } else {
+   err = vn_lock(*vpp, LK_EXCLUSIVE);
+   if (err != 0) {
+   VERIFY3S(err, ==, ENOENT);
+   goto relookup;
+   }
+   }
+   }
+   return (err);
+}
+
+static int
 zfsctl_root_print(ap)
struct vop_print_args /* {
struct vnode *a_vp;
@@ -602,54 +646,6 @@ static const fs_operation_def_t zfsctl_t
 };
 #endif /* illumos */
 
-/*
- * Special case the handling of "..".
- */
-/* ARGSUSED */
-int
-zfsctl_freebsd_root_lookup(ap)
-   struct vop_lookup_args /* {
-   struct vnode *a_dvp;
-   struct vnode **a_vpp;
-   struct componentname *a_cnp;
-   } */ *ap;
-{
-   vnode_t *dvp = ap->a_dvp;
-   vnode_t **vpp = ap->a_vpp;
-   cred_t *cr = ap->a_cnp->cn_cred;
-   int flags = ap->a_cnp->cn_flags;
-   int lkflags = ap->a_cnp->cn_lkflags;
-   int nameiop = ap->a_cnp->cn_nameiop;
-   char nm[NAME_MAX + 1];
-   int err;
-
-   if ((flags & ISLASTCN) && (nameiop == RENAME || nameiop == CREATE))
-   return (EOPNOTSUPP);
-
-   ASSERT(ap->a_cnp->cn_namelen < sizeof(nm));
-   strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
-relookup:
-   err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
-   if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
-   if (flags & ISDOTDOT) {
-   VOP_UNLOCK(dvp, 0);
-   err = vn_lock(*vpp, lkflags);
-   if (err != 0) {
-   vrele(*vpp);
-   *vpp = NULL;
-   }
-   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
-   } else {
-   err = vn_lock(*vpp, LK_EXCLUSIVE);
-   if (err != 0) {
-   VERIFY3S(err, ==, ENOENT);
-   goto relookup;
-   }
-   }
-   }
-   return (err);
-}
-
 static struct vop_vector zfsctl_ops_root = {
.vop_default =  _vnodeops,
.vop_open = zfsctl_common_open,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302763 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:08:50 2016
New Revision: 302763
URL: https://svnweb.freebsd.org/changeset/base/302763

Log:
  MFC r300130: zfsctl_freebsd_root_lookup: gfs_vop_lookup may return a
  doomed vnode

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:06:37 2016(r302762)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:08:50 2016(r302763)
@@ -600,20 +600,25 @@ zfsctl_freebsd_root_lookup(ap)
 
ASSERT(ap->a_cnp->cn_namelen < sizeof(nm));
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
-
+relookup:
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
-   if (flags & ISDOTDOT)
+   if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0);
-   err = vn_lock(*vpp, lkflags);
-   if (err != 0) {
-   vrele(*vpp);
-   *vpp = NULL;
-   }
-   if (flags & ISDOTDOT)
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
+   }
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   } else {
+   err = vn_lock(*vpp, LK_EXCLUSIVE);
+   if (err != 0) {
+   VERIFY3S(err, ==, ENOENT);
+   goto relookup;
+   }
+   }
}
-
return (err);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302762 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:06:37 2016
New Revision: 302762
URL: https://svnweb.freebsd.org/changeset/base/302762

Log:
  MFC r300130: zfsctl_freebsd_root_lookup: gfs_vop_lookup may return a
  doomed vnode

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:04:21 2016(r302761)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:06:37 2016(r302762)
@@ -628,19 +628,25 @@ zfsctl_freebsd_root_lookup(ap)
 
ASSERT(ap->a_cnp->cn_namelen < sizeof(nm));
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
+relookup:
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
-   if (flags & ISDOTDOT)
+   if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0);
-   err = vn_lock(*vpp, lkflags);
-   if (err != 0) {
-   vrele(*vpp);
-   *vpp = NULL;
-   }
-   if (flags & ISDOTDOT)
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
+   }
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   } else {
+   err = vn_lock(*vpp, LK_EXCLUSIVE);
+   if (err != 0) {
+   VERIFY3S(err, ==, ENOENT);
+   goto relookup;
+   }
+   }
}
-
return (err);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302760 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:04:02 2016
New Revision: 302760
URL: https://svnweb.freebsd.org/changeset/base/302760

Log:
  MFC r299951: do not destroy 'snapdir' when it becomes  inactive

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:00:44 2016(r302759)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 11:04:02 2016(r302760)
@@ -468,25 +468,6 @@ zfsctl_shares_fid(ap)
return (error);
 }
 
-static int
-zfsctl_common_reclaim(ap)
-   struct vop_reclaim_args /* {
-   struct vnode *a_vp;
-   struct thread *a_td;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-
-   /*
-* Destroy the vm object and flush associated pages.
-*/
-   vnode_destroy_vobject(vp);
-   VI_LOCK(vp);
-   vp->v_data = NULL;
-   VI_UNLOCK(vp);
-   return (0);
-}
-
 /*
  * .zfs inode namespace
  *
@@ -1395,8 +1376,8 @@ zfsctl_snapdir_getattr(ap)
 
 /* ARGSUSED */
 static int
-zfsctl_snapdir_inactive(ap)
-   struct vop_inactive_args /* {
+zfsctl_snapdir_reclaim(ap)
+   struct vop_reclaim_args /* {
struct vnode *a_vp;
struct thread *a_td;
} */ *ap;
@@ -1405,21 +1386,10 @@ zfsctl_snapdir_inactive(ap)
zfsctl_snapdir_t *sdp = vp->v_data;
zfs_snapentry_t *sep;
 
-   /*
-* On forced unmount we have to free snapshots from here.
-*/
-   mutex_enter(>sd_lock);
-   while ((sep = avl_first(>sd_snaps)) != NULL) {
-   avl_remove(>sd_snaps, sep);
-   kmem_free(sep->se_name, strlen(sep->se_name) + 1);
-   kmem_free(sep, sizeof (zfs_snapentry_t));
-   }
-   mutex_exit(>sd_lock);
-   gfs_dir_inactive(vp);
ASSERT(avl_numnodes(>sd_snaps) == 0);
mutex_destroy(>sd_lock);
avl_destroy(>sd_snaps);
-   kmem_free(sdp, sizeof (zfsctl_snapdir_t));
+   gfs_vop_reclaim(ap);
 
return (0);
 }
@@ -1492,8 +1462,8 @@ static struct vop_vector zfsctl_ops_snap
.vop_mkdir =zfsctl_freebsd_snapdir_mkdir,
.vop_readdir =  gfs_vop_readdir,
.vop_lookup =   zfsctl_snapdir_lookup,
-   .vop_inactive = zfsctl_snapdir_inactive,
-   .vop_reclaim =  zfsctl_common_reclaim,
+   .vop_inactive = VOP_NULL,
+   .vop_reclaim =  zfsctl_snapdir_reclaim,
.vop_fid =  zfsctl_common_fid,
.vop_print =zfsctl_snapdir_print,
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302761 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:04:21 2016
New Revision: 302761
URL: https://svnweb.freebsd.org/changeset/base/302761

Log:
  MFC r299951: do not destroy 'snapdir' when it becomes  inactive

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:04:02 2016(r302760)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:04:21 2016(r302761)
@@ -451,25 +451,6 @@ zfsctl_shares_fid(ap)
return (error);
 }
 
-static int
-zfsctl_common_reclaim(ap)
-   struct vop_reclaim_args /* {
-   struct vnode *a_vp;
-   struct thread *a_td;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-
-   /*
-* Destroy the vm object and flush associated pages.
-*/
-   vnode_destroy_vobject(vp);
-   VI_LOCK(vp);
-   vp->v_data = NULL;
-   VI_UNLOCK(vp);
-   return (0);
-}
-
 /*
  * .zfs inode namespace
  *
@@ -1366,8 +1347,8 @@ zfsctl_snapdir_getattr(ap)
 
 /* ARGSUSED */
 static int
-zfsctl_snapdir_inactive(ap)
-   struct vop_inactive_args /* {
+zfsctl_snapdir_reclaim(ap)
+   struct vop_reclaim_args /* {
struct vnode *a_vp;
struct thread *a_td;
} */ *ap;
@@ -1376,21 +1357,10 @@ zfsctl_snapdir_inactive(ap)
zfsctl_snapdir_t *sdp = vp->v_data;
zfs_snapentry_t *sep;
 
-   /*
-* On forced unmount we have to free snapshots from here.
-*/
-   mutex_enter(>sd_lock);
-   while ((sep = avl_first(>sd_snaps)) != NULL) {
-   avl_remove(>sd_snaps, sep);
-   kmem_free(sep->se_name, strlen(sep->se_name) + 1);
-   kmem_free(sep, sizeof (zfs_snapentry_t));
-   }
-   mutex_exit(>sd_lock);
-   gfs_dir_inactive(vp);
ASSERT(avl_numnodes(>sd_snaps) == 0);
mutex_destroy(>sd_lock);
avl_destroy(>sd_snaps);
-   kmem_free(sdp, sizeof (zfsctl_snapdir_t));
+   gfs_vop_reclaim(ap);
 
return (0);
 }
@@ -1437,8 +1407,8 @@ static struct vop_vector zfsctl_ops_snap
.vop_mkdir =zfsctl_freebsd_snapdir_mkdir,
.vop_readdir =  gfs_vop_readdir,
.vop_lookup =   zfsctl_snapdir_lookup,
-   .vop_inactive = zfsctl_snapdir_inactive,
-   .vop_reclaim =  zfsctl_common_reclaim,
+   .vop_inactive = VOP_NULL,
+   .vop_reclaim =  zfsctl_snapdir_reclaim,
.vop_fid =  zfsctl_common_fid,
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302759 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 11:00:44 2016
New Revision: 302759
URL: https://svnweb.freebsd.org/changeset/base/302759

Log:
  MFC r299949: try to recycle "snap" vnodes as soon as possible

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:58:52 2016(r302758)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 11:00:44 2016(r302759)
@@ -1479,17 +1479,28 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
return (vp);
 }
 
+static int
+zfsctl_snapshot_inactive(ap)
+   struct vop_inactive_args /* {
+   struct vnode *a_vp;
+   struct thread *a_td;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+
+   vrecycle(vp, curthread);
+   return (0);
+}
 
 static int
 zfsctl_snapshot_reclaim(ap)
-   struct vop_inactive_args /* {
+   struct vop_reclaim_args /* {
struct vnode *a_vp;
struct thread *a_td;
} */ *ap;
 {
vnode_t *vp = ap->a_vp;
cred_t *cr = ap->a_td->td_ucred;
-   struct vop_reclaim_args iap;
zfsctl_snapdir_t *sdp;
zfs_snapentry_t *sep, *next;
int locked;
@@ -1532,8 +1543,7 @@ zfsctl_snapshot_reclaim(ap)
 * "active".  If we lookup the same name again we will end up
 * creating a new vnode.
 */
-   iap.a_vp = vp;
-   gfs_vop_reclaim();
+   gfs_vop_reclaim(ap);
return (0);
 
 }
@@ -1586,7 +1596,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
  */
 static struct vop_vector zfsctl_ops_snapshot = {
.vop_default =  _vnodeops,
-   .vop_inactive = VOP_NULL,
+   .vop_inactive = zfsctl_snapshot_inactive,
.vop_reclaim =  zfsctl_snapshot_reclaim,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302758 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs fs/zfs sys

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:58:52 2016
New Revision: 302758
URL: https://svnweb.freebsd.org/changeset/base/302758

Log:
  Partial MFC r273641: use FreeBSD reclaim for illumos inactive

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:49:32 2016(r302757)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:58:52 2016(r302758)
@@ -90,7 +90,7 @@
  * gfs_dir_lookup()
  * gfs_dir_readdir()
  *
- * gfs_vop_inactive()
+ * gfs_vop_reclaim()
  * gfs_vop_lookup()
  * gfs_vop_readdir()
  * gfs_vop_map()
@@ -614,7 +614,7 @@ gfs_root_create_file(size_t size, vfs_t 
 /*
  * gfs_file_inactive()
  *
- * Called from the VOP_INACTIVE() routine.  If necessary, this routine will
+ * Called from the VOP_RECLAIM() routine.  If necessary, this routine will
  * remove the given vnode from the parent directory and clean up any references
  * in the VFS layer.
  *
@@ -1213,15 +1213,15 @@ gfs_vop_map(vnode_t *vp, offset_t off, s
 #endif /* sun */
 
 /*
- * gfs_vop_inactive: VOP_INACTIVE() entry point
+ * gfs_vop_reclaim: VOP_RECLAIM() entry point (solaris' VOP_INACTIVE())
  *
  * Given a vnode that is a GFS file or directory, call gfs_file_inactive() or
  * gfs_dir_inactive() as necessary, and kmem_free()s associated private data.
  */
 /* ARGSUSED */
 int
-gfs_vop_inactive(ap)
-   struct vop_inactive_args /* {
+gfs_vop_reclaim(ap)
+   struct vop_reclaim_args /* {
struct vnode *a_vp;
struct thread *a_td;
} */ *ap;
@@ -1234,6 +1234,7 @@ gfs_vop_inactive(ap)
else
gfs_file_inactive(vp);
 
+   vnode_destroy_vobject(vp);
VI_LOCK(vp);
vp->v_data = NULL;
VI_UNLOCK(vp);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:49:32 2016(r302757)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:58:52 2016(r302758)
@@ -645,8 +645,8 @@ static struct vop_vector zfsctl_ops_root
.vop_access =   zfsctl_common_access,
.vop_readdir =  gfs_vop_readdir,
.vop_lookup =   zfsctl_freebsd_root_lookup,
-   .vop_inactive = gfs_vop_inactive,
-   .vop_reclaim =  zfsctl_common_reclaim,
+   .vop_inactive = VOP_NULL,
+   .vop_reclaim =  gfs_vop_reclaim,
 #ifdef TODO
.vop_pathconf = zfsctl_pathconf,
 #endif
@@ -699,7 +699,7 @@ zfsctl_unmount_snap(zfs_snapentry_t *sep
 * the sd_lock mutex held by our caller.
 */
ASSERT(svp->v_count == 1);
-   gfs_vop_inactive(svp, cr, NULL);
+   gfs_vop_reclaim(svp, cr, NULL);
 
kmem_free(sep->se_name, strlen(sep->se_name) + 1);
kmem_free(sep, sizeof (zfs_snapentry_t));
@@ -1451,8 +1451,8 @@ static struct vop_vector zfsctl_ops_shar
.vop_access =   zfsctl_common_access,
.vop_readdir =  zfsctl_shares_readdir,
.vop_lookup =   zfsctl_shares_lookup,
-   .vop_inactive = gfs_vop_inactive,
-   .vop_reclaim =  zfsctl_common_reclaim,
+   .vop_inactive = VOP_NULL,
+   .vop_reclaim =  gfs_vop_reclaim,
.vop_fid =  zfsctl_shares_fid,
 };
 #endif /* !sun */
@@ -1479,8 +1479,9 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
return (vp);
 }
 
+
 static int
-zfsctl_snapshot_inactive(ap)
+zfsctl_snapshot_reclaim(ap)
struct vop_inactive_args /* {
struct vnode *a_vp;
struct thread *a_td;
@@ -1488,18 +1489,19 @@ zfsctl_snapshot_inactive(ap)
 {
vnode_t *vp = ap->a_vp;
cred_t *cr = ap->a_td->td_ucred;
-   struct vop_inactive_args iap;
+   struct vop_reclaim_args iap;
zfsctl_snapdir_t *sdp;
zfs_snapentry_t *sep, *next;
int locked;
vnode_t *dvp;
 
-   if (vp->v_count > 0)
-   goto end;
-
VERIFY(gfs_dir_lookup(vp, "..", , cr, 0, NULL, NULL) == 0);
sdp = dvp->v_data;
-
+   /* this may already have been unmounted */
+   if (sdp == NULL) {
+   VN_RELE(dvp);
+   return (0);
+   }
if (!(locked = MUTEX_HELD(>sd_lock)))
mutex_enter(>sd_lock);
 
@@ -1523,7 +1525,6 @@ zfsctl_snapshot_inactive(ap)
mutex_exit(>sd_lock);
VN_RELE(dvp);
 
-end:
/*
 * Dispose of the vnode for the snapshot 

svn commit: r302757 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:49:32 2016
New Revision: 302757
URL: https://svnweb.freebsd.org/changeset/base/302757

Log:
  fix a mismerge in r302751
  
  This is a direct commit.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:32:24 2016(r302756)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:49:32 2016(r302757)
@@ -443,7 +443,6 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d
ASSERT(pvp != NULL);
VN_HOLD(pvp);
*vpp = pvp;
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
return (0);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302756 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:32:24 2016
New Revision: 302756
URL: https://svnweb.freebsd.org/changeset/base/302756

Log:
  MFC r299949: try to recycle "snap" vnodes as soon as possible

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:30:32 2016(r302755)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:32:24 2016(r302756)
@@ -1536,17 +1536,28 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
return (vp);
 }
 
+static int
+zfsctl_snapshot_inactive(ap)
+   struct vop_inactive_args /* {
+   struct vnode *a_vp;
+   struct thread *a_td;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+
+   vrecycle(vp);
+   return (0);
+}
 
 static int
 zfsctl_snapshot_reclaim(ap)
-   struct vop_inactive_args /* {
+   struct vop_reclaim_args /* {
struct vnode *a_vp;
struct thread *a_td;
} */ *ap;
 {
vnode_t *vp = ap->a_vp;
cred_t *cr = ap->a_td->td_ucred;
-   struct vop_reclaim_args iap;
zfsctl_snapdir_t *sdp;
zfs_snapentry_t *sep, *next;
int locked;
@@ -1589,8 +1600,7 @@ zfsctl_snapshot_reclaim(ap)
 * "active".  If we lookup the same name again we will end up
 * creating a new vnode.
 */
-   iap.a_vp = vp;
-   gfs_vop_reclaim();
+   gfs_vop_reclaim(ap);
return (0);
 
 }
@@ -1658,7 +1668,7 @@ zfsctl_snaphot_print(ap)
  */
 static struct vop_vector zfsctl_ops_snapshot = {
.vop_default =  _vnodeops,
-   .vop_inactive = VOP_NULL,
+   .vop_inactive = zfsctl_snapshot_inactive,
.vop_reclaim =  zfsctl_snapshot_reclaim,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
.vop_print =zfsctl_snaphot_print,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302755 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:30:32 2016
New Revision: 302755
URL: https://svnweb.freebsd.org/changeset/base/302755

Log:
  MFC r299947: fix locking in zfsctl_root_lookup

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:26:38 2016(r302754)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:30:32 2016(r302755)
@@ -534,9 +534,20 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
ZFS_ENTER(zfsvfs);
 
if (strcmp(nm, "..") == 0) {
+#ifdef illumos
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp);
+#else
+   /*
+* NB: can not use VFS_ROOT here as it would acquire
+* the vnode lock of the parent (root) vnode while
+* holding the child's (.zfs) lock.
+*/
+   znode_t *rootzp;
+
+   err = zfs_zget(zfsvfs, zfsvfs->z_root, );
if (err == 0)
-   VOP_UNLOCK(*vpp, 0);
+   *vpp = ZTOV(rootzp);
+#endif
} else {
err = gfs_vop_lookup(dvp, nm, vpp, pnp, flags, rdir,
cr, ct, direntflags, realpnp);
@@ -598,6 +609,7 @@ zfsctl_freebsd_root_lookup(ap)
vnode_t **vpp = ap->a_vpp;
cred_t *cr = ap->a_cnp->cn_cred;
int flags = ap->a_cnp->cn_flags;
+   int lkflags = ap->a_cnp->cn_lkflags;
int nameiop = ap->a_cnp->cn_nameiop;
char nm[NAME_MAX + 1];
int err;
@@ -609,8 +621,18 @@ zfsctl_freebsd_root_lookup(ap)
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
 
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
-   if (err == 0 && (nm[0] != '.' || nm[1] != '\0'))
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
+   if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
+   if (flags & ISDOTDOT)
+   VOP_UNLOCK(dvp, 0);
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
+   }
+   if (flags & ISDOTDOT)
+   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   }
+
return (err);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302754 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:26:38 2016
New Revision: 302754
URL: https://svnweb.freebsd.org/changeset/base/302754

Log:
  revert r302753 because of incorrect commit message
  
  The change was MFC of r299947

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:18:29 2016(r302753)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:26:38 2016(r302754)
@@ -534,20 +534,9 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
ZFS_ENTER(zfsvfs);
 
if (strcmp(nm, "..") == 0) {
-#ifdef illumos
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp);
-#else
-   /*
-* NB: can not use VFS_ROOT here as it would acquire
-* the vnode lock of the parent (root) vnode while
-* holding the child's (.zfs) lock.
-*/
-   znode_t *rootzp;
-
-   err = zfs_zget(zfsvfs, zfsvfs->z_root, );
if (err == 0)
-   *vpp = ZTOV(rootzp);
-#endif
+   VOP_UNLOCK(*vpp, 0);
} else {
err = gfs_vop_lookup(dvp, nm, vpp, pnp, flags, rdir,
cr, ct, direntflags, realpnp);
@@ -609,7 +598,6 @@ zfsctl_freebsd_root_lookup(ap)
vnode_t **vpp = ap->a_vpp;
cred_t *cr = ap->a_cnp->cn_cred;
int flags = ap->a_cnp->cn_flags;
-   int lkflags = ap->a_cnp->cn_lkflags;
int nameiop = ap->a_cnp->cn_nameiop;
char nm[NAME_MAX + 1];
int err;
@@ -621,18 +609,8 @@ zfsctl_freebsd_root_lookup(ap)
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
 
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
-   if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
-   if (flags & ISDOTDOT)
-   VOP_UNLOCK(dvp, 0);
-   err = vn_lock(*vpp, lkflags);
-   if (err != 0) {
-   vrele(*vpp);
-   *vpp = NULL;
-   }
-   if (flags & ISDOTDOT)
-   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
-   }
-
+   if (err == 0 && (nm[0] != '.' || nm[1] != '\0'))
+   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
return (err);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302753 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:18:29 2016
New Revision: 302753
URL: https://svnweb.freebsd.org/changeset/base/302753

Log:
  MFC r299946: gfs_lookup_dot() does not have to acquire any locks

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:16:45 2016(r302752)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:18:29 2016(r302753)
@@ -534,9 +534,20 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
ZFS_ENTER(zfsvfs);
 
if (strcmp(nm, "..") == 0) {
+#ifdef illumos
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp);
+#else
+   /*
+* NB: can not use VFS_ROOT here as it would acquire
+* the vnode lock of the parent (root) vnode while
+* holding the child's (.zfs) lock.
+*/
+   znode_t *rootzp;
+
+   err = zfs_zget(zfsvfs, zfsvfs->z_root, );
if (err == 0)
-   VOP_UNLOCK(*vpp, 0);
+   *vpp = ZTOV(rootzp);
+#endif
} else {
err = gfs_vop_lookup(dvp, nm, vpp, pnp, flags, rdir,
cr, ct, direntflags, realpnp);
@@ -598,6 +609,7 @@ zfsctl_freebsd_root_lookup(ap)
vnode_t **vpp = ap->a_vpp;
cred_t *cr = ap->a_cnp->cn_cred;
int flags = ap->a_cnp->cn_flags;
+   int lkflags = ap->a_cnp->cn_lkflags;
int nameiop = ap->a_cnp->cn_nameiop;
char nm[NAME_MAX + 1];
int err;
@@ -609,8 +621,18 @@ zfsctl_freebsd_root_lookup(ap)
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
 
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
-   if (err == 0 && (nm[0] != '.' || nm[1] != '\0'))
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
+   if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
+   if (flags & ISDOTDOT)
+   VOP_UNLOCK(dvp, 0);
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
+   }
+   if (flags & ISDOTDOT)
+   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   }
+
return (err);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302752 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:16:45 2016
New Revision: 302752
URL: https://svnweb.freebsd.org/changeset/base/302752

Log:
  MFC r299947: fix locking in zfsctl_root_lookup

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:14:36 2016(r302751)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:16:45 2016(r302752)
@@ -551,9 +551,20 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
ZFS_ENTER(zfsvfs);
 
if (strcmp(nm, "..") == 0) {
+#ifdef illumos
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp);
+#else
+   /*
+* NB: can not use VFS_ROOT here as it would acquire
+* the vnode lock of the parent (root) vnode while
+* holding the child's (.zfs) lock.
+*/
+   znode_t *rootzp;
+
+   err = zfs_zget(zfsvfs, zfsvfs->z_root, );
if (err == 0)
-   VOP_UNLOCK(*vpp, 0);
+   *vpp = ZTOV(rootzp);
+#endif
} else {
err = gfs_vop_lookup(dvp, nm, vpp, pnp, flags, rdir,
cr, ct, direntflags, realpnp);
@@ -626,10 +637,10 @@ zfsctl_freebsd_root_lookup(ap)
vnode_t **vpp = ap->a_vpp;
cred_t *cr = ap->a_cnp->cn_cred;
int flags = ap->a_cnp->cn_flags;
+   int lkflags = ap->a_cnp->cn_lkflags;
int nameiop = ap->a_cnp->cn_nameiop;
char nm[NAME_MAX + 1];
int err;
-   int ltype;
 
if ((flags & ISLASTCN) && (nameiop == RENAME || nameiop == CREATE))
return (EOPNOTSUPP);
@@ -638,16 +649,15 @@ zfsctl_freebsd_root_lookup(ap)
strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1);
err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, 
NULL);
if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) {
-   ltype = VOP_ISLOCKED(dvp);
-   if (flags & ISDOTDOT) {
-   VN_HOLD(*vpp);
+   if (flags & ISDOTDOT)
VOP_UNLOCK(dvp, 0);
+   err = vn_lock(*vpp, lkflags);
+   if (err != 0) {
+   vrele(*vpp);
+   *vpp = NULL;
}
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
-   if (flags & ISDOTDOT) {
-   VN_RELE(*vpp);
-   vn_lock(dvp, ltype| LK_RETRY);
-   }
+   if (flags & ISDOTDOT)
+   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
}
 
return (err);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302751 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs: . zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:14:36 2016
New Revision: 302751
URL: https://svnweb.freebsd.org/changeset/base/302751

Log:
  MFC r299946: gfs_lookup_dot() does not have to acquire any locks

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:13:28 2016(r302750)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c   Wed Jul 13 
10:14:36 2016(r302751)
@@ -440,14 +440,9 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d
*vpp = dvp;
return (0);
} else if (strcmp(nm, "..") == 0) {
-   if (pvp == NULL) {
-   ASSERT(dvp->v_flag & VROOT);
-   VN_HOLD(dvp);
-   *vpp = dvp;
-   } else {
-   VN_HOLD(pvp);
-   *vpp = pvp;
-   }
+   ASSERT(pvp != NULL);
+   VN_HOLD(pvp);
+   *vpp = pvp;
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
return (0);
}

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:13:28 2016(r302750)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:14:36 2016(r302751)
@@ -973,6 +973,11 @@ zfsctl_snapdir_lookup(ap)
ZFS_ENTER(zfsvfs);
 
if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) {
+   if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') {
+   VOP_UNLOCK(dvp, 0);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   VERIFY0(vn_lock(dvp, LK_EXCLUSIVE));
+   }
ZFS_EXIT(zfsvfs);
return (0);
}
@@ -1129,6 +1134,11 @@ zfsctl_shares_lookup(ap)
strlcpy(nm, cnp->cn_nameptr, cnp->cn_namelen + 1);
 
if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) {
+   if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') {
+   VOP_UNLOCK(dvp, 0);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   VERIFY0(vn_lock(dvp, LK_EXCLUSIVE));
+   }
ZFS_EXIT(zfsvfs);
return (0);
}
@@ -1467,7 +1477,6 @@ zfsctl_snapshot_inactive(ap)
 
VERIFY(gfs_dir_lookup(vp, "..", , cr, 0, NULL, NULL) == 0);
sdp = dvp->v_data;
-   VOP_UNLOCK(dvp, 0);
 
if (!(locked = MUTEX_HELD(>sd_lock)))
mutex_enter(>sd_lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302750 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs: . zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:13:28 2016
New Revision: 302750
URL: https://svnweb.freebsd.org/changeset/base/302750

Log:
  MFC r299946: gfs_lookup_dot() does not have to acquire any locks

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c  Wed Jul 13 
10:11:57 2016(r302749)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c  Wed Jul 13 
10:13:28 2016(r302750)
@@ -442,19 +442,9 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d
*vpp = dvp;
return (0);
} else if (strcmp(nm, "..") == 0) {
-   if (pvp == NULL) {
-   ASSERT(dvp->v_flag & VROOT);
-   VN_HOLD(dvp);
-   *vpp = dvp;
-   ASSERT_VOP_ELOCKED(dvp, "gfs_lookup_dot: non-locked 
dvp");
-   } else {
-   ltype = VOP_ISLOCKED(dvp);
-   VOP_UNLOCK(dvp, 0);
-   VN_HOLD(pvp);
-   *vpp = pvp;
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
-   vn_lock(dvp, ltype | LK_RETRY);
-   }
+   ASSERT(pvp != NULL);
+   VN_HOLD(pvp);
+   *vpp = pvp;
return (0);
}
 

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:11:57 2016(r302749)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:13:28 2016(r302750)
@@ -1013,6 +1013,11 @@ zfsctl_snapdir_lookup(ap)
 
ZFS_ENTER(zfsvfs);
if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) {
+   if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') {
+   VOP_UNLOCK(dvp, 0);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   VERIFY0(vn_lock(dvp, LK_EXCLUSIVE));
+   }
ZFS_EXIT(zfsvfs);
return (0);
}
@@ -1169,6 +1174,11 @@ zfsctl_shares_lookup(ap)
strlcpy(nm, cnp->cn_nameptr, cnp->cn_namelen + 1);
 
if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) {
+   if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') {
+   VOP_UNLOCK(dvp, 0);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   VERIFY0(vn_lock(dvp, LK_EXCLUSIVE));
+   }
ZFS_EXIT(zfsvfs);
return (0);
}
@@ -1534,7 +1544,6 @@ zfsctl_snapshot_reclaim(ap)
 
VERIFY(gfs_dir_lookup(vp, "..", , cr, 0, NULL, NULL) == 0);
sdp = dvp->v_data;
-   VOP_UNLOCK(dvp, 0);
/* this may already have been unmounted */
if (sdp == NULL) {
VN_RELE(dvp);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302749 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:11:57 2016
New Revision: 302749
URL: https://svnweb.freebsd.org/changeset/base/302749

Log:
  MFC r299945: avoid deadlock between zfsctl_snapdir_lookup and
  zfsctl_snapshot_reclaim

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:11:48 2016(r302748)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:11:57 2016(r302749)
@@ -997,6 +997,7 @@ zfsctl_snapdir_lookup(ap)
 #endif
}
 
+relookup:
mutex_enter(>sd_lock);
search.se_name = (char *)nm;
if ((sep = avl_find(>sd_snaps, , )) != NULL) {
@@ -1064,7 +1065,16 @@ domount:
(void) snprintf(mountpoint, mountpoint_len,
"%s/" ZFS_CTLDIR_NAME "/snapshot/%s",
dvp->v_vfsp->mnt_stat.f_mntonname, nm);
-   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   mutex_exit(>sd_lock);
+
+   /*
+* The vnode may get reclaimed between dropping sd_lock and
+* getting the vnode lock.
+* */
+   err = vn_lock(*vpp, LK_EXCLUSIVE);
+   if (err == ENOENT)
+   goto relookup;
+   VERIFY0(err);
err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0);
kmem_free(mountpoint, mountpoint_len);
if (err == 0) {
@@ -1078,7 +1088,6 @@ domount:
ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs);
VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs;
}
-   mutex_exit(>sd_lock);
ZFS_EXIT(zfsvfs);
 
 #ifdef illumos
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302748 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:11:48 2016
New Revision: 302748
URL: https://svnweb.freebsd.org/changeset/base/302748

Log:
  MFC r299945: avoid deadlock between zfsctl_snapdir_lookup and
  zfsctl_snapshot_reclaim

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:10:21 2016(r302747)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:11:48 2016(r302748)
@@ -1037,6 +1037,7 @@ zfsctl_snapdir_lookup(ap)
 #endif
}
 
+relookup:
mutex_enter(>sd_lock);
search.se_name = (char *)nm;
if ((sep = avl_find(>sd_snaps, , )) != NULL) {
@@ -1104,7 +1105,16 @@ domount:
(void) snprintf(mountpoint, mountpoint_len,
"%s/" ZFS_CTLDIR_NAME "/snapshot/%s",
dvp->v_vfsp->mnt_stat.f_mntonname, nm);
-   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
+   mutex_exit(>sd_lock);
+
+   /*
+* The vnode may get reclaimed between dropping sd_lock and
+* getting the vnode lock.
+* */
+   err = vn_lock(*vpp, LK_EXCLUSIVE);
+   if (err == ENOENT)
+   goto relookup;
+   VERIFY0(err);
err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0);
kmem_free(mountpoint, mountpoint_len);
if (err == 0) {
@@ -1118,7 +1128,6 @@ domount:
ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs);
VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs;
}
-   mutex_exit(>sd_lock);
ZFS_EXIT(zfsvfs);
 
 #ifdef illumos
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302747 - in stable/9/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:10:21 2016
New Revision: 302747
URL: https://svnweb.freebsd.org/changeset/base/302747

Log:
  MFC r299940: fix a vnode reference leak caused by illumos compat traverse()

Modified:
  stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==
--- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Wed Jul 
13 10:10:05 2016(r302746)
+++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Wed Jul 
13 10:10:21 2016(r302747)
@@ -89,6 +89,7 @@ traverse(vnode_t **cvpp, int lktype)
if (vfsp == NULL)
break;
error = vfs_busy(vfsp, 0);
+
/*
 * tvp is NULL for *cvpp vnode, which we can't unlock.
 */

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:10:05 2016(r302746)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:10:21 2016(r302747)
@@ -1004,7 +1004,6 @@ zfsctl_snapdir_lookup(ap)
VN_HOLD(*vpp);
err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY);
if (err != 0) {
-   VN_RELE(*vpp);
*vpp = NULL;
} else if (*vpp == sep->se_root) {
/*
@@ -1587,16 +1586,15 @@ zfsctl_lookup_objset(vfs_t *vfsp, uint64
 */
error = traverse(, LK_SHARED | LK_RETRY);
if (error == 0) {
-   if (vp == sep->se_root)
+   if (vp == sep->se_root) {
+   VN_RELE(vp);/* release covered vp */
error = SET_ERROR(EINVAL);
-   else
+   } else {
*zfsvfsp = VTOZ(vp)->z_zfsvfs;
+   VN_URELE(vp);   /* put snapshot's root vp */
+   }
}
mutex_exit(>sd_lock);
-   if (error == 0)
-   VN_URELE(vp);
-   else
-   VN_RELE(vp);
} else {
error = SET_ERROR(EINVAL);
mutex_exit(>sd_lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302746 - in stable/10/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:10:05 2016
New Revision: 302746
URL: https://svnweb.freebsd.org/changeset/base/302746

Log:
  MFC r299940: fix a vnode reference leak caused by illumos compat traverse()

Modified:
  stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Wed Jul 
13 10:06:17 2016(r302745)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Wed Jul 
13 10:10:05 2016(r302746)
@@ -89,13 +89,14 @@ traverse(vnode_t **cvpp, int lktype)
if (vfsp == NULL)
break;
error = vfs_busy(vfsp, 0);
+
/*
 * tvp is NULL for *cvpp vnode, which we can't unlock.
-* At least some callers expect the reference to be
-* maintained to the original *cvpp
 */
if (tvp != NULL)
vput(cvp);
+   else
+   vrele(cvp);
if (error)
return (error);
 

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:06:17 2016(r302745)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:10:05 2016(r302746)
@@ -1044,7 +1044,6 @@ zfsctl_snapdir_lookup(ap)
VN_HOLD(*vpp);
err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY);
if (err != 0) {
-   VN_RELE(*vpp);
*vpp = NULL;
} else if (*vpp == sep->se_root) {
/*
@@ -1675,16 +1674,15 @@ zfsctl_lookup_objset(vfs_t *vfsp, uint64
 */
error = traverse(, LK_SHARED | LK_RETRY);
if (error == 0) {
-   if (vp == sep->se_root)
+   if (vp == sep->se_root) {
+   VN_RELE(vp);/* release covered vp */
error = SET_ERROR(EINVAL);
-   else
+   } else {
*zfsvfsp = VTOZ(vp)->z_zfsvfs;
+   VN_URELE(vp);   /* put snapshot's root vp */
+   }
}
mutex_exit(>sd_lock);
-   if (error == 0)
-   VN_URELE(vp);
-   else
-   VN_RELE(vp);
} else {
error = SET_ERROR(EINVAL);
mutex_exit(>sd_lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys

2016-07-13 Thread Hans Petter Selasky

Hi,

Can we agree on the following return values for callout_stop() and 
callout_reset() and their variants:


If the callout was scheduled regardless of being serviced or not,
.Dv CALLOUT_RET_CANCELLED
is returned.
If the callout was stopped and is still being serviced
.Dv CALLOUT_RET_DRAINING
is returned.
If the callout was stopped and is no longer being serviced
.Dv CALLOUT_RET_STOPPED
is returned.

--HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302745 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:06:17 2016
New Revision: 302745
URL: https://svnweb.freebsd.org/changeset/base/302745

Log:
  MFC r299914: zfsctl_ops_snapshot: remove methods should never be called

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:03:14 2016(r302744)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 10:06:17 2016(r302745)
@@ -1497,92 +1497,6 @@ end:
 }
 
 static int
-zfsctl_traverse_begin(vnode_t **vpp, int lktype)
-{
-
-   VN_HOLD(*vpp);
-   /* Snapshot should be already mounted, but just in case. */
-   if (vn_mountedvfs(*vpp) == NULL)
-   return (ENOENT);
-   return (traverse(vpp, lktype));
-}
-
-static void
-zfsctl_traverse_end(vnode_t *vp, int err)
-{
-
-   if (err == 0)
-   vput(vp);
-   else
-   VN_RELE(vp);
-}
-
-static int
-zfsctl_snapshot_getattr(ap)
-   struct vop_getattr_args /* {
-   struct vnode *a_vp;
-   struct vattr *a_vap;
-   struct ucred *a_cred;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-   int err;
-
-   err = zfsctl_traverse_begin(, LK_SHARED | LK_RETRY);
-   if (err == 0)
-   err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred);
-   zfsctl_traverse_end(vp, err);
-   return (err);
-}
-
-static int
-zfsctl_snapshot_fid(ap)
-   struct vop_fid_args /* {
-   struct vnode *a_vp;
-   struct fid *a_fid;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-   int err;
-
-   err = zfsctl_traverse_begin(, LK_SHARED | LK_RETRY);
-   if (err == 0)
-   err = VOP_VPTOFH(vp, (void *)ap->a_fid);
-   zfsctl_traverse_end(vp, err);
-   return (err);
-}
-
-static int
-zfsctl_snapshot_lookup(ap)
-   struct vop_lookup_args /* {
-   struct vnode *a_dvp;
-   struct vnode **a_vpp;
-   struct componentname *a_cnp;
-   } */ *ap;
-{
-   vnode_t *dvp = ap->a_dvp;
-   vnode_t **vpp = ap->a_vpp;
-   struct componentname *cnp = ap->a_cnp;
-   cred_t *cr = ap->a_cnp->cn_cred;
-   zfsvfs_t *zfsvfs = dvp->v_vfsp->vfs_data;
-   int error;
-
-   if (cnp->cn_namelen != 2 || cnp->cn_nameptr[0] != '.' ||
-   cnp->cn_nameptr[1] != '.') {
-   return (ENOENT);
-   }
-
-   ASSERT(dvp->v_type == VDIR);
-   ASSERT(zfsvfs->z_ctldir != NULL);
-
-   error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", vpp,
-   NULL, 0, NULL, cr, NULL, NULL, NULL);
-   if (error == 0)
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
-   return (error);
-}
-
-static int
 zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap)
 {
zfsvfs_t *zfsvfs = ap->a_vp->v_vfsp->vfs_data;
@@ -1631,10 +1545,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
 static struct vop_vector zfsctl_ops_snapshot = {
.vop_default =  _vnodeops,
.vop_inactive = zfsctl_snapshot_inactive,
-   .vop_lookup =   zfsctl_snapshot_lookup,
.vop_reclaim =  zfsctl_common_reclaim,
-   .vop_getattr =  zfsctl_snapshot_getattr,
-   .vop_fid =  zfsctl_snapshot_fid,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302743 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 10:02:39 2016
New Revision: 302743
URL: https://svnweb.freebsd.org/changeset/base/302743

Log:
  MFC r299914: zfsctl_ops_snapshot: remove methods should never be called

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:01:31 2016(r302742)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 10:02:39 2016(r302743)
@@ -1569,99 +1569,6 @@ zfsctl_snapshot_reclaim(ap)
 }
 
 static int
-zfsctl_traverse_begin(vnode_t **vpp, int lktype)
-{
-
-   VN_HOLD(*vpp);
-   /* Snapshot should be already mounted, but just in case. */
-   if (vn_mountedvfs(*vpp) == NULL)
-   return (ENOENT);
-   return (traverse(vpp, lktype));
-}
-
-static void
-zfsctl_traverse_end(vnode_t *vp, int err)
-{
-
-   if (err == 0)
-   vput(vp);
-   else
-   VN_RELE(vp);
-}
-
-static int
-zfsctl_snapshot_getattr(ap)
-   struct vop_getattr_args /* {
-   struct vnode *a_vp;
-   struct vattr *a_vap;
-   struct ucred *a_cred;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-   int err;
-
-   err = zfsctl_traverse_begin(, LK_SHARED | LK_RETRY);
-   if (err == 0)
-   err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred);
-   zfsctl_traverse_end(vp, err);
-   return (err);
-}
-
-static int
-zfsctl_snapshot_fid(ap)
-   struct vop_fid_args /* {
-   struct vnode *a_vp;
-   struct fid *a_fid;
-   } */ *ap;
-{
-   vnode_t *vp = ap->a_vp;
-   int err;
-
-   err = zfsctl_traverse_begin(, LK_SHARED | LK_RETRY);
-   if (err == 0)
-   err = VOP_VPTOFH(vp, (void *)ap->a_fid);
-   zfsctl_traverse_end(vp, err);
-   return (err);
-}
-
-static int
-zfsctl_snapshot_lookup(ap)
-   struct vop_lookup_args /* {
-   struct vnode *a_dvp;
-   struct vnode **a_vpp;
-   struct componentname *a_cnp;
-   } */ *ap;
-{
-   vnode_t *dvp = ap->a_dvp;
-   vnode_t **vpp = ap->a_vpp;
-   struct componentname *cnp = ap->a_cnp;
-   cred_t *cr = ap->a_cnp->cn_cred;
-   zfsvfs_t *zfsvfs = dvp->v_vfsp->vfs_data;
-   int error;
-
-   if (cnp->cn_namelen != 2 || cnp->cn_nameptr[0] != '.' ||
-   cnp->cn_nameptr[1] != '.') {
-   return (ENOENT);
-   }
-
-   ASSERT(dvp->v_type == VDIR);
-   ASSERT(zfsvfs->z_ctldir != NULL);
-
-   error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", vpp,
-   NULL, 0, NULL, cr, NULL, NULL, NULL);
-   if (error == 0) {
-   int ltype = VOP_ISLOCKED(dvp);
-   VN_HOLD(*vpp);
-   VOP_UNLOCK(dvp, 0);
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
-   VN_RELE(*vpp);
-   vn_lock(dvp, ltype | LK_RETRY);
-   }
-
-   return (error);
-}
-
-static int
 zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap)
 {
zfsvfs_t *zfsvfs = ap->a_vp->v_vfsp->vfs_data;
@@ -1725,10 +1632,7 @@ zfsctl_snaphot_print(ap)
 static struct vop_vector zfsctl_ops_snapshot = {
.vop_default =  _vnodeops,
.vop_inactive = VOP_NULL,
-   .vop_lookup =   zfsctl_snapshot_lookup,
.vop_reclaim =  zfsctl_snapshot_reclaim,
-   .vop_getattr =  zfsctl_snapshot_getattr,
-   .vop_fid =  zfsctl_snapshot_fid,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
.vop_print =zfsctl_snaphot_print,
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302742 - head/contrib/one-true-awk

2016-07-13 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 13 10:01:31 2016
New Revision: 302742
URL: https://svnweb.freebsd.org/changeset/base/302742

Log:
  After removing collation for [a-z] ranges in r302512, do it here too.
  
  I'll try to keep the change very minimal to not touch contribed code much.
  I'll send it upstream when it will be merged to main branches,
  but we need the change right now here.

Modified:
  head/contrib/one-true-awk/b.c

Modified: head/contrib/one-true-awk/b.c
==
--- head/contrib/one-true-awk/b.c   Wed Jul 13 09:50:17 2016
(r302741)
+++ head/contrib/one-true-awk/b.c   Wed Jul 13 10:01:31 2016
(r302742)
@@ -296,7 +296,11 @@ static int collate_range_cmp(int a, int 
return 0;
s[0][0] = a;
s[1][0] = b;
+#ifdef __FreeBSD__
+   return (strcmp(s[0], s[1]));
+#else
return (strcoll(s[0], s[1]));
+#endif
 }
 
 char *cclenter(const char *argp)   /* add a character class */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys

2016-07-13 Thread Hans Petter Selasky

On 07/13/16 10:49, Roger Pau Monné wrote:

On Tue, Jul 05, 2016 at 06:47:18PM +, Gleb Smirnoff wrote:

Author: glebius
Date: Tue Jul  5 18:47:17 2016
New Revision: 302350
URL: https://svnweb.freebsd.org/changeset/base/302350

Log:
  The paradigm of a callout is that it has three consequent states:
  not scheduled -> scheduled -> running -> not scheduled. The API and the
  manual page assume that, some comments in the code assume that, and looks
  like some contributors to the code also did. The problem is that this
  paradigm isn't true. A callout can be scheduled and running at the same
  time, which makes API description ambigouous. In such case callout_stop()
  family of functions/macros should return 1 and 0 at the same time, since it
  successfully unscheduled future callout but the current one is running.
  Before this change we returned 1 in such a case, with an exception that
  if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
  specified.

  With this change, we now return 0 in case if future callout was unscheduled,
  but another one is still in action, indicating to API users that resources
  are not yet safe to be freed.

  However, the sleepqueue code relies on getting 1 return code in that case,
  and there already was CS_MIGRBLOCK flag, that covered one of the edge cases.
  In the new return path we will also use this flag, to keep sleepqueue safe.

  Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited to
  migration edge case, rename it to CS_EXECUTING.

  This change fixes panics on a high loaded TCP server.

  Reviewed by:  jch, hselasky, rrs, kib
  Approved by:  re (gjb)
  Differential Revision:https://reviews.freebsd.org/D7042


This change triggers a KASSERT when resuming a Xen VM from suspension:

panic: bogus refcnt 0 on lle 0xf800035b9c00
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe001d2fa800
vpanic() at vpanic+0x182/frame 0xfe001d2fa880
kassert_panic() at kassert_panic+0x126/frame 0xfe001d2fa8f0
llentry_free() at llentry_free+0x136/frame 0xfe001d2fa920
in_lltable_free_entry() at in_lltable_free_entry+0xb0/frame 0xfe001d2fa950
arp_ifinit() at arp_ifinit+0x54/frame 0xfe001d2fa980
netfront_backend_changed() at netfront_backend_changed+0x154/frame 
0xfe001d2faa50
xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfe001d2faa70
fork_exit() at fork_exit+0x84/frame 0xfe001d2faab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe001d2faab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---

This seems to be caused by the following snipped in xen-netfront, which is
used by netfront in order to send a gratuitous ARP after recovering from
migration, in order for the bridge in the host to cache the MAC of the
domain.

TAILQ_FOREACH(ifa, >if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
arp_ifinit(ifp, ifa);
}
}

FWIW, this was working fine before this change, so I'm afraid this change
triggered some kind of bug in the lle entries.

Roger.



Hi,


static void
nd6_llinfo_settimer_locked(struct llentry *ln, long tick)
{
int canceled;

LLE_WLOCK_ASSERT(ln);

if (tick < 0) {
ln->la_expire = 0;
ln->ln_ntick = 0;
canceled = callout_stop(>lle_timer);
} else {
ln->la_expire = time_uptime + tick / hz;
LLE_ADDREF(ln);
if (tick > INT_MAX) {
ln->ln_ntick = tick - INT_MAX;
canceled = callout_reset(>lle_timer, INT_MAX,
nd6_llinfo_timer, ln);
} else {
ln->ln_ntick = 0;
canceled = callout_reset(>lle_timer, tick,
nd6_llinfo_timer, ln);
}
}
if (canceled > 0)
LLE_REMREF(ln);
}


Like stated in D7042, there are dependencies in the code that expects 
callout_reset() to work like this:


int
callout_reset()
{
atomic_lock();
retval = callout_stop();
restart callout();
atomic_unlock();

return (retval);
}

As you can see in the piece of code above. r302350 fundamentally changes 
that.



D7042 has many open questions that are not answered and I think it 
should be reverted from head and 11-stable until the discussions are 
complete.



I believe the problems found should be fixed in the TCP stack, using 
locked callouts instead of unlocked.



--HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302740 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:50:07 2016
New Revision: 302740
URL: https://svnweb.freebsd.org/changeset/base/302740

Log:
  MFC r301273: zfs_root: fix a potential root vnode reference leak

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:48:04 2016(r302739)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:50:07 2016(r302740)
@@ -1781,11 +1781,13 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
ZFS_EXIT(zfsvfs);
 
-   if (error == 0)
+   if (error == 0) {
error = vn_lock(*vpp, flags);
-   if (error != 0)
-   *vpp = NULL;
-
+   if (error != 0) {
+   VN_RELE(*vpp);
+   *vpp = NULL;
+   }
+   }
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302741 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:50:17 2016
New Revision: 302741
URL: https://svnweb.freebsd.org/changeset/base/302741

Log:
  MFC r301273: zfs_root: fix a potential root vnode reference leak

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:50:07 2016(r302740)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:50:17 2016(r302741)
@@ -1826,11 +1826,13 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
ZFS_EXIT(zfsvfs);
 
-   if (error == 0)
+   if (error == 0) {
error = vn_lock(*vpp, flags);
-   if (error != 0)
-   *vpp = NULL;
-
+   if (error != 0) {
+   VN_RELE(*vpp);
+   *vpp = NULL;
+   }
+   }
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302738 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:47:54 2016
New Revision: 302738
URL: https://svnweb.freebsd.org/changeset/base/302738

Log:
  MFC r299908,300131,301275: zfs: set VROOT / VV_ROOT consistently and in
  a single place

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:44:24 2016(r302737)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:47:54 2016(r302738)
@@ -1053,13 +1053,6 @@ zfsctl_snapdir_lookup(ap)
 */
VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, 
snapname) == 0);
goto domount;
-   } else {
-   /*
-* VROOT was set during the traverse call.  We need
-* to clear it since we're pretending to be part
-* of our parent's vfs.
-*/
-   (*vpp)->v_flag &= ~VROOT;
}
mutex_exit(>sd_lock);
ZFS_EXIT(zfsvfs);

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:44:24 2016(r302737)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:47:54 2016(r302738)
@@ -1781,11 +1781,8 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
ZFS_EXIT(zfsvfs);
 
-   if (error == 0) {
+   if (error == 0)
error = vn_lock(*vpp, flags);
-   if (error == 0)
-   (*vpp)->v_vflag |= VV_ROOT;
-   }
if (error != 0)
*vpp = NULL;
 

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Wed Jul 13 09:44:24 2016(r302737)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Wed Jul 13 09:47:54 2016(r302738)
@@ -574,9 +574,10 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znod
zp->z_is_sa = (obj_type == DMU_OT_SA) ? B_TRUE : B_FALSE;
 
/*
-* Slap on VROOT if we are the root znode
+* Slap on VROOT if we are the root znode unless we are the root
+* node of a snapshot mounted under .zfs.
 */
-   if (zp->z_id == zfsvfs->z_root)
+   if (zp->z_id == zfsvfs->z_root && zfsvfs->z_parent == zfsvfs)
ZTOV(zp)->v_flag |= VROOT;
 
mutex_exit(>z_lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302739 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:48:04 2016
New Revision: 302739
URL: https://svnweb.freebsd.org/changeset/base/302739

Log:
  MFC r299908,300131,301275: zfs: set VROOT / VV_ROOT consistently and in
  a single place

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:47:54 2016(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:48:04 2016(r302739)
@@ -1013,13 +1013,6 @@ zfsctl_snapdir_lookup(ap)
 */
VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, 
snapname) == 0);
goto domount;
-   } else {
-   /*
-* VROOT was set during the traverse call.  We need
-* to clear it since we're pretending to be part
-* of our parent's vfs.
-*/
-   (*vpp)->v_flag &= ~VROOT;
}
mutex_exit(>sd_lock);
ZFS_EXIT(zfsvfs);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:47:54 2016(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:48:04 2016(r302739)
@@ -1826,11 +1826,8 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
ZFS_EXIT(zfsvfs);
 
-   if (error == 0) {
+   if (error == 0)
error = vn_lock(*vpp, flags);
-   if (error == 0)
-   (*vpp)->v_vflag |= VV_ROOT;
-   }
if (error != 0)
*vpp = NULL;
 

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 
13 09:47:54 2016(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 
13 09:48:04 2016(r302739)
@@ -572,9 +572,10 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znod
zp->z_is_sa = (obj_type == DMU_OT_SA) ? B_TRUE : B_FALSE;
 
/*
-* Slap on VROOT if we are the root znode
+* Slap on VROOT if we are the root znode unless we are the root
+* node of a snapshot mounted under .zfs.
 */
-   if (zp->z_id == zfsvfs->z_root)
+   if (zp->z_id == zfsvfs->z_root && zfsvfs->z_parent == zfsvfs)
ZTOV(zp)->v_flag |= VROOT;
 
mutex_exit(>z_lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302737 - head/sys/dev/hyperv/vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 13 09:44:24 2016
New Revision: 302737
URL: https://svnweb.freebsd.org/changeset/base/302737

Log:
  hyperv/vmbus: Cleanup channel rescind
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7090

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/vmbus_reg.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:41:04 2016
(r302736)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:44:24 2016
(r302737)
@@ -47,10 +47,10 @@ static void vmbus_chan_detach_task(void 
 
 static voidvmbus_channel_on_offer(struct vmbus_softc *,
const struct vmbus_message *);
-static voidvmbus_channel_on_offer_rescind(struct vmbus_softc *,
-   const struct vmbus_message *);
 static voidvmbus_channel_on_offers_delivered(struct vmbus_softc *,
const struct vmbus_message *);
+static voidvmbus_chan_msgproc_chrescind(struct vmbus_softc *,
+   const struct vmbus_message *);
 
 /**
  * Channel message dispatch table
@@ -60,7 +60,7 @@ vmbus_chanmsg_process[HV_CHANNEL_MESSAGE
[HV_CHANNEL_MESSAGE_OFFER_CHANNEL] =
vmbus_channel_on_offer,
[HV_CHANNEL_MESSAGE_RESCIND_CHANNEL_OFFER] =
-   vmbus_channel_on_offer_rescind,
+   vmbus_chan_msgproc_chrescind,
[HV_CHANNEL_MESSAGE_ALL_OFFERS_DELIVERED] =
vmbus_channel_on_offers_delivered,
[HV_CHANNEL_MESSAGE_OPEN_CHANNEL_RESULT] =
@@ -326,33 +326,34 @@ vmbus_channel_on_offer_internal(struct v
vmbus_channel_process_offer(new_channel);
 }
 
-/**
- * @brief Rescind offer handler.
- *
- * We queue a work item to process this offer
- * synchronously.
- *
+/*
  * XXX pretty broken; need rework.
  */
 static void
-vmbus_channel_on_offer_rescind(struct vmbus_softc *sc,
+vmbus_chan_msgproc_chrescind(struct vmbus_softc *sc,
 const struct vmbus_message *msg)
 {
-   const hv_vmbus_channel_rescind_offer *rescind;
-   hv_vmbus_channel*   channel;
+   const struct vmbus_chanmsg_chrescind *note;
+   struct hv_vmbus_channel *chan;
+
+   note = (const struct vmbus_chanmsg_chrescind *)msg->msg_data;
+   if (note->chm_chanid > VMBUS_CHAN_MAX) {
+   device_printf(sc->vmbus_dev, "invalid rescinded chan%u\n",
+   note->chm_chanid);
+   return;
+   }
 
-   rescind = (const hv_vmbus_channel_rescind_offer *)msg->msg_data;
if (bootverbose) {
-   device_printf(sc->vmbus_dev, "chan%u rescind\n",
-   rescind->child_rel_id);
+   device_printf(sc->vmbus_dev, "chan%u rescinded\n",
+   note->chm_chanid);
}
 
-   channel = sc->vmbus_chmap[rescind->child_rel_id];
-   if (channel == NULL)
-   return;
-   sc->vmbus_chmap[rescind->child_rel_id] = NULL;
+   chan = sc->vmbus_chmap[note->chm_chanid];
+   if (chan == NULL)
+   return;
+   sc->vmbus_chmap[note->chm_chanid] = NULL;
 
-   taskqueue_enqueue(taskqueue_thread, >ch_detach_task);
+   taskqueue_enqueue(taskqueue_thread, >ch_detach_task);
 }
 
 static void

Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_reg.h   Wed Jul 13 09:41:04 2016
(r302736)
+++ head/sys/dev/hyperv/vmbus/vmbus_reg.h   Wed Jul 13 09:44:24 2016
(r302737)
@@ -117,10 +117,11 @@ struct vmbus_gpa_range {
 
 /*
  * Channel messages
- * - Embedded in vmbus_message.msg_data, e.g. response.
+ * - Embedded in vmbus_message.msg_data, e.g. response and notification.
  * - Embedded in hypercall_postmsg_in.hc_data, e.g. request.
  */
 
+#define VMBUS_CHANMSG_TYPE_CHRESCIND   2   /* NOTE */
 #define VMBUS_CHANMSG_TYPE_CHREQUEST   3   /* REQ */
 #define VMBUS_CHANMSG_TYPE_CHOPEN  5   /* REQ */
 #define VMBUS_CHANMSG_TYPE_CHOPEN_RESP 6   /* RESP */
@@ -241,4 +242,10 @@ struct vmbus_chanmsg_chfree {
uint32_tchm_chanid;
 } __packed;
 
+/* VMBUS_CHANMSG_TYPE_CHRESCIND */
+struct vmbus_chanmsg_chrescind {
+   struct vmbus_chanmsg_hdr chm_hdr;
+   uint32_tchm_chanid;
+} __packed;
+
 #endif /* !_VMBUS_REG_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302735 - in stable/10/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:40:53 2016
New Revision: 302735
URL: https://svnweb.freebsd.org/changeset/base/302735

Log:
  MFC r299902,299938: mount_snapshot: consolidate all error handling

Modified:
  stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.cWed Jul 
13 09:37:50 2016(r302734)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.cWed Jul 
13 09:40:53 2016(r302735)
@@ -121,34 +121,39 @@ mount_snapshot(kthread_t *td, vnode_t **
struct ucred *cr;
int error;
 
+   ASSERT_VOP_ELOCKED(*vpp, "mount_snapshot");
+
+   vp = *vpp;
+   *vpp = NULL;
+   error = 0;
+
/*
 * Be ultra-paranoid about making sure the type and fspath
 * variables will fit in our mp buffers, including the
 * terminating NUL.
 */
if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN)
-   return (ENAMETOOLONG);
-
-   vfsp = vfs_byname_kld(fstype, td, );
-   if (vfsp == NULL)
-   return (ENODEV);
-
-   vp = *vpp;
-   if (vp->v_type != VDIR)
-   return (ENOTDIR);
+   error = ENAMETOOLONG;
+   if (error == 0 && (vfsp = vfs_byname_kld(fstype, td, )) == NULL)
+   error = ENODEV;
+   if (error == 0 && vp->v_type != VDIR)
+   error = ENOTDIR;
/*
 * We need vnode lock to protect v_mountedhere and vnode interlock
 * to protect v_iflag.
 */
-   vn_lock(vp, LK_SHARED | LK_RETRY);
-   VI_LOCK(vp);
-   if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) {
+   if (error == 0) {
+   VI_LOCK(vp);
+   if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL)
+   vp->v_iflag |= VI_MOUNT;
+   else
+   error = EBUSY;
VI_UNLOCK(vp);
-   VOP_UNLOCK(vp, 0);
-   return (EBUSY);
}
-   vp->v_iflag |= VI_MOUNT;
-   VI_UNLOCK(vp);
+   if (error != 0) {
+   vput(vp);
+   return (error);
+   }
VOP_UNLOCK(vp, 0);
 
/*
@@ -198,7 +203,6 @@ mount_snapshot(kthread_t *td, vnode_t **
vfs_unbusy(mp);
vfs_freeopts(mp->mnt_optnew);
vfs_mount_destroy(mp);
-   *vpp = NULL;
return (error);
}
 

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:37:50 2016(r302734)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:40:53 2016(r302735)
@@ -1112,6 +1112,7 @@ domount:
(void) snprintf(mountpoint, mountpoint_len,
"%s/" ZFS_CTLDIR_NAME "/snapshot/%s",
dvp->v_vfsp->mnt_stat.f_mntonname, nm);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0);
kmem_free(mountpoint, mountpoint_len);
if (err == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302736 - in stable/9/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:41:04 2016
New Revision: 302736
URL: https://svnweb.freebsd.org/changeset/base/302736

Log:
  MFC r299902,299938: mount_snapshot: consolidate all error handling

Modified:
  stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jul 13 
09:40:53 2016(r302735)
+++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jul 13 
09:41:04 2016(r302736)
@@ -121,34 +121,39 @@ mount_snapshot(kthread_t *td, vnode_t **
struct ucred *cr;
int error;
 
+   ASSERT_VOP_ELOCKED(*vpp, "mount_snapshot");
+
+   vp = *vpp;
+   *vpp = NULL;
+   error = 0;
+
/*
 * Be ultra-paranoid about making sure the type and fspath
 * variables will fit in our mp buffers, including the
 * terminating NUL.
 */
if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN)
-   return (ENAMETOOLONG);
-
-   vfsp = vfs_byname_kld(fstype, td, );
-   if (vfsp == NULL)
-   return (ENODEV);
-
-   vp = *vpp;
-   if (vp->v_type != VDIR)
-   return (ENOTDIR);
+   error = ENAMETOOLONG;
+   if (error == 0 && (vfsp = vfs_byname_kld(fstype, td, )) == NULL)
+   error = ENODEV;
+   if (error == 0 && vp->v_type != VDIR)
+   error = ENOTDIR;
/*
 * We need vnode lock to protect v_mountedhere and vnode interlock
 * to protect v_iflag.
 */
-   vn_lock(vp, LK_SHARED | LK_RETRY);
-   VI_LOCK(vp);
-   if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) {
+   if (error == 0) {
+   VI_LOCK(vp);
+   if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL)
+   vp->v_iflag |= VI_MOUNT;
+   else
+   error = EBUSY;
VI_UNLOCK(vp);
-   VOP_UNLOCK(vp, 0);
-   return (EBUSY);
}
-   vp->v_iflag |= VI_MOUNT;
-   VI_UNLOCK(vp);
+   if (error != 0) {
+   vput(vp);
+   return (error);
+   }
VOP_UNLOCK(vp, 0);
 
/*
@@ -198,7 +203,6 @@ mount_snapshot(kthread_t *td, vnode_t **
vfs_unbusy(mp);
vfs_freeopts(mp->mnt_optnew);
vfs_mount_destroy(mp);
-   *vpp = NULL;
return (error);
}
 

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:40:53 2016(r302735)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:41:04 2016(r302736)
@@ -1072,6 +1072,7 @@ domount:
(void) snprintf(mountpoint, mountpoint_len,
"%s/" ZFS_CTLDIR_NAME "/snapshot/%s",
dvp->v_vfsp->mnt_stat.f_mntonname, nm);
+   VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE));
err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0);
kmem_free(mountpoint, mountpoint_len);
if (err == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302734 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:37:50 2016
New Revision: 302734
URL: https://svnweb.freebsd.org/changeset/base/302734

Log:
  MFC r299906,301870: add zfs_vptocnp with special handling for snapshots
  under .zfs
  
  Note that the change is adjusted for the lack of LK_VNHELD in this branch.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 
13 09:36:46 2016(r302733)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 
13 09:37:50 2016(r302734)
@@ -7036,6 +7036,53 @@ zfs_freebsd_aclcheck(ap)
return (EOPNOTSUPP);
 }
 
+static int
+zfs_vptocnp(struct vop_vptocnp_args *ap)
+{
+   vnode_t *covered_vp;
+   vnode_t *vp = ap->a_vp;;
+   zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
+   znode_t *zp = VTOZ(vp);
+   uint64_t parent;
+   int ltype;
+   int error;
+
+   ZFS_ENTER(zfsvfs);
+   ZFS_VERIFY_ZP(zp);
+
+   /*
+* If we are a snapshot mounted under .zfs, run the operation
+* on the covered vnode.
+*/
+   if ((error = sa_lookup(zp->z_sa_hdl,
+   SA_ZPL_PARENT(zfsvfs), , sizeof (parent))) != 0) {
+   ZFS_EXIT(zfsvfs);
+   return (error);
+   }
+
+   if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) {
+   ZFS_EXIT(zfsvfs);
+   return (vop_stdvptocnp(ap));
+   }
+   ZFS_EXIT(zfsvfs);
+
+   covered_vp = vp->v_mount->mnt_vnodecovered;
+   vhold(covered_vp);
+   ltype = VOP_ISLOCKED(vp);
+   VOP_UNLOCK(vp, 0);
+   error = vget(covered_vp, LK_EXCLUSIVE, curthread);
+   vdrop(covered_vp);
+   if (error == 0) {
+   error = VOP_VPTOCNP(covered_vp, ap->a_vpp, ap->a_cred,
+   ap->a_buf, ap->a_buflen);
+   vput(covered_vp);
+   }
+   vn_lock(vp, ltype | LK_RETRY);
+   if ((vp->v_iflag & VI_DOOMED) != 0)
+   error = SET_ERROR(ENOENT);
+   return (error);
+}
+
 struct vop_vector zfs_vnodeops;
 struct vop_vector zfs_fifoops;
 struct vop_vector zfs_shareops;
@@ -7081,6 +7128,7 @@ struct vop_vector zfs_vnodeops = {
.vop_aclcheck = zfs_freebsd_aclcheck,
.vop_getpages = zfs_freebsd_getpages,
.vop_putpages = zfs_freebsd_putpages,
+   .vop_vptocnp =  zfs_vptocnp,
 };
 
 struct vop_vector zfs_fifoops = {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302733 - head/sys/dev/hyperv/vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 13 09:36:46 2016
New Revision: 302733
URL: https://svnweb.freebsd.org/changeset/base/302733

Log:
  hyperv/vmbus: Remove unused code
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7089

Modified:
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Wed Jul 13 09:35:43 2016
(r302732)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Wed Jul 13 09:36:46 2016
(r302733)
@@ -97,67 +97,6 @@ typedef struct hv_vmbus_channel_packet_m
hv_vmbus_multipage_buffer   range;
 } __packed hv_vmbus_channel_packet_multipage_buffer;
 
-typedef union {
-   uint32_t as_uint32_t;
-   struct {
-   uint32_t group_enable :4;
-   uint32_t rsvd_z :28;
-   } u;
-} hv_vmbus_monitor_trigger_state;
-
-typedef union {
-   uint64_t as_uint64_t;
-   struct {
-   uint32_t pending;
-   uint32_t armed;
-   } u;
-} hv_vmbus_monitor_trigger_group;
-
-typedef struct {
-   hv_vmbus_connection_id  connection_id;
-   uint16_tflag_number;
-   uint16_trsvd_z;
-} hv_vmbus_monitor_parameter;
-
-/*
- * hv_vmbus_monitor_page Layout
- * --
- * | 0   | trigger_state (4 bytes) | Rsvd1 (4 bytes) |
- * | 8   | trigger_group[0]  |
- * | 10  | trigger_group[1]  |
- * | 18  | trigger_group[2]  |
- * | 20  | trigger_group[3]  |
- * | 28  | Rsvd2[0]  |
- * | 30  | Rsvd2[1]  |
- * | 38  | Rsvd2[2]  |
- * | 40  | next_check_time[0][0] | next_check_time[0][1] |
- * | ... |
- * | 240 | latency[0][0..3]  |
- * | 340 | Rsvz3[0]  |
- * | 440 | parameter[0][0]   |
- * | 448 | parameter[0][1]   |
- * | ... |
- * | 840 | Rsvd4[0]  |
- * --
- */
-
-typedef struct {
-   hv_vmbus_monitor_trigger_state  trigger_state;
-   uint32_trsvd_z1;
-
-   hv_vmbus_monitor_trigger_group  trigger_group[4];
-   uint64_trsvd_z2[3];
-
-   int32_t next_check_time[4][32];
-
-   uint16_tlatency[4][32];
-   uint64_trsvd_z3[32];
-
-   hv_vmbus_monitor_parameter  parameter[4][32];
-
-   uint8_t rsvd_z4[1984];
-} hv_vmbus_monitor_page;
-
 /*
  * Private, VM Bus functions
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302732 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:35:43 2016
New Revision: 302732
URL: https://svnweb.freebsd.org/changeset/base/302732

Log:
  MFC r299906,301870: add zfs_vptocnp with special handling for snapshots
  under .zfs
  
  Note that the changed is adjusted for the lack of LK_VNHELD in this
  branch.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Wed Jul 13 09:28:46 2016(r302731)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Wed Jul 13 09:35:43 2016(r302732)
@@ -7202,6 +7202,53 @@ zfs_freebsd_aclcheck(ap)
return (EOPNOTSUPP);
 }
 
+static int
+zfs_vptocnp(struct vop_vptocnp_args *ap)
+{
+   vnode_t *covered_vp;
+   vnode_t *vp = ap->a_vp;;
+   zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
+   znode_t *zp = VTOZ(vp);
+   uint64_t parent;
+   int ltype;
+   int error;
+
+   ZFS_ENTER(zfsvfs);
+   ZFS_VERIFY_ZP(zp);
+
+   /*
+* If we are a snapshot mounted under .zfs, run the operation
+* on the covered vnode.
+*/
+   if ((error = sa_lookup(zp->z_sa_hdl,
+   SA_ZPL_PARENT(zfsvfs), , sizeof (parent))) != 0) {
+   ZFS_EXIT(zfsvfs);
+   return (error);
+   }
+
+   if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) {
+   ZFS_EXIT(zfsvfs);
+   return (vop_stdvptocnp(ap));
+   }
+   ZFS_EXIT(zfsvfs);
+
+   covered_vp = vp->v_mount->mnt_vnodecovered;
+   vhold(covered_vp);
+   ltype = VOP_ISLOCKED(vp);
+   VOP_UNLOCK(vp, 0);
+   error = vget(covered_vp, LK_EXCLUSIVE, curthread);
+   vdrop(covered_vp);
+   if (error == 0) {
+   error = VOP_VPTOCNP(covered_vp, ap->a_vpp, ap->a_cred,
+   ap->a_buf, ap->a_buflen);
+   vput(covered_vp);
+   }
+   vn_lock(vp, ltype | LK_RETRY);
+   if ((vp->v_iflag & VI_DOOMED) != 0)
+   error = SET_ERROR(ENOENT);
+   return (error);
+}
+
 struct vop_vector zfs_vnodeops;
 struct vop_vector zfs_fifoops;
 struct vop_vector zfs_shareops;
@@ -7247,6 +7294,7 @@ struct vop_vector zfs_vnodeops = {
.vop_aclcheck = zfs_freebsd_aclcheck,
.vop_getpages = zfs_freebsd_getpages,
.vop_putpages = zfs_freebsd_putpages,
+   .vop_vptocnp =  zfs_vptocnp,
 };
 
 struct vop_vector zfs_fifoops = {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302731 - in head/sys/dev/hyperv: include vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 13 09:28:46 2016
New Revision: 302731
URL: https://svnweb.freebsd.org/changeset/base/302731

Log:
  hyperv/vmbus: Reorganize MNF event sending.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7088

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_reg.h
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hWed Jul 13 09:26:33 2016
(r302730)
+++ head/sys/dev/hyperv/include/hyperv.hWed Jul 13 09:28:46 2016
(r302731)
@@ -523,12 +523,13 @@ typedef struct hv_vmbus_channel {
hv_vmbus_channel_state  state;
uint32_tch_flags;   /* VMBUS_CHAN_FLAG_ */
uint32_tch_id;  /* channel id */
+
/*
 * These are based on the offer_msg.monitor_id.
 * Save it here for easy access.
 */
-   uint8_t monitor_group;
-   uint8_t monitor_bit;
+   int ch_montrig_idx; /* MNF trig index */
+   uint32_tch_montrig_mask;/* MNF trig mask */
 
uint32_tring_buffer_gpadl_handle;
/*

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel.c  Wed Jul 13 09:26:33 2016
(r302730)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c  Wed Jul 13 09:28:46 2016
(r302731)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static voidvmbus_channel_set_event(hv_vmbus_channel* channel);
+static voidvmbus_chan_send_event(hv_vmbus_channel* channel);
 static voidvmbus_chan_update_evtflagcnt(struct vmbus_softc *,
const struct hv_vmbus_channel *);
 static voidvmbus_chan_task(void *, int);
@@ -60,7 +60,7 @@ static void   vmbus_chan_task_nobatch(void
  *  @brief Trigger an event notification on the specified channel
  */
 static void
-vmbus_channel_set_event(hv_vmbus_channel *channel)
+vmbus_chan_send_event(hv_vmbus_channel *channel)
 {
struct vmbus_softc *sc = channel->vmbus_sc;
uint32_t chanid = channel->ch_id;
@@ -69,16 +69,12 @@ vmbus_channel_set_event(hv_vmbus_channel
1UL << (chanid & VMBUS_EVTFLAG_MASK));
 
if (channel->ch_flags & VMBUS_CHAN_FLAG_HASMNF) {
-   hv_vmbus_monitor_page *monitor_page;
-
-   monitor_page = sc->vmbus_mnf2;
-   synch_set_bit(channel->monitor_bit,
-   (uint32_t *)_page->
-   
trigger_group[channel->monitor_group].u.pending);
+   atomic_set_int(
+   >vmbus_mnf2->mnf_trigs[channel->ch_montrig_idx].mt_pending,
+   channel->ch_montrig_mask);
} else {
hypercall_signal_event(channel->ch_monprm_dma.hv_paddr);
}
-
 }
 
 static int
@@ -622,9 +618,8 @@ hv_vmbus_channel_send_packet(
_sig);
 
/* TODO: We should determine if this is optional */
-   if (ret == 0 && need_sig) {
-   vmbus_channel_set_event(channel);
-   }
+   if (ret == 0 && need_sig)
+   vmbus_chan_send_event(channel);
 
return (ret);
 }
@@ -690,9 +685,8 @@ hv_vmbus_channel_send_packet_pagebuffer(
_sig);
 
/* TODO: We should determine if this is optional */
-   if (ret == 0 && need_sig) {
-   vmbus_channel_set_event(channel);
-   }
+   if (ret == 0 && need_sig)
+   vmbus_chan_send_event(channel);
 
return (ret);
 }
@@ -766,9 +760,8 @@ hv_vmbus_channel_send_packet_multipagebu
_sig);
 
/* TODO: We should determine if this is optional */
-   if (ret == 0 && need_sig) {
-   vmbus_channel_set_event(channel);
-   }
+   if (ret == 0 && need_sig)
+   vmbus_chan_send_event(channel);
 
return (ret);
 }

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:26:33 2016
(r302730)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:28:46 2016
(r302731)
@@ -311,8 +311,14 @@ vmbus_channel_on_offer_internal(struct v
if (sc->vmbus_version != VMBUS_VERSION_WS2008)
new_channel->ch_monprm->mp_connid = offer->connection_id;
 
-   new_channel->monitor_group = (uint8_t) offer->monitor_id / 32;
-   new_channel->monitor_bit = (uint8_t) offer->monitor_id % 32;
+

svn commit: r302730 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:26:33 2016
New Revision: 302730
URL: https://svnweb.freebsd.org/changeset/base/302730

Log:
  MFC r300145: add vop_print methods to vnode operatios of various zfsctl
  node types

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:23:02 2016(r302729)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:26:33 2016(r302730)
@@ -294,6 +294,22 @@ zfsctl_root(znode_t *zp)
return (zp->z_zfsvfs->z_ctldir);
 }
 
+static int
+zfsctl_common_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   gfs_file_t *fp = vp->v_data;
+
+   printf("parent = %p\n", fp->gfs_parent);
+   printf("type = %d\n", fp->gfs_type);
+   printf("index = %d\n", fp->gfs_index);
+   printf("ino = %ju\n", (uintmax_t)fp->gfs_ino);
+   return (0);
+}
+
 /*
  * Common open routine.  Disallow any write access.
  */
@@ -548,6 +564,17 @@ zfsctl_root_lookup(vnode_t *dvp, char *n
return (err);
 }
 
+static int
+zfsctl_root_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   printf(".zfs node\n");
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 #ifdef illumos
 static int
 zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
@@ -641,6 +668,7 @@ static struct vop_vector zfsctl_ops_root
.vop_pathconf = zfsctl_pathconf,
 #endif
.vop_fid =  zfsctl_common_fid,
+   .vop_print =zfsctl_root_print,
 };
 
 /*
@@ -1374,6 +1402,32 @@ zfsctl_snapdir_inactive(ap)
return (0);
 }
 
+static int
+zfsctl_shares_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   printf(".zfs/shares node\n");
+   zfsctl_common_print(ap);
+   return (0);
+}
+
+static int
+zfsctl_snapdir_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   zfsctl_snapdir_t *sdp = vp->v_data;
+
+   printf(".zfs/snapshot node\n");
+   printf("number of children = %lu\n", avl_numnodes(>sd_snaps));
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 #ifdef illumos
 static const fs_operation_def_t zfsctl_tops_snapdir[] = {
{ VOPNAME_OPEN, { .vop_open = zfsctl_common_open }  },
@@ -1419,6 +1473,7 @@ static struct vop_vector zfsctl_ops_snap
.vop_inactive = zfsctl_snapdir_inactive,
.vop_reclaim =  zfsctl_common_reclaim,
.vop_fid =  zfsctl_common_fid,
+   .vop_print =zfsctl_snapdir_print,
 };
 
 static struct vop_vector zfsctl_ops_shares = {
@@ -1433,6 +1488,7 @@ static struct vop_vector zfsctl_ops_shar
.vop_inactive = VOP_NULL,
.vop_reclaim =  gfs_vop_reclaim,
.vop_fid =  zfsctl_shares_fid,
+   .vop_print =zfsctl_shares_print,
 };
 #endif /* illumos */
 
@@ -1653,6 +1709,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
return (error);
 }
 
+static int
+zfsctl_snaphot_print(ap)
+   struct vop_print_args /* {
+   struct vnode *a_vp;
+   } */ *ap;
+{
+   vnode_t *vp = ap->a_vp;
+   zfsctl_node_t *zcp = vp->v_data;
+
+   printf(".zfs/snapshot/ node\n");
+   printf("id = %ju\n", (uintmax_t)zcp->zc_id);
+   zfsctl_common_print(ap);
+   return (0);
+}
+
 /*
  * These VP's should never see the light of day.  They should always
  * be covered.
@@ -1665,6 +1736,7 @@ static struct vop_vector zfsctl_ops_snap
.vop_getattr =  zfsctl_snapshot_getattr,
.vop_fid =  zfsctl_snapshot_fid,
.vop_vptocnp =  zfsctl_snapshot_vptocnp,
+   .vop_print =zfsctl_snaphot_print,
 };
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302729 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:23:02 2016
New Revision: 302729
URL: https://svnweb.freebsd.org/changeset/base/302729

Log:
  MFC r301873: l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c  Wed Jul 
13 09:21:40 2016(r302728)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c  Wed Jul 
13 09:23:02 2016(r302729)
@@ -2332,6 +2332,7 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr
ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==,
hdr->b_l1hdr.b_buf->b_data);
ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF);
+   hdr->b_l1hdr.b_tmp_cdata = NULL;
return;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302728 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:21:40 2016
New Revision: 302728
URL: https://svnweb.freebsd.org/changeset/base/302728

Log:
  MFC r302123: fix deadlock-prone code in getzfsvfs()

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 
13 09:21:28 2016(r302727)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 
13 09:21:40 2016(r302728)
@@ -1428,6 +1428,7 @@ static int
 getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
 {
objset_t *os;
+   vfs_t *vfsp;
int error;
 
error = dmu_objset_hold(dsname, FTAG, );
@@ -1441,19 +1442,21 @@ getzfsvfs(const char *dsname, zfsvfs_t *
mutex_enter(>os_user_ptr_lock);
*zfvp = dmu_objset_get_user(os);
if (*zfvp) {
-#ifdef illumos
-   VFS_HOLD((*zfvp)->z_vfs);
-#else
-   if (vfs_busy((*zfvp)->z_vfs, 0) != 0) {
-   *zfvp = NULL;
-   error = SET_ERROR(ESRCH);
-   }
-#endif
+   vfsp = (*zfvp)->z_vfs;
+   vfs_ref(vfsp);
} else {
error = SET_ERROR(ESRCH);
}
mutex_exit(>os_user_ptr_lock);
dmu_objset_rele(os, FTAG);
+   if (error == 0) {
+   error = vfs_busy(vfsp, 0);
+   vfs_rel(vfsp);
+   if (error != 0) {
+   *zfvp = NULL;
+   error = SET_ERROR(ESRCH);
+   }
+   }
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302727 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:21:28 2016
New Revision: 302727
URL: https://svnweb.freebsd.org/changeset/base/302727

Log:
  MFC r302123: fix deadlock-prone code in getzfsvfs()

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Wed Jul 13 09:19:33 2016(r302726)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Wed Jul 13 09:21:28 2016(r302727)
@@ -1429,6 +1429,7 @@ static int
 getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
 {
objset_t *os;
+   vfs_t *vfsp;
int error;
 
error = dmu_objset_hold(dsname, FTAG, );
@@ -1442,19 +1443,21 @@ getzfsvfs(const char *dsname, zfsvfs_t *
mutex_enter(>os_user_ptr_lock);
*zfvp = dmu_objset_get_user(os);
if (*zfvp) {
-#ifdef illumos
-   VFS_HOLD((*zfvp)->z_vfs);
-#else
-   if (vfs_busy((*zfvp)->z_vfs, 0) != 0) {
-   *zfvp = NULL;
-   error = SET_ERROR(ESRCH);
-   }
-#endif
+   vfsp = (*zfvp)->z_vfs;
+   vfs_ref(vfsp);
} else {
error = SET_ERROR(ESRCH);
}
mutex_exit(>os_user_ptr_lock);
dmu_objset_rele(os, FTAG);
+   if (error == 0) {
+   error = vfs_busy(vfsp, 0);
+   vfs_rel(vfsp);
+   if (error != 0) {
+   *zfvp = NULL;
+   error = SET_ERROR(ESRCH);
+   }
+   }
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302726 - in head/sys/dev/hyperv: include vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 13 09:19:33 2016
New Revision: 302726
URL: https://svnweb.freebsd.org/changeset/base/302726

Log:
  hyperv: Signal event input parameter is shared w/ MNF
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7087

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hyperv.c
  head/sys/dev/hyperv/vmbus/hyperv_reg.h
  head/sys/dev/hyperv/vmbus/hyperv_var.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hWed Jul 13 09:15:12 2016
(r302725)
+++ head/sys/dev/hyperv/include/hyperv.hWed Jul 13 09:19:33 2016
(r302726)
@@ -551,8 +551,8 @@ typedef struct hv_vmbus_channel {
hv_vmbus_pfn_channel_callback   on_channel_callback;
void*   channel_callback_context;
 
-   struct hypercall_sigevt_in  *ch_sigevt;
-   struct hyperv_dma   ch_sigevt_dma;
+   struct hyperv_mon_param *ch_monprm;
+   struct hyperv_dma   ch_monprm_dma;
 
/*
 * From Win8, this field specifies the target virtual process

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel.c  Wed Jul 13 09:15:12 2016
(r302725)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c  Wed Jul 13 09:19:33 2016
(r302726)
@@ -76,7 +76,7 @@ vmbus_channel_set_event(hv_vmbus_channel
(uint32_t *)_page->

trigger_group[channel->monitor_group].u.pending);
} else {
-   hypercall_signal_event(channel->ch_sigevt_dma.hv_paddr);
+   hypercall_signal_event(channel->ch_monprm_dma.hv_paddr);
}
 
 }

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:15:12 2016
(r302725)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:19:33 2016
(r302726)
@@ -296,20 +296,20 @@ vmbus_channel_on_offer_internal(struct v
if (offer->monitor_allocated)
new_channel->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
 
-   new_channel->ch_sigevt = hyperv_dmamem_alloc(
+   new_channel->ch_monprm = hyperv_dmamem_alloc(
bus_get_dma_tag(sc->vmbus_dev),
-   HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hypercall_sigevt_in),
-   _channel->ch_sigevt_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO);
-   if (new_channel->ch_sigevt == NULL) {
-   device_printf(sc->vmbus_dev, "sigevt alloc failed\n");
+   HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hyperv_mon_param),
+   _channel->ch_monprm_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO);
+   if (new_channel->ch_monprm == NULL) {
+   device_printf(sc->vmbus_dev, "monprm alloc failed\n");
/* XXX */
mtx_destroy(_channel->sc_lock);
free(new_channel, M_DEVBUF);
return;
}
-   new_channel->ch_sigevt->hc_connid = VMBUS_CONNID_EVENT;
+   new_channel->ch_monprm->mp_connid = VMBUS_CONNID_EVENT;
if (sc->vmbus_version != VMBUS_VERSION_WS2008)
-   new_channel->ch_sigevt->hc_connid = offer->connection_id;
+   new_channel->ch_monprm->mp_connid = offer->connection_id;
 
new_channel->monitor_group = (uint8_t) offer->monitor_id / 32;
new_channel->monitor_bit = (uint8_t) offer->monitor_id % 32;

Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==
--- head/sys/dev/hyperv/vmbus/hyperv.c  Wed Jul 13 09:15:12 2016
(r302725)
+++ head/sys/dev/hyperv/vmbus/hyperv.c  Wed Jul 13 09:19:33 2016
(r302726)
@@ -109,10 +109,10 @@ hypercall_post_message(bus_addr_t msg_pa
 }
 
 uint64_t
-hypercall_signal_event(bus_addr_t sigevt_paddr)
+hypercall_signal_event(bus_addr_t monprm_paddr)
 {
return hypercall_md(hypercall_context.hc_addr,
-   HYPERCALL_SIGNAL_EVENT, sigevt_paddr, 0);
+   HYPERCALL_SIGNAL_EVENT, monprm_paddr, 0);
 }
 
 int

Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h
==
--- head/sys/dev/hyperv/vmbus/hyperv_reg.h  Wed Jul 13 09:15:12 2016
(r302725)
+++ head/sys/dev/hyperv/vmbus/hyperv_reg.h  Wed Jul 13 09:19:33 2016
(r302726)
@@ -133,6 +133,15 @@
 #define CPUID_LEAF_HV_HWFEATURES   0x4006
 
 /*
+ * Hyper-V Monitor Notification Facility
+ */
+struct hyperv_mon_param {
+   uint32_tmp_connid;
+   uint16_tmp_evtflag_ofs;
+   

svn commit: r302720 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:07:14 2016
New Revision: 302720
URL: https://svnweb.freebsd.org/changeset/base/302720

Log:
  MFC r300133: zfsctl_common_fid: remove redundant assignment

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:06:58 2016(r302719)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:07:14 2016(r302720)
@@ -403,8 +403,6 @@ zfsctl_common_fid(ap)
ZFS_EXIT(zfsvfs);
return (SET_ERROR(ENOSPC));
}
-#else
-   fidp->fid_len = SHORT_FID_LEN;
 #endif
 
zfid = (zfid_short_t *)fidp;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302725 - in stable/9/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:15:12 2016
New Revision: 302725
URL: https://svnweb.freebsd.org/changeset/base/302725

Log:
  MFC r299900: zfsctl: fix several problems with reference counts
  
  PR:   207464

Modified:
  stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jul 13 
09:14:45 2016(r302724)
+++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jul 13 
09:15:12 2016(r302725)
@@ -229,7 +229,7 @@ mount_snapshot(kthread_t *td, vnode_t **
vfs_event_signal(NULL, VQ_MOUNT, 0);
if (VFS_ROOT(mp, LK_EXCLUSIVE, ))
panic("mount: lost mount");
-   vput(vp);
+   VOP_UNLOCK(vp, 0);
vfs_unbusy(mp);
*vpp = mvp;
return (0);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:14:45 2016(r302724)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:15:12 2016(r302725)
@@ -1062,7 +1062,6 @@ zfsctl_snapdir_lookup(ap)
sep->se_name = kmem_alloc(strlen(nm) + 1, KM_SLEEP);
(void) strcpy(sep->se_name, nm);
*vpp = sep->se_root = zfsctl_snapshot_mknode(dvp, dmu_objset_id(snap));
-   VN_HOLD(*vpp);
avl_insert(>sd_snaps, sep, where);
 
dmu_objset_rele(snap, FTAG);
@@ -1439,7 +1438,6 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
 
vp = gfs_dir_create(sizeof (zfsctl_node_t), pvp, pvp->v_vfsp,
_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL);
-   VN_HOLD(vp);
zcp = vp->v_data;
zcp->zc_id = objset;
VOP_UNLOCK(vp, 0);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:14:45 2016(r302724)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:15:12 2016(r302725)
@@ -2051,12 +2051,6 @@ zfs_umount(vfs_t *vfsp, int fflag)
 */
if (zfsvfs->z_ctldir != NULL)
zfsctl_destroy(zfsvfs);
-   if (zfsvfs->z_issnap) {
-   vnode_t *svp = vfsp->mnt_vnodecovered;
-
-   if (svp->v_count >= 2)
-   VN_RELE(svp);
-   }
zfs_freevfs(vfsp);
 
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302724 - in stable/10/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:14:45 2016
New Revision: 302724
URL: https://svnweb.freebsd.org/changeset/base/302724

Log:
  MFC r299900: zfsctl: fix several problems with reference counts
  
  PR:   207464

Modified:
  stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.cWed Jul 
13 09:11:03 2016(r302723)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.cWed Jul 
13 09:14:45 2016(r302724)
@@ -229,7 +229,7 @@ mount_snapshot(kthread_t *td, vnode_t **
vfs_event_signal(NULL, VQ_MOUNT, 0);
if (VFS_ROOT(mp, LK_EXCLUSIVE, ))
panic("mount: lost mount");
-   vput(vp);
+   VOP_UNLOCK(vp, 0);
vfs_unbusy(mp);
*vpp = mvp;
return (0);

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:11:03 2016(r302723)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:14:45 2016(r302724)
@@ -1074,7 +1074,6 @@ zfsctl_snapdir_lookup(ap)
sep->se_name = kmem_alloc(strlen(nm) + 1, KM_SLEEP);
(void) strcpy(sep->se_name, nm);
*vpp = sep->se_root = zfsctl_snapshot_mknode(dvp, dmu_objset_id(snap));
-   VN_HOLD(*vpp);
avl_insert(>sd_snaps, sep, where);
 
dmu_objset_rele(snap, FTAG);
@@ -1452,7 +1451,6 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
 
vp = gfs_dir_create(sizeof (zfsctl_node_t), pvp, pvp->v_vfsp,
_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL);
-   VN_HOLD(vp);
zcp = vp->v_data;
zcp->zc_id = objset;
VOP_UNLOCK(vp, 0);

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:11:03 2016(r302723)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:14:45 2016(r302724)
@@ -2006,12 +2006,6 @@ zfs_umount(vfs_t *vfsp, int fflag)
 */
if (zfsvfs->z_ctldir != NULL)
zfsctl_destroy(zfsvfs);
-   if (zfsvfs->z_issnap) {
-   vnode_t *svp = vfsp->mnt_vnodecovered;
-
-   if (svp->v_count >= 2)
-   VN_RELE(svp);
-   }
zfs_freevfs(vfsp);
 
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302723 - head/sys/dev/hyperv/vmbus

2016-07-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 13 09:11:03 2016
New Revision: 302723
URL: https://svnweb.freebsd.org/changeset/base/302723

Log:
  hyperv: All Hypercall parameters have same alignment requirement.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7086

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hyperv_reg.h
  head/sys/dev/hyperv/vmbus/vmbus.c

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:09:34 2016
(r302722)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:11:03 2016
(r302723)
@@ -298,7 +298,7 @@ vmbus_channel_on_offer_internal(struct v
 
new_channel->ch_sigevt = hyperv_dmamem_alloc(
bus_get_dma_tag(sc->vmbus_dev),
-   HYPERCALL_SIGEVTIN_ALIGN, 0, sizeof(struct hypercall_sigevt_in),
+   HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hypercall_sigevt_in),
_channel->ch_sigevt_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO);
if (new_channel->ch_sigevt == NULL) {
device_printf(sc->vmbus_dev, "sigevt alloc failed\n");

Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h
==
--- head/sys/dev/hyperv/vmbus/hyperv_reg.h  Wed Jul 13 09:09:34 2016
(r302722)
+++ head/sys/dev/hyperv/vmbus/hyperv_reg.h  Wed Jul 13 09:11:03 2016
(r302723)
@@ -153,13 +153,22 @@
 /*
  * Hypercall input parameters
  */
+#define HYPERCALL_PARAM_ALIGN  8
+#if 0
+/*
+ * XXX
+ * <> requires
+ * input parameters size to be multiple of 8, however, many post
+ * message input parameters do _not_ meet this requirement.
+ */
+#define HYPERCALL_PARAM_SIZE_ALIGN 8
+#endif
 
 /*
  * HYPERCALL_POST_MESSAGE
  */
 #define HYPERCALL_POSTMSGIN_DSIZE_MAX  240
 #define HYPERCALL_POSTMSGIN_SIZE   256
-#define HYPERCALL_POSTMSGIN_ALIGN  8
 
 struct hypercall_postmsg_in {
uint32_thc_connid;
@@ -173,8 +182,6 @@ CTASSERT(sizeof(struct hypercall_postmsg
 /*
  * HYPERCALL_SIGNAL_EVENT
  */
-#define HYPERCALL_SIGEVTIN_ALIGN   8
-
 struct hypercall_sigevt_in {
uint32_thc_connid;
uint16_thc_evtflag_ofs;

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==
--- head/sys/dev/hyperv/vmbus/vmbus.c   Wed Jul 13 09:09:34 2016
(r302722)
+++ head/sys/dev/hyperv/vmbus/vmbus.c   Wed Jul 13 09:11:03 2016
(r302723)
@@ -130,7 +130,7 @@ vmbus_msghc_alloc(bus_dma_tag_t parent_d
mh = malloc(sizeof(*mh), M_DEVBUF, M_WAITOK | M_ZERO);
 
mh->mh_inprm = hyperv_dmamem_alloc(parent_dtag,
-   HYPERCALL_POSTMSGIN_ALIGN, 0, HYPERCALL_POSTMSGIN_SIZE,
+   HYPERCALL_PARAM_ALIGN, 0, HYPERCALL_POSTMSGIN_SIZE,
>mh_inprm_dma, BUS_DMA_WAITOK);
if (mh->mh_inprm == NULL) {
free(mh, M_DEVBUF);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302721 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:09:21 2016
New Revision: 302721
URL: https://svnweb.freebsd.org/changeset/base/302721

Log:
  MFC r298105: zfs: enable vn_io_fault support

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c  Wed Jul 
13 09:07:14 2016(r302720)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c  Wed Jul 
13 09:09:21 2016(r302721)
@@ -1083,8 +1083,13 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *u
else
XUIOSTAT_BUMP(xuiostat_rbuf_copied);
} else {
+#ifdef illumos
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_READ, uio);
+#else
+   err = vn_io_fault_uiomove((char *)db->db_data + bufoff,
+   tocpy, uio);
+#endif
}
if (err)
break;
@@ -1178,6 +1183,7 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *
else
dmu_buf_will_dirty(db, tx);
 
+#ifdef illumos
/*
 * XXX uiomove could block forever (eg. nfs-backed
 * pages).  There needs to be a uiolockdown() function
@@ -1186,6 +1192,10 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *
 */
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_WRITE, uio);
+#else
+   err = vn_io_fault_uiomove((char *)db->db_data + bufoff, tocpy,
+   uio);
+#endif
 
if (tocpy == db->db_size)
dmu_buf_fill_done(db, tx);

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:07:14 2016(r302720)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Wed Jul 13 09:09:21 2016(r302721)
@@ -1171,6 +1171,7 @@ zfs_domount(vfs_t *vfsp, char *osname)
vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED;
vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES;
vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED;
+   vfsp->mnt_kern_flag |= MNTK_NO_IOPF;/* vn_io_fault can be used */
 
/*
 * The fsid is 64 bits, composed of an 8-bit fs type, which

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Wed Jul 13 09:07:14 2016(r302720)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Wed Jul 13 09:09:21 2016(r302721)
@@ -655,7 +655,11 @@ mappedread(vnode_t *vp, int nbytes, uio_
 
zfs_vmobject_wunlock(obj);
va = zfs_map_page(pp, );
+#ifdef illumos
error = uiomove(va + off, bytes, UIO_READ, uio);
+#else
+   error = vn_io_fault_uiomove(va + off, bytes, uio);
+#endif
zfs_unmap_page(sf);
zfs_vmobject_wlock(obj);
page_unhold(pp);
@@ -1033,18 +1037,31 @@ zfs_write(vnode_t *vp, uio_t *uio, int i
 * holding up the transaction if the data copy hangs
 * up on a pagefault (e.g., from an NFS server mapping).
 */
+#ifdef illumos
size_t cbytes;
+#endif
 
abuf = dmu_request_arcbuf(sa_get_db(zp->z_sa_hdl),
max_blksz);
ASSERT(abuf != NULL);
ASSERT(arc_buf_size(abuf) == max_blksz);
+#ifdef illumos
if (error = uiocopy(abuf->b_data, max_blksz,
UIO_WRITE, uio, )) {
dmu_return_arcbuf(abuf);
break;
}
ASSERT(cbytes == max_blksz);
+#else
+   ssize_t resid = uio->uio_resid;
+   error = vn_io_fault_uiomove(abuf->b_data, max_blksz, 
uio);
+   if (error != 0) {
+   uio->uio_offset -= resid - uio->uio_resid;
+   uio->uio_resid = resid;
+   dmu_return_arcbuf(abuf);
+   

svn commit: r302722 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:09:34 2016
New Revision: 302722
URL: https://svnweb.freebsd.org/changeset/base/302722

Log:
  MFC r298105: zfs: enable vn_io_fault support

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Wed Jul 
13 09:09:21 2016(r302721)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Wed Jul 
13 09:09:34 2016(r302722)
@@ -1025,8 +1025,13 @@ dmu_read_uio(objset_t *os, uint64_t obje
else
XUIOSTAT_BUMP(xuiostat_rbuf_copied);
} else {
+#ifdef illumos
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_READ, uio);
+#else
+   err = vn_io_fault_uiomove((char *)db->db_data + bufoff,
+   tocpy, uio);
+#endif
}
if (err)
break;
@@ -1068,6 +1073,7 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *
else
dmu_buf_will_dirty(db, tx);
 
+#ifdef illumos
/*
 * XXX uiomove could block forever (eg. nfs-backed
 * pages).  There needs to be a uiolockdown() function
@@ -1076,6 +1082,10 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *
 */
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_WRITE, uio);
+#else
+   err = vn_io_fault_uiomove((char *)db->db_data + bufoff, tocpy,
+   uio);
+#endif
 
if (tocpy == db->db_size)
dmu_buf_fill_done(db, tx);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:09:21 2016(r302721)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Wed Jul 13 09:09:34 2016(r302722)
@@ -1182,6 +1182,7 @@ zfs_domount(vfs_t *vfsp, char *osname)
vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED;
vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES;
vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED;
+   vfsp->mnt_kern_flag |= MNTK_NO_IOPF;/* vn_io_fault can be used */
 
/*
 * The fsid is 64 bits, composed of an 8-bit fs type, which

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 
13 09:09:21 2016(r302721)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 
13 09:09:34 2016(r302722)
@@ -595,7 +595,11 @@ mappedread(vnode_t *vp, int nbytes, uio_
 
VM_OBJECT_UNLOCK(obj);
va = zfs_map_page(pp, );
+#ifdef illumos
error = uiomove(va + off, bytes, UIO_READ, uio);
+#else
+   error = vn_io_fault_uiomove(va + off, bytes, uio);
+#endif
zfs_unmap_page(sf);
VM_OBJECT_LOCK(obj);
page_unhold(pp);
@@ -962,18 +966,31 @@ zfs_write(vnode_t *vp, uio_t *uio, int i
 * holding up the transaction if the data copy hangs
 * up on a pagefault (e.g., from an NFS server mapping).
 */
+#ifdef illumos
size_t cbytes;
+#endif
 
abuf = dmu_request_arcbuf(sa_get_db(zp->z_sa_hdl),
max_blksz);
ASSERT(abuf != NULL);
ASSERT(arc_buf_size(abuf) == max_blksz);
+#ifdef illumos
if (error = uiocopy(abuf->b_data, max_blksz,
UIO_WRITE, uio, )) {
dmu_return_arcbuf(abuf);
break;
}
ASSERT(cbytes == max_blksz);
+#else
+   ssize_t resid = uio->uio_resid;
+   error = vn_io_fault_uiomove(abuf->b_data, max_blksz, 
uio);
+   if (error != 0) {
+   uio->uio_offset -= resid - uio->uio_resid;
+   uio->uio_resid = resid;
+   dmu_return_arcbuf(abuf);
+ 

svn commit: r302719 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:06:58 2016
New Revision: 302719
URL: https://svnweb.freebsd.org/changeset/base/302719

Log:
  MFC r300133: zfsctl_common_fid: remove redundant assignment

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:05:27 2016(r302718)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:06:58 2016(r302719)
@@ -404,8 +404,6 @@ zfsctl_common_fid(ap)
ZFS_EXIT(zfsvfs);
return (SET_ERROR(ENOSPC));
}
-#else
-   fidp->fid_len = SHORT_FID_LEN;
 #endif
 
zfid = (zfid_short_t *)fidp;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302718 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:05:27 2016
New Revision: 302718
URL: https://svnweb.freebsd.org/changeset/base/302718

Log:
  MFC r300132: zfsctl: tighten assertion and remove unused definition

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: 
stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
Wed Jul 13 09:05:14 2016(r302717)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
Wed Jul 13 09:05:27 2016(r302718)
@@ -61,7 +61,6 @@ int zfsctl_lookup_objset(vfs_t *vfsp, ui
 
 #defineZFSCTL_INO_ROOT 0x1
 #defineZFSCTL_INO_SNAPDIR  0x2
-#defineZFSCTL_INO_SHARES   0x3
 
 #ifdef __cplusplus
 }

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:05:14 2016(r302717)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Wed Jul 13 09:05:27 2016(r302718)
@@ -222,7 +222,7 @@ zfsctl_root_inode_cb(vnode_t *vp, int in
 {
zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
 
-   ASSERT(index <= 2);
+   ASSERT(index < 2);
 
if (index == 0)
return (ZFSCTL_INO_SNAPDIR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302717 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:05:14 2016
New Revision: 302717
URL: https://svnweb.freebsd.org/changeset/base/302717

Log:
  MFC r300132: zfsctl: tighten assertion and remove unused definition

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/10/   (props changed)

Modified: 
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h   
Wed Jul 13 09:03:01 2016(r302716)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h   
Wed Jul 13 09:05:14 2016(r302717)
@@ -61,7 +61,6 @@ int zfsctl_lookup_objset(vfs_t *vfsp, ui
 
 #defineZFSCTL_INO_ROOT 0x1
 #defineZFSCTL_INO_SNAPDIR  0x2
-#defineZFSCTL_INO_SHARES   0x3
 
 #ifdef __cplusplus
 }

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:03:01 2016(r302716)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Wed Jul 13 09:05:14 2016(r302717)
@@ -223,7 +223,7 @@ zfsctl_root_inode_cb(vnode_t *vp, int in
 {
zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
 
-   ASSERT(index <= 2);
+   ASSERT(index < 2);
 
if (index == 0)
return (ZFSCTL_INO_SNAPDIR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302716 - stable/10/sys/kern

2016-07-13 Thread Andriy Gapon
Author: avg
Date: Wed Jul 13 09:03:01 2016
New Revision: 302716
URL: https://svnweb.freebsd.org/changeset/base/302716

Log:
  MFC r299913: dounmount: do not call mountcheckdirs() for mounts with 
MNT_IGNORE

Modified:
  stable/10/sys/kern/vfs_mount.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_mount.c
==
--- stable/10/sys/kern/vfs_mount.c  Wed Jul 13 09:02:14 2016
(r302715)
+++ stable/10/sys/kern/vfs_mount.c  Wed Jul 13 09:03:01 2016
(r302716)
@@ -1315,7 +1315,8 @@ dounmount(struct mount *mp, int flags, s
 */
if ((flags & MNT_FORCE) &&
VFS_ROOT(mp, LK_EXCLUSIVE, ) == 0) {
-   if (mp->mnt_vnodecovered != NULL)
+   if (mp->mnt_vnodecovered != NULL &&
+   (mp->mnt_flag & MNT_IGNORE) == 0)
mountcheckdirs(fsrootvp, mp->mnt_vnodecovered);
if (fsrootvp == rootvnode) {
vrele(rootvnode);
@@ -1336,7 +1337,8 @@ dounmount(struct mount *mp, int flags, s
if (error && error != ENXIO) {
if ((flags & MNT_FORCE) &&
VFS_ROOT(mp, LK_EXCLUSIVE, ) == 0) {
-   if (mp->mnt_vnodecovered != NULL)
+   if (mp->mnt_vnodecovered != NULL &&
+   (mp->mnt_flag & MNT_IGNORE) == 0)
mountcheckdirs(mp->mnt_vnodecovered, fsrootvp);
if (rootvnode == NULL) {
rootvnode = fsrootvp;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   >