All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4] : Discovery locking fixes
From: Jean Tourrilhes @ 2003-01-09  2:51 UTC (permalink / raw)
  To: Jeff Garzik, Linux kernel mailing list

ir254_discovery_locking-2.diff :
------------------------------
	o [CRITICA] Fix remaining locking problem with discovery log
	o [CRITICA] Don't call expiry callback under spinlock
	o [FEATURE] Simplify/cleanup/optimise discovery/expiry code


diff -u -p -r linux/include/net/irda-d4/af_irda.h linux/include/net/irda/af_irda.h
--- linux/include/net/irda-d4/af_irda.h	Mon Nov  4 14:30:49 2002
+++ linux/include/net/irda/af_irda.h	Wed Jan  8 17:00:47 2003
@@ -52,8 +52,8 @@ struct irda_sock {
 	__u8  max_header_size;
 	struct qos_info qos_tx;
 
-	__u16 mask;           /* Hint bits mask */
-	__u16 hints;          /* Hint bits */
+	__u16_host_order mask;           /* Hint bits mask */
+	__u16_host_order hints;          /* Hint bits */
 
 	void *ckey;           /* IrLMP client handle */
 	void *skey;           /* IrLMP service handle */
@@ -63,7 +63,7 @@ struct irda_sock {
 	struct ias_value *ias_result; /* Result of remote IAS query */
 
 	hashbin_t *cachelog;		/* Result of discovery query */
-	struct discovery_t *cachediscovery;	/* Result of selective discovery query */
+	__u32 cachedaddr;	/* Result of selective discovery query */
 
 	int nslots;           /* Number of slots to use for discovery */
 
diff -u -p -r linux/include/net/irda-d4/discovery.h linux/include/net/irda/discovery.h
--- linux/include/net/irda-d4/discovery.h	Mon Nov  4 14:30:36 2002
+++ linux/include/net/irda/discovery.h	Wed Jan  8 17:00:47 2003
@@ -46,12 +46,20 @@
  *  little endian format. A little endian machine stores MSB of word in
  *  byte[1] and LSB in byte[0]. A big endian machine stores MSB in byte[0] 
  *  and LSB in byte[1].
+ *
+ * This structure is used in the code for things that are endian neutral
+ * but that fit in a word so that we can manipulate them efficiently.
+ * By endian neutral, I mean things that are really an array of bytes,
+ * and always used as such, for example the hint bits. Jean II
  */
 typedef union {
 	__u16 word;
 	__u8  byte[2];
 } __u16_host_order;
 
+/* Same purpose, different application */
+#define u16ho(array) (* ((__u16 *) array))
+
 /* Types of discovery */
 typedef enum {
 	DISCOVERY_LOG,		/* What's in our discovery log */
@@ -62,30 +70,31 @@ typedef enum {
 
 #define NICKNAME_MAX_LEN 21
 
+/* Basic discovery information about a peer */
+typedef struct irda_device_info		discinfo_t;	/* linux/irda.h */
+
 /*
  * The DISCOVERY structure is used for both discovery requests and responses
  */
 typedef struct discovery_t {
-	irda_queue_t q;          /* Must be first! */
+	irda_queue_t	q;		/* Must be first! */
+
+	discinfo_t	data;		/* Basic discovery information */
+	int		name_len;	/* Lenght of nickname */
 
-	__u32      saddr;        /* Which link the device was discovered */
-	__u32      daddr;        /* Remote device address */
-	LAP_REASON condition;    /* More info about the discovery */
-
-	__u16_host_order hints;  /* Discovery hint bits */
-	__u8       charset;      /* Encoding of nickname */
-	char       nickname[22]; /* The name of the device (21 bytes + \0) */
-	int        name_len;     /* Lenght of nickname */
-
-	int        gen_addr_bit; /* Need to generate a new device address? */
-	int        nslots;       /* Number of slots to use when discovering */
-	unsigned long timestamp; /* Time discovered */
-	unsigned long first_timestamp; /* First time discovered */
+	LAP_REASON	condition;	/* More info about the discovery */
+	int		gen_addr_bit;	/* Need to generate a new device
+					 * address? */
+	int		nslots;		/* Number of slots to use when
+					 * discovering */
+	unsigned long	timestamp;	/* Last time discovered */
+	unsigned long	firststamp;	/* First time discovered */
 } discovery_t;
 
 void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *discovery);
 void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log);
 void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force);
-struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 mask);
+struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn,
+						__u16 mask, int old_entries);
 
 #endif
diff -u -p -r linux/include/net/irda-d4/irlan_client.h linux/include/net/irda/irlan_client.h
--- linux/include/net/irda-d4/irlan_client.h	Mon Nov  4 14:30:47 2002
+++ linux/include/net/irda/irlan_client.h	Wed Jan  8 17:00:47 2003
@@ -34,7 +34,7 @@
 #include <net/irda/irlan_event.h>
 
 void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout);
-void irlan_client_discovery_indication(discovery_t *, DISCOVERY_MODE, void *);
+void irlan_client_discovery_indication(discinfo_t *, DISCOVERY_MODE, void *);
 void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr);
 
 void irlan_client_open_ctrl_tsap( struct irlan_cb *self);
diff -u -p -r linux/include/net/irda-d4/irlmp.h linux/include/net/irda/irlmp.h
--- linux/include/net/irda-d4/irlmp.h	Mon Nov  4 14:30:04 2002
+++ linux/include/net/irda/irlmp.h	Wed Jan  8 17:00:47 2003
@@ -58,7 +58,7 @@
 #define LM_IDLE_TIMEOUT     2*HZ /* 2 seconds for now */
 
 typedef enum {
-	S_PNP,
+	S_PNP = 0,
 	S_PDA,
 	S_COMPUTER,
 	S_PRINTER,
@@ -72,22 +72,24 @@ typedef enum {
 	S_END,
 } SERVICE;
 
-typedef void (*DISCOVERY_CALLBACK1) (discovery_t *, DISCOVERY_MODE, void *);
-typedef void (*DISCOVERY_CALLBACK2) (hashbin_t *, void *);
+/* For selective discovery */
+typedef void (*DISCOVERY_CALLBACK1) (discinfo_t *, DISCOVERY_MODE, void *);
+/* For expiry (the same) */
+typedef void (*DISCOVERY_CALLBACK2) (discinfo_t *, DISCOVERY_MODE, void *);
 
 typedef struct {
 	irda_queue_t queue; /* Must be first */
 
-	__u16 hints; /* Hint bits */
+	__u16_host_order hints; /* Hint bits */
 } irlmp_service_t;
 
 typedef struct {
 	irda_queue_t queue; /* Must be first */
 
-	__u16 hint_mask;
+	__u16_host_order hint_mask;
 
 	DISCOVERY_CALLBACK1 disco_callback;	/* Selective discovery */
-	DISCOVERY_CALLBACK1 expir_callback;	/* Selective expiration */
+	DISCOVERY_CALLBACK2 expir_callback;	/* Selective expiration */
 	void *priv;                /* Used to identify client */
 } irlmp_client_t;
 
@@ -199,11 +201,11 @@ __u16 irlmp_service_to_hint(int service)
 void *irlmp_register_service(__u16 hints);
 int irlmp_unregister_service(void *handle);
 void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
-			    DISCOVERY_CALLBACK1 expir_clb, void *priv);
+			    DISCOVERY_CALLBACK2 expir_clb, void *priv);
 int irlmp_unregister_client(void *handle);
 int irlmp_update_client(void *handle, __u16 hint_mask, 
 			DISCOVERY_CALLBACK1 disco_clb,
-			DISCOVERY_CALLBACK1 expir_clb, void *priv);
+			DISCOVERY_CALLBACK2 expir_clb, void *priv);
 
 void irlmp_register_link(struct irlap_cb *, __u32 saddr, notify_t *);
 void irlmp_unregister_link(__u32 saddr);
@@ -222,11 +224,11 @@ int  irlmp_disconnect_request(struct lsa
 
 void irlmp_discovery_confirm(hashbin_t *discovery_log, DISCOVERY_MODE mode);
 void irlmp_discovery_request(int nslots);
-struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots);
+discinfo_t *irlmp_get_discoveries(int *pn, __u16 mask, int nslots);
 void irlmp_do_expiry(void);
 void irlmp_do_discovery(int nslots);
 discovery_t *irlmp_get_discovery_response(void);
-void irlmp_discovery_expiry(discovery_t *expiry);
+void irlmp_discovery_expiry(discinfo_t *expiry, int number);
 
 int  irlmp_data_request(struct lsap_cb *, struct sk_buff *);
 void irlmp_data_indication(struct lsap_cb *, struct sk_buff *);
diff -u -p -r linux/net/irda-d4/af_irda.c linux/net/irda/af_irda.c
--- linux/net/irda-d4/af_irda.c	Tue Jan  7 17:59:03 2003
+++ linux/net/irda/af_irda.c	Wed Jan  8 17:00:47 2003
@@ -401,11 +401,10 @@ static void irda_getvalue_confirm(int re
  *
  *    Got a selective discovery indication from IrLMP.
  *
- * IrLMP is telling us that this node is matching our hint bit
- * filter. Check if it's a newly discovered node (or if node changed its
- * hint bits), and then wake up any process waiting for answer...
+ * IrLMP is telling us that this node is new and matching our hint bit
+ * filter. Wake up any process waiting for answer...
  */
-static void irda_selective_discovery_indication(discovery_t *discovery,
+static void irda_selective_discovery_indication(discinfo_t *discovery,
 						DISCOVERY_MODE mode,
 						void *priv)
 {
@@ -419,18 +418,8 @@ static void irda_selective_discovery_ind
 		return;
 	}
 
-	/* Check if node is discovered is a new one or an old one.
-	 * We check when how long ago this node was discovered, with a
-	 * coarse timeout (we may miss some discovery events or be delayed).
-	 * Note : by doing this test here, we avoid waking up a process ;-)
-	 */
-	if((jiffies - discovery->first_timestamp) >
-	   (sysctl_discovery_timeout * HZ)) {
-		return;		/* Too old, not interesting -> goodbye */
-	}
-
 	/* Pass parameter to the caller */
-	self->cachediscovery = discovery;
+	self->cachedaddr = discovery->daddr;
 
 	/* Wake up process if its waiting for device to be discovered */
 	wake_up_interruptible(&self->query_wait);
@@ -455,7 +444,7 @@ static void irda_discovery_timeout(u_lon
 
 	/* Nothing for the caller */
 	self->cachelog = NULL;
-	self->cachediscovery = NULL;
+	self->cachedaddr = 0;
 	self->errno = -ETIME;
 
 	/* Wake up process if its still waiting... */
@@ -627,7 +616,7 @@ static int irda_find_lsap_sel(struct ird
  */
 static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
 {
-	struct irda_device_info *discoveries;	/* Copy of the discovery log */
+	discinfo_t *discoveries;	/* Copy of the discovery log */
 	int	number;			/* Number of nodes in the log */
 	int	i;
 	int	err = -ENETUNREACH;
@@ -642,7 +631,8 @@ static int irda_discover_daddr_and_lsap_
 	 * Note : we have to use irlmp_get_discoveries(), as opposed
 	 * to play with the cachelog directly, because while we are
 	 * making our ias query, le log might change... */
-	discoveries = irlmp_get_discoveries(&number, self->mask, self->nslots);
+	discoveries = irlmp_get_discoveries(&number, self->mask.word,
+					    self->nslots);
 	/* Check if the we got some results */
 	if (discoveries == NULL)
 		return -ENETUNREACH;	/* No nodes discovered */
@@ -1137,7 +1127,7 @@ static int irda_create(struct socket *so
 
 	/* Register as a client with IrLMP */
 	self->ckey = irlmp_register_client(0, NULL, NULL, NULL);
-	self->mask = 0xffff;
+	self->mask.word = 0xffff;
 	self->rx_flow = self->tx_flow = FLOW_START;
 	self->nslots = DISCOVERY_DEFAULT_SLOTS;
 	self->daddr = DEV_ADDR_ANY;	/* Until we get connected */
@@ -1999,6 +1989,7 @@ static int irda_setsockopt(struct socket
 		if (optlen < sizeof(int))
 			return -EINVAL;
 
+		/* The input is really a (__u8 hints[2]), easier as an int */
 		if (get_user(opt, (int *)optval))
 			return -EFAULT;
 
@@ -2017,16 +2008,17 @@ static int irda_setsockopt(struct socket
 		if (optlen < sizeof(int))
 			return -EINVAL;
 
+		/* The input is really a (__u8 hints[2]), easier as an int */
 		if (get_user(opt, (int *)optval))
 			return -EFAULT;
 
 		/* Set the new hint mask */
-		self->mask = (__u16) opt;
+		self->mask.word = (__u16) opt;
 		/* Mask out extension bits */
-		self->mask &= 0x7f7f;
+		self->mask.word &= 0x7f7f;
 		/* Check if no bits */
-		if(!self->mask)
-			self->mask = 0xFFFF;
+		if(!self->mask.word)
+			self->mask.word = 0xFFFF;
 
 		break;
 	default:
@@ -2117,7 +2109,7 @@ static int irda_getsockopt(struct socket
 	switch (optname) {
 	case IRLMP_ENUMDEVICES:
 		/* Ask lmp for the current discovery log */
-		discoveries = irlmp_get_discoveries(&list.len, self->mask,
+		discoveries = irlmp_get_discoveries(&list.len, self->mask.word,
 						    self->nslots);
 		/* Check if the we got some results */
 		if (discoveries == NULL)
@@ -2349,7 +2341,7 @@ bed:
 			return -EFAULT;
 
 		/* Tell IrLMP we want to be notified */
-		irlmp_update_client(self->ckey, self->mask,
+		irlmp_update_client(self->ckey, self->mask.word,
 				    irda_selective_discovery_indication,
 				    NULL, (void *) self);
 
@@ -2357,7 +2349,7 @@ bed:
 		irlmp_discovery_request(self->nslots);
 
 		/* Wait until a node is discovered */
-		if (!self->cachediscovery) {
+		if (!self->cachedaddr) {
 			int ret = 0;
 
 			IRDA_DEBUG(1, "%s(), nothing discovered yet, going to sleep...\n", __FUNCTION__);
@@ -2372,7 +2364,7 @@ bed:
 
 			/* Wait for IR-LMP to call us back */
 			__wait_event_interruptible(self->query_wait,
-			   (self->cachediscovery!=NULL || self->errno==-ETIME),
+			      (self->cachedaddr != 0 || self->errno == -ETIME),
 						   ret);
 
 			/* If watchdog is still activated, kill it! */
@@ -2389,19 +2381,25 @@ bed:
 				   __FUNCTION__);
 
 		/* Tell IrLMP that we have been notified */
-		irlmp_update_client(self->ckey, self->mask, NULL, NULL, NULL);
+		irlmp_update_client(self->ckey, self->mask.word,
+				    NULL, NULL, NULL);
 
 		/* Check if the we got some results */
-		if (!self->cachediscovery)
+		if (!self->cachedaddr)
 			return -EAGAIN;		/* Didn't find any devices */
+		daddr = self->cachedaddr;
 		/* Cleanup */
-		self->cachediscovery = NULL;
+		self->cachedaddr = 0;
 
-		/* Note : We don't return anything to the user.
-		 * We could return the device that triggered the wake up,
-		 * but it's probably better to force the user to query
-		 * the whole discovery log and let him pick one device...
+		/* We return the daddr of the device that trigger the
+		 * wakeup. As irlmp pass us only the new devices, we
+		 * are sure that it's not an old device.
+		 * If the user want more details, he should query
+		 * the whole discovery log and pick one device...
 		 */
+		if (put_user(daddr, (int *)optval))
+			return -EFAULT;
+
 		break;
 	default:
 		return -ENOPROTOOPT;
diff -u -p -r linux/net/irda-d4/discovery.c linux/net/irda/discovery.c
--- linux/net/irda-d4/discovery.c	Mon Nov  4 14:30:15 2002
+++ linux/net/irda/discovery.c	Wed Jan  8 17:00:47 2003
@@ -59,7 +59,7 @@ void irlmp_add_discovery(hashbin_t *cach
 	unsigned long flags;
 
 	/* Set time of first discovery if node is new (see below) */
-	new->first_timestamp = new->timestamp;
+	new->firststamp = new->timestamp;
 
 	spin_lock_irqsave(&cachelog->hb_spinlock, flags);
 
@@ -76,24 +76,24 @@ void irlmp_add_discovery(hashbin_t *cach
 		/* Be sure to stay one item ahead */
 		discovery = (discovery_t *) hashbin_get_next(cachelog);
 
-		if ((node->saddr == new->saddr) &&
-		    ((node->daddr == new->daddr) || 
-		     (strcmp(node->nickname, new->nickname) == 0)))
+		if ((node->data.saddr == new->data.saddr) &&
+		    ((node->data.daddr == new->data.daddr) || 
+		     (strcmp(node->data.info, new->data.info) == 0)))
 		{
 			/* This discovery is a previous discovery 
 			 * from the same device, so just remove it
 			 */
 			hashbin_remove_this(cachelog, (irda_queue_t *) node);
-			/* Check if hints bits have changed */
-			if(node->hints.word == new->hints.word)
+			/* Check if hints bits are unchanged */
+			if(u16ho(node->data.hints) == u16ho(new->data.hints))
 				/* Set time of first discovery for this node */
-				new->first_timestamp = node->first_timestamp;
+				new->firststamp = node->firststamp;
 			kfree(node);
 		}
 	}
 
 	/* Insert the new and updated version */
-	hashbin_insert(cachelog, (irda_queue_t *) new, new->daddr, NULL);
+	hashbin_insert(cachelog, (irda_queue_t *) new, new->data.daddr, NULL);
 
 	spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
 }
@@ -147,27 +147,50 @@ void irlmp_add_discovery_log(hashbin_t *
  */
 void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force)
 {
-	discovery_t *discovery, *curr;
-	unsigned long flags;
+	discovery_t *		discovery;
+	discovery_t *		curr;
+	unsigned long		flags;
+	discinfo_t *		buffer = NULL;
+	int			n;		/* Size of the full log */
+	int			i = 0;		/* How many we expired */
 
+	ASSERT(log != NULL, return;);
 	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	spin_lock_irqsave(&log->hb_spinlock, flags);
 
 	discovery = (discovery_t *) hashbin_get_first(log);
 	while (discovery != NULL) {
-		curr = discovery;
-
 		/* Be sure to be one item ahead */
+		curr = discovery;
 		discovery = (discovery_t *) hashbin_get_next(log);
 
 		/* Test if it's time to expire this discovery */
-		if ((curr->saddr == saddr) &&
+		if ((curr->data.saddr == saddr) &&
 		    (force ||
 		     ((jiffies - curr->timestamp) > DISCOVERY_EXPIRE_TIMEOUT)))
 		{
-			/* Tell IrLMP and registered clients about it */
-			irlmp_discovery_expiry(curr);
+			/* Create buffer as needed.
+			 * As this function get called a lot and most time
+			 * we don't have anything to put in the log (we are
+			 * quite picky), we can save a lot of overhead
+			 * by not calling kmalloc. Jean II */
+			if(buffer == NULL) {
+				/* Create the client specific buffer */
+				n = HASHBIN_GET_SIZE(log);
+				buffer = kmalloc(n * sizeof(struct irda_device_info), GFP_ATOMIC);
+				if (buffer == NULL) {
+					spin_unlock_irqrestore(&log->hb_spinlock, flags);
+					return;
+				}
+
+			}
+
+			/* Copy discovery information */
+			memcpy(&(buffer[i]), &(curr->data),
+			       sizeof(discinfo_t));
+			i++;
+
 			/* Remove it from the log */
 			curr = hashbin_remove_this(log, (irda_queue_t *) curr);
 			if (curr)
@@ -175,9 +198,23 @@ void irlmp_expire_discoveries(hashbin_t 
 		}
 	}
 
+	/* Drop the spinlock before calling the higher layers, as
+	 * we can't guarantee they won't call us back and create a
+	 * deadlock. We will work on our own private data, so we
+	 * don't care to be interupted. - Jean II */
 	spin_unlock_irqrestore(&log->hb_spinlock, flags);
+
+	if(buffer == NULL)
+		return;
+
+	/* Tell IrLMP and registered clients about it */
+	irlmp_discovery_expiry(buffer, i);
+
+	/* Free up our buffer */
+	kfree(buffer);
 }
 
+#if 0
 /*
  * Function irlmp_dump_discoveries (log)
  *
@@ -193,13 +230,14 @@ void irlmp_dump_discoveries(hashbin_t *l
 	discovery = (discovery_t *) hashbin_get_first(log);
 	while (discovery != NULL) {
 		IRDA_DEBUG(0, "Discovery:\n");
-		IRDA_DEBUG(0, "  daddr=%08x\n", discovery->daddr);
-		IRDA_DEBUG(0, "  saddr=%08x\n", discovery->saddr); 
-		IRDA_DEBUG(0, "  nickname=%s\n", discovery->nickname);
+		IRDA_DEBUG(0, "  daddr=%08x\n", discovery->data.daddr);
+		IRDA_DEBUG(0, "  saddr=%08x\n", discovery->data.saddr); 
+		IRDA_DEBUG(0, "  nickname=%s\n", discovery->data.info);
 
 		discovery = (discovery_t *) hashbin_get_next(log);
 	}
 }
+#endif
 
 /*
  * Function irlmp_copy_discoveries (log, pn, mask)
@@ -221,43 +259,49 @@ void irlmp_dump_discoveries(hashbin_t *l
  * Note : the client must kfree himself() the log...
  * Jean II
  */
-struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 mask)
+struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn,
+						__u16 mask, int old_entries)
 {
-	discovery_t *			discovery;
-	unsigned long			flags;
-	struct irda_device_info *	buffer;
-	int				i = 0;
-	int				n;
+	discovery_t *		discovery;
+	unsigned long		flags;
+	discinfo_t *		buffer = NULL;
+	int			j_timeout = (sysctl_discovery_timeout * HZ);
+	int			n;		/* Size of the full log */
+	int			i = 0;		/* How many we picked */
 
 	ASSERT(pn != NULL, return NULL;);
+	ASSERT(log != NULL, return NULL;);
 
-	/* Check if log is empty */
-	if(log == NULL)
-		return NULL;
-
-	/* Save spin lock - spinlock should be discovery specific */
+	/* Save spin lock */
 	spin_lock_irqsave(&log->hb_spinlock, flags);
 
-	/* Create the client specific buffer */
-	n = HASHBIN_GET_SIZE(log);
-	buffer = kmalloc(n * sizeof(struct irda_device_info), GFP_ATOMIC);
-	if (buffer == NULL) {
-		spin_unlock_irqrestore(&log->hb_spinlock, flags);
-		return NULL;
-	}
-
 	discovery = (discovery_t *) hashbin_get_first(log);
-	while ((discovery != NULL) && (i < n)) {
-		/* Mask out the ones we don't want */
-		if (discovery->hints.word & mask) {
+	while (discovery != NULL) {
+		/* Mask out the ones we don't want :
+		 * We want to match the discovery mask, and to get only
+		 * the most recent one (unless we want old ones) */
+		if ((u16ho(discovery->data.hints) & mask) &&
+		    ((old_entries) ||
+		     ((jiffies - discovery->firststamp) < j_timeout)) ) {
+			/* Create buffer as needed.
+			 * As this function get called a lot and most time
+			 * we don't have anything to put in the log (we are
+			 * quite picky), we can save a lot of overhead
+			 * by not calling kmalloc. Jean II */
+			if(buffer == NULL) {
+				/* Create the client specific buffer */
+				n = HASHBIN_GET_SIZE(log);
+				buffer = kmalloc(n * sizeof(struct irda_device_info), GFP_ATOMIC);
+				if (buffer == NULL) {
+					spin_unlock_irqrestore(&log->hb_spinlock, flags);
+					return NULL;
+				}
+
+			}
+
 			/* Copy discovery information */
-			buffer[i].saddr = discovery->saddr;
-			buffer[i].daddr = discovery->daddr;
-			buffer[i].charset = discovery->charset;
-			buffer[i].hints[0] = discovery->hints.byte[0];
-			buffer[i].hints[1] = discovery->hints.byte[1];
-			strncpy(buffer[i].info, discovery->nickname,
-				NICKNAME_MAX_LEN);
+			memcpy(&(buffer[i]), &(discovery->data),
+			       sizeof(discinfo_t));
 			i++;
 		}
 		discovery = (discovery_t *) hashbin_get_next(log);
@@ -288,14 +332,14 @@ __u32 irlmp_find_device(hashbin_t *cache
 	d = (discovery_t *) hashbin_get_first(cachelog);
 	while (d != NULL) {
 		IRDA_DEBUG(1, "Discovery:\n");
-		IRDA_DEBUG(1, "  daddr=%08x\n", d->daddr);
-		IRDA_DEBUG(1, "  nickname=%s\n", d->nickname);
-		
-		if (strcmp(name, d->nickname) == 0) {
-			*saddr = d->saddr;
+		IRDA_DEBUG(1, "  daddr=%08x\n", d->data.daddr);
+		IRDA_DEBUG(1, "  nickname=%s\n", d->data.info);
+
+		if (strcmp(name, d->data.info) == 0) {
+			*saddr = d->data.saddr;
 			
 			spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
-			return d->daddr;
+			return d->data.daddr;
 		}
 		d = (discovery_t *) hashbin_get_next(cachelog);
 	}
@@ -328,41 +372,41 @@ int discovery_proc_read(char *buf, char 
 
 	discovery = (discovery_t *) hashbin_get_first(cachelog);
 	while (( discovery != NULL) && (len < length)) {
-		len += sprintf(buf+len, "nickname: %s,", discovery->nickname);
+		len += sprintf(buf+len, "nickname: %s,", discovery->data.info);
 		
 		len += sprintf(buf+len, " hint: 0x%02x%02x", 
-			       discovery->hints.byte[0], 
-			       discovery->hints.byte[1]);
+			       discovery->data.hints[0], 
+			       discovery->data.hints[1]);
 #if 0
-		if ( discovery->hints.byte[0] & HINT_PNP)
+		if ( discovery->data.hints[0] & HINT_PNP)
 			len += sprintf( buf+len, "PnP Compatible ");
-		if ( discovery->hints.byte[0] & HINT_PDA)
+		if ( discovery->data.hints[0] & HINT_PDA)
 			len += sprintf( buf+len, "PDA/Palmtop ");
-		if ( discovery->hints.byte[0] & HINT_COMPUTER)
+		if ( discovery->data.hints[0] & HINT_COMPUTER)
 			len += sprintf( buf+len, "Computer ");
-		if ( discovery->hints.byte[0] & HINT_PRINTER)
+		if ( discovery->data.hints[0] & HINT_PRINTER)
 			len += sprintf( buf+len, "Printer ");
-		if ( discovery->hints.byte[0] & HINT_MODEM)
+		if ( discovery->data.hints[0] & HINT_MODEM)
 			len += sprintf( buf+len, "Modem ");
-		if ( discovery->hints.byte[0] & HINT_FAX)
+		if ( discovery->data.hints[0] & HINT_FAX)
 			len += sprintf( buf+len, "Fax ");
-		if ( discovery->hints.byte[0] & HINT_LAN)
+		if ( discovery->data.hints[0] & HINT_LAN)
 			len += sprintf( buf+len, "LAN Access ");
 		
-		if ( discovery->hints.byte[1] & HINT_TELEPHONY)
+		if ( discovery->data.hints[1] & HINT_TELEPHONY)
 			len += sprintf( buf+len, "Telephony ");
-		if ( discovery->hints.byte[1] & HINT_FILE_SERVER)
+		if ( discovery->data.hints[1] & HINT_FILE_SERVER)
 			len += sprintf( buf+len, "File Server ");       
-		if ( discovery->hints.byte[1] & HINT_COMM)
+		if ( discovery->data.hints[1] & HINT_COMM)
 			len += sprintf( buf+len, "IrCOMM ");
-		if ( discovery->hints.byte[1] & HINT_OBEX)
+		if ( discovery->data.hints[1] & HINT_OBEX)
 			len += sprintf( buf+len, "IrOBEX ");
 #endif		
 		len += sprintf(buf+len, ", saddr: 0x%08x", 
-			       discovery->saddr);
+			       discovery->data.saddr);
 
 		len += sprintf(buf+len, ", daddr: 0x%08x\n", 
-			       discovery->daddr);
+			       discovery->data.daddr);
 		
 		len += sprintf(buf+len, "\n");
 		
diff -u -p -r linux/net/irda-d4/ircomm/ircomm_tty_attach.c linux/net/irda/ircomm/ircomm_tty_attach.c
--- linux/net/irda-d4/ircomm/ircomm_tty_attach.c	Mon Nov  4 14:30:50 2002
+++ linux/net/irda/ircomm/ircomm_tty_attach.c	Wed Jan  8 17:00:47 2003
@@ -46,7 +46,7 @@
 #include <net/irda/ircomm_tty_attach.h>
 
 static void ircomm_tty_ias_register(struct ircomm_tty_cb *self);
-static void ircomm_tty_discovery_indication(discovery_t *discovery,
+static void ircomm_tty_discovery_indication(discinfo_t *discovery,
 					    DISCOVERY_MODE mode,
 					    void *priv);
 static void ircomm_tty_getvalue_confirm(int result, __u16 obj_id, 
@@ -305,7 +305,7 @@ int ircomm_tty_send_initial_parameters(s
  *    device it is, and which services it has.
  *
  */
-static void ircomm_tty_discovery_indication(discovery_t *discovery,
+static void ircomm_tty_discovery_indication(discinfo_t *discovery,
 					    DISCOVERY_MODE mode,
 					    void *priv)
 {
diff -u -p -r linux/net/irda-d4/irlan/irlan_client.c linux/net/irda/irlan/irlan_client.c
--- linux/net/irda-d4/irlan/irlan_client.c	Mon Nov  4 14:30:31 2002
+++ linux/net/irda/irlan/irlan_client.c	Wed Jan  8 17:00:47 2003
@@ -145,7 +145,7 @@ void irlan_client_wakeup(struct irlan_cb
  *    Remote device with IrLAN server support discovered
  *
  */
-void irlan_client_discovery_indication(discovery_t *discovery,
+void irlan_client_discovery_indication(discinfo_t *discovery,
 				       DISCOVERY_MODE mode,
 				       void *priv) 
 {
diff -u -p -r linux/net/irda-d4/irlap_event.c linux/net/irda/irlap_event.c
--- linux/net/irda-d4/irlap_event.c	Mon Nov  4 14:30:33 2002
+++ linux/net/irda/irlap_event.c	Wed Jan  8 17:00:47 2003
@@ -419,7 +419,7 @@ static int irlap_state_ndm(struct irlap_
 								   info->s);
 			if (self->slot == info->s) {
 				discovery_rsp = irlmp_get_discovery_response();
-				discovery_rsp->daddr = info->daddr;
+				discovery_rsp->data.daddr = info->daddr;
 
 				irlap_send_discovery_xid_frame(self, info->S,
 							       self->slot,
@@ -576,7 +576,7 @@ static int irlap_state_query(struct irla
 		ASSERT(info->discovery != NULL, return -1;);
 
 		IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__,
-			   info->discovery->daddr);
+			   info->discovery->data.daddr);
 
 		if (!self->discovery_log) {
 			WARNING("%s: discovery log is gone! "
@@ -586,7 +586,7 @@ static int irlap_state_query(struct irla
 		}
 		hashbin_insert(self->discovery_log,
 			       (irda_queue_t *) info->discovery,
-			       info->discovery->daddr, NULL);
+			       info->discovery->data.daddr, NULL);
 
 		/* Keep state */
 		/* irlap_next_state(self, LAP_QUERY);  */
@@ -704,7 +704,7 @@ static int irlap_state_reply(struct irla
 			irlap_discovery_indication(self, info->discovery);
 		} else if ((info->s >= self->slot) && (!self->frame_sent)) {
 			discovery_rsp = irlmp_get_discovery_response();
-			discovery_rsp->daddr = info->daddr;
+			discovery_rsp->data.daddr = info->daddr;
 
 			irlap_send_discovery_xid_frame(self, info->S,
 						       self->slot, FALSE,
diff -u -p -r linux/net/irda-d4/irlap_frame.c linux/net/irda/irlap_frame.c
--- linux/net/irda-d4/irlap_frame.c	Tue Jan  7 17:58:39 2003
+++ linux/net/irda/irlap_frame.c	Wed Jan  8 17:00:47 2003
@@ -335,7 +335,7 @@ void irlap_send_discovery_xid_frame(stru
 	if (command)
 		frame->daddr = cpu_to_le32(bcast);
 	else
-		frame->daddr = cpu_to_le32(discovery->daddr);
+		frame->daddr = cpu_to_le32(discovery->data.daddr);
 
 	switch (S) {
 	case 1:
@@ -366,20 +366,20 @@ void irlap_send_discovery_xid_frame(stru
 	if (!command || (frame->slotnr == 0xff)) {
 		int len;
 
-		if (discovery->hints.byte[0] & HINT_EXTENSION) {
+		if (discovery->data.hints[0] & HINT_EXTENSION) {
 			info = skb_put(skb, 2);
-			info[0] = discovery->hints.byte[0];
-			info[1] = discovery->hints.byte[1];
+			info[0] = discovery->data.hints[0];
+			info[1] = discovery->data.hints[1];
 		} else {
 			info = skb_put(skb, 1);
-			info[0] = discovery->hints.byte[0];
+			info[0] = discovery->data.hints[0];
 		}
 		info = skb_put(skb, 1);
-		info[0] = discovery->charset;
+		info[0] = discovery->data.charset;
 
 		len = IRDA_MIN(discovery->name_len, skb_tailroom(skb));
 		info = skb_put(skb, len);
-		memcpy(info, discovery->nickname, len);
+		memcpy(info, discovery->data.info, len);
 	}
 	irlap_queue_xmit(self, skb);
 }
@@ -422,24 +422,25 @@ static void irlap_recv_discovery_xid_rsp
 	}
 	memset(discovery, 0, sizeof(discovery_t));
 
-	discovery->daddr = info->daddr;
-	discovery->saddr = self->saddr;
+	discovery->data.daddr = info->daddr;
+	discovery->data.saddr = self->saddr;
 	discovery->timestamp = jiffies;
 
-	IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__, discovery->daddr);
+	IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__,
+		   discovery->data.daddr);
 
 	discovery_info = skb_pull(skb, sizeof(struct xid_frame));
 
 	/* Get info returned from peer */
-	discovery->hints.byte[0] = discovery_info[0];
+	discovery->data.hints[0] = discovery_info[0];
 	if (discovery_info[0] & HINT_EXTENSION) {
 		IRDA_DEBUG(4, "EXTENSION\n");
-		discovery->hints.byte[1] = discovery_info[1];
-		discovery->charset = discovery_info[2];
+		discovery->data.hints[1] = discovery_info[1];
+		discovery->data.charset = discovery_info[2];
 		text = (char *) &discovery_info[3];
 	} else {
-		discovery->hints.byte[1] = 0;
-		discovery->charset = discovery_info[1];
+		discovery->data.hints[1] = 0;
+		discovery->data.charset = discovery_info[1];
 		text = (char *) &discovery_info[2];
 	}
 	/*
@@ -447,8 +448,8 @@ static void irlap_recv_discovery_xid_rsp
 	 *  FCS bytes resides.
 	 */
 	skb->data[skb->len] = '\0';
-	strncpy(discovery->nickname, text, NICKNAME_MAX_LEN);
-	discovery->name_len = strlen(discovery->nickname);
+	strncpy(discovery->data.info, text, NICKNAME_MAX_LEN);
+	discovery->name_len = strlen(discovery->data.info);
 
 	info->discovery = discovery;
 
@@ -523,18 +524,18 @@ static void irlap_recv_discovery_xid_cmd
 			return;
 		}
 
-		discovery->daddr = info->daddr;
-		discovery->saddr = self->saddr;
+		discovery->data.daddr = info->daddr;
+		discovery->data.saddr = self->saddr;
 		discovery->timestamp = jiffies;
 
-		discovery->hints.byte[0] = discovery_info[0];
+		discovery->data.hints[0] = discovery_info[0];
 		if (discovery_info[0] & HINT_EXTENSION) {
-			discovery->hints.byte[1] = discovery_info[1];
-			discovery->charset = discovery_info[2];
+			discovery->data.hints[1] = discovery_info[1];
+			discovery->data.charset = discovery_info[2];
 			text = (char *) &discovery_info[3];
 		} else {
-			discovery->hints.byte[1] = 0;
-			discovery->charset = discovery_info[1];
+			discovery->data.hints[1] = 0;
+			discovery->data.charset = discovery_info[1];
 			text = (char *) &discovery_info[2];
 		}
 		/*
@@ -542,8 +543,8 @@ static void irlap_recv_discovery_xid_cmd
 		 *  FCS bytes resides.
 		 */
 		skb->data[skb->len] = '\0';
-		strncpy(discovery->nickname, text, NICKNAME_MAX_LEN);
-		discovery->name_len = strlen(discovery->nickname);
+		strncpy(discovery->data.info, text, NICKNAME_MAX_LEN);
+		discovery->name_len = strlen(discovery->data.info);
 
 		info->discovery = discovery;
 	} else
diff -u -p -r linux/net/irda-d4/irlmp.c linux/net/irda/irlmp.c
--- linux/net/irda-d4/irlmp.c	Mon Nov  4 14:30:50 2002
+++ linux/net/irda/irlmp.c	Wed Jan  8 17:00:47 2003
@@ -401,8 +401,8 @@ int irlmp_connect_request(struct lsap_cb
 		}
 
 		if (discovery) {
-			saddr = discovery->saddr;
-			daddr = discovery->daddr;
+			saddr = discovery->data.saddr;
+			daddr = discovery->data.daddr;
 		}
 		spin_unlock_irqrestore(&irlmp->cachelog->hb_spinlock, flags);
 	}
@@ -793,17 +793,17 @@ void irlmp_do_discovery(int nslots)
 	}
 
 	/* Construct new discovery info to be used by IrLAP, */
-	irlmp->discovery_cmd.hints.word = irlmp->hints.word;
+	u16ho(irlmp->discovery_cmd.data.hints) = irlmp->hints.word;
 
 	/*
 	 *  Set character set for device name (we use ASCII), and
 	 *  copy device name. Remember to make room for a \0 at the
 	 *  end
 	 */
-	irlmp->discovery_cmd.charset = CS_ASCII;
-	strncpy(irlmp->discovery_cmd.nickname, sysctl_devname,
+	irlmp->discovery_cmd.data.charset = CS_ASCII;
+	strncpy(irlmp->discovery_cmd.data.info, sysctl_devname,
 		NICKNAME_MAX_LEN);
-	irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.nickname);
+	irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.data.info);
 	irlmp->discovery_cmd.nslots = nslots;
 
 	/*
@@ -827,10 +827,13 @@ void irlmp_do_discovery(int nslots)
  *
  *    Do a discovery of devices in front of the computer
  *
+ * If the caller has registered a client discovery callback, this
+ * allow him to receive the full content of the discovery log through
+ * this callback (as normally he will receive only new discoveries).
  */
 void irlmp_discovery_request(int nslots)
 {
-	/* Return current cached discovery log */
+	/* Return current cached discovery log (in full) */
 	irlmp_discovery_confirm(irlmp->cachelog, DISCOVERY_LOG);
 
 	/*
@@ -854,6 +857,8 @@ void irlmp_discovery_request(int nslots)
  *
  *    Return the current discovery log
  *
+ * If discovery is not enabled, you should call this function again
+ * after 1 or 2 seconds (i.e. after discovery has been done).
  */
 struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots)
 {
@@ -875,50 +880,9 @@ struct irda_device_info *irlmp_get_disco
 	}
 
 	/* Return current cached discovery log */
-	return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask));
+	return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask, TRUE));
 }
 
-#if 0
-/*
- * Function irlmp_check_services (discovery)
- */
-void irlmp_check_services(discovery_t *discovery)
-{
-	struct irlmp_client *client;
-	__u8 *service_log;
-	__u8 service;
-	int i = 0;
-
-	IRDA_DEBUG(1, "IrDA Discovered: %s\n", discovery->info);
-	IRDA_DEBUG(1, "    Services: ");
-
-	service_log = irlmp_hint_to_service(discovery->hints.byte);
-	if (!service_log)
-		return;
-
-	/*
-	 *  Check all services on the device
-	 */
-	while ((service = service_log[i++]) != S_END) {
-		IRDA_DEBUG( 4, "service=%02x\n", service);
-		client = hashbin_lock_find(irlmp->registry, service, NULL);
-		if (entry && entry->discovery_callback) {
-			IRDA_DEBUG( 4, "discovery_callback!\n");
-
-			entry->discovery_callback(discovery);
-		} else {
-			/* Don't notify about the ANY service */
-			if (service == S_ANY)
-				continue;
-			/*
-			 * Found no clients for dealing with this service,
-			 */
-		}
-	}
-	kfree(service_log);
-}
-#endif
-
 /*
  * Function irlmp_notify_client (log)
  *
@@ -935,7 +899,9 @@ static inline void
 irlmp_notify_client(irlmp_client_t *client,
 		    hashbin_t *log, DISCOVERY_MODE mode)
 {
-	discovery_t *discovery;
+	discinfo_t *discoveries;	/* Copy of the discovery log */
+	int	number;			/* Number of nodes in the log */
+	int	i;
 
 	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
@@ -944,28 +910,36 @@ irlmp_notify_client(irlmp_client_t *clie
 		return;
 
 	/*
+	 * Locking notes :
+	 * the old code was manipulating the log directly, which was
+	 * very racy. Now, we use copy_discoveries, that protects
+	 * itself while dumping the log for us.
+	 * The overhead of the copy is compensated by the fact that
+	 * we only pass new discoveries in normal mode and don't
+	 * pass the same old entry every 3s to the caller as we used
+	 * to do (virtual function calling is expensive).
+	 * Jean II
+	 */
+
+	/*
 	 * Now, check all discovered devices (if any), and notify client
 	 * only about the services that the client is interested in
-	 * Note : most often, we will get called immediately following
-	 * a discovery, so the log is not going to expire.
-	 * On the other hand, comming here through irlmp_discovery_request()
-	 * is *very* problematic - Jean II
-	 * Can't use hashbin_find_next(), key is not unique. I'm running
-	 * out of options :-( - Jean II
+	 * We also notify only about the new devices unless the caller
+	 * explicity request a dump of the log. Jean II
 	 */
-	discovery = (discovery_t *) hashbin_get_first(log);
-	while (discovery != NULL) {
-		IRDA_DEBUG(3, "discovery->daddr = 0x%08x\n", discovery->daddr);
-
-		/*
-		 * Any common hint bits? Remember to mask away the extension
-		 * bits ;-)
-		 */
-		if (client->hint_mask & discovery->hints.word & 0x7f7f)
-			client->disco_callback(discovery, mode, client->priv);
+	discoveries = irlmp_copy_discoveries(log, &number,
+					     client->hint_mask.word,
+					     (mode == DISCOVERY_LOG));
+	/* Check if the we got some results */
+	if (discoveries == NULL)
+		return;	/* No nodes discovered */
+
+	/* Pass all entries to the listener */
+	for(i = 0; i < number; i++)
+		client->disco_callback(&(discoveries[i]), mode, client->priv);
 
-		discovery = (discovery_t *) hashbin_get_next(log);
-	}
+	/* Free up our buffer */
+	kfree(discoveries);
 }
 
 /*
@@ -987,6 +961,7 @@ void irlmp_discovery_confirm(hashbin_t *
 	if (!(HASHBIN_GET_SIZE(log)))
 		return;
 
+	/* For each client - notify callback may touch client list */
 	client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
 	while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL,
 					 (void *) &client_next) ) {
@@ -1005,26 +980,34 @@ void irlmp_discovery_confirm(hashbin_t *
  *	registered for this event...
  *
  *	Note : called exclusively from discovery.c
- *	Note : as we are currently processing the log, the clients callback
- *	should *NOT* attempt to touch the log now.
+ *	Note : this is no longer called under discovery spinlock, so the
+ *		client can do whatever he wants in the callback.
  */
-void irlmp_discovery_expiry(discovery_t *expiry)
+void irlmp_discovery_expiry(discinfo_t *expiries, int number)
 {
 	irlmp_client_t *client;
 	irlmp_client_t *client_next;
+	int		i;
 
 	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
-	ASSERT(expiry != NULL, return;);
+	ASSERT(expiries != NULL, return;);
 
+	/* For each client - notify callback may touch client list */
 	client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
 	while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL,
 					 (void *) &client_next) ) {
-		/* Check if we should notify client */
-		if ((client->expir_callback) &&
-		    (client->hint_mask & expiry->hints.word & 0x7f7f))
-			client->expir_callback(expiry, EXPIRY_TIMEOUT,
-					       client->priv);
+
+		/* Pass all entries to the listener */
+		for(i = 0; i < number; i++) {
+			/* Check if we should notify client */
+			if ((client->expir_callback) &&
+			    (client->hint_mask.word & u16ho(expiries[i].hints)
+			     & 0x7f7f) )
+				client->expir_callback(&(expiries[i]),
+						       EXPIRY_TIMEOUT,
+						       client->priv);
+		}
 
 		/* Next client */
 		client = client_next;
@@ -1043,18 +1026,18 @@ discovery_t *irlmp_get_discovery_respons
 
 	ASSERT(irlmp != NULL, return NULL;);
 
-	irlmp->discovery_rsp.hints.word = irlmp->hints.word;
+	u16ho(irlmp->discovery_rsp.data.hints) = irlmp->hints.word;
 
 	/*
 	 *  Set character set for device name (we use ASCII), and
 	 *  copy device name. Remember to make room for a \0 at the
 	 *  end
 	 */
-	irlmp->discovery_rsp.charset = CS_ASCII;
+	irlmp->discovery_rsp.data.charset = CS_ASCII;
 
-	strncpy(irlmp->discovery_rsp.nickname, sysctl_devname,
+	strncpy(irlmp->discovery_rsp.data.info, sysctl_devname,
 		NICKNAME_MAX_LEN);
-	irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.nickname);
+	irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.data.info);
 
 	return &irlmp->discovery_rsp;
 }
@@ -1291,6 +1274,7 @@ void irlmp_flow_indication(struct lap_cb
 	}
 }
 
+#if 0
 /*
  * Function irlmp_hint_to_service (hint)
  *
@@ -1365,6 +1349,21 @@ __u8 *irlmp_hint_to_service(__u8 *hint)
 
 	return service;
 }
+#endif
+
+const __u16 service_hint_mapping[S_END][2] = {
+	{ HINT_PNP,		0 },			/* S_PNP */
+	{ HINT_PDA,		0 },			/* S_PDA */
+	{ HINT_COMPUTER,	0 },			/* S_COMPUTER */
+	{ HINT_PRINTER,		0 },			/* S_PRINTER */
+	{ HINT_MODEM,		0 },			/* S_MODEM */
+	{ HINT_FAX,		0 },			/* S_FAX */
+	{ HINT_LAN,		0 },			/* S_LAN */
+	{ HINT_EXTENSION,	HINT_TELEPHONY },	/* S_TELEPHONY */
+	{ HINT_EXTENSION,	HINT_COMM },		/* S_COMM */
+	{ HINT_EXTENSION,	HINT_OBEX },		/* S_OBEX */
+	{ 0xFF,			0xFF },			/* S_ANY */
+};
 
 /*
  * Function irlmp_service_to_hint (service)
@@ -1377,46 +1376,9 @@ __u16 irlmp_service_to_hint(int service)
 {
 	__u16_host_order hint;
 
-	hint.word = 0;
+	hint.byte[0] = service_hint_mapping[service][0];
+	hint.byte[1] = service_hint_mapping[service][1];
 
-	switch (service) {
-	case S_PNP:
-		hint.byte[0] |= HINT_PNP;
-		break;
-	case S_PDA:
-		hint.byte[0] |= HINT_PDA;
-		break;
-	case S_COMPUTER:
-		hint.byte[0] |= HINT_COMPUTER;
-		break;
-	case S_PRINTER:
-		hint.byte[0] |= HINT_PRINTER;
-		break;
-	case S_MODEM:
-		hint.byte[0] |= HINT_PRINTER;
-		break;
-	case S_LAN:
-		hint.byte[0] |= HINT_LAN;
-		break;
-	case S_COMM:
-		hint.byte[0] |= HINT_EXTENSION;
-		hint.byte[1] |= HINT_COMM;
-		break;
-	case S_OBEX:
-		hint.byte[0] |= HINT_EXTENSION;
-		hint.byte[1] |= HINT_OBEX;
-		break;
-	case S_TELEPHONY:
-		hint.byte[0] |= HINT_EXTENSION;
-		hint.byte[1] |= HINT_TELEPHONY;
-		break;
-	case S_ANY:
-		hint.word = 0xffff;
-		break;
-	default:
-		IRDA_DEBUG( 1, "%s(), Unknown service!\n", __FUNCTION__);
-		break;
-	}
 	return hint.word;
 }
 
@@ -1438,7 +1400,7 @@ void *irlmp_register_service(__u16 hints
 		IRDA_DEBUG(1, "%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return 0;
 	}
-	service->hints = hints;
+	service->hints.word = hints;
 	hashbin_insert(irlmp->services, (irda_queue_t *) service,
 		       (long) service, NULL);
 
@@ -1481,7 +1443,7 @@ int irlmp_unregister_service(void *handl
 	spin_lock_irqsave(&irlmp->services->hb_spinlock, flags);
         service = (irlmp_service_t *) hashbin_get_first(irlmp->services);
         while (service) {
-		irlmp->hints.word |= service->hints;
+		irlmp->hints.word |= service->hints.word;
 
                 service = (irlmp_service_t *)hashbin_get_next(irlmp->services);
         }
@@ -1499,7 +1461,7 @@ int irlmp_unregister_service(void *handl
  *    Returns: handle > 0 on success, 0 on error
  */
 void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
-			    DISCOVERY_CALLBACK1 expir_clb, void *priv)
+			    DISCOVERY_CALLBACK2 expir_clb, void *priv)
 {
 	irlmp_client_t *client;
 
@@ -1514,7 +1476,7 @@ void *irlmp_register_client(__u16 hint_m
 	}
 
 	/* Register the details */
-	client->hint_mask = hint_mask;
+	client->hint_mask.word = hint_mask;
 	client->disco_callback = disco_clb;
 	client->expir_callback = expir_clb;
 	client->priv = priv;
@@ -1535,7 +1497,7 @@ void *irlmp_register_client(__u16 hint_m
  */
 int irlmp_update_client(void *handle, __u16 hint_mask,
 			DISCOVERY_CALLBACK1 disco_clb,
-			DISCOVERY_CALLBACK1 expir_clb, void *priv)
+			DISCOVERY_CALLBACK2 expir_clb, void *priv)
 {
 	irlmp_client_t *client;
 
@@ -1548,7 +1510,7 @@ int irlmp_update_client(void *handle, __
 		return -1;
 	}
 
-	client->hint_mask = hint_mask;
+	client->hint_mask.word = hint_mask;
 	client->disco_callback = disco_clb;
 	client->expir_callback = expir_clb;
 	client->priv = priv;
diff -u -p -r linux/net/irda-d4/irnet/irnet_irda.c linux/net/irda/irnet/irnet_irda.c
--- linux/net/irda-d4/irnet/irnet_irda.c	Mon Nov  4 14:30:05 2002
+++ linux/net/irda/irnet/irnet_irda.c	Wed Jan  8 17:00:47 2003
@@ -1616,8 +1616,8 @@ irnet_discovervalue_confirm(int		result,
  *
  *    Got a discovery indication from IrLMP, post an event
  *
- * Note : IrLMP take care of matching the hint mask for us, we only
- * check if it is a "new" node...
+ * Note : IrLMP take care of matching the hint mask for us, and also
+ * check if it is a "new" node for us...
  *
  * As IrLMP filter on the IrLAN hint bit, we get both IrLAN and IrNET
  * nodes, so it's only at connection time that we will know if the
@@ -1633,7 +1633,7 @@ irnet_discovervalue_confirm(int		result,
  * is to messy, so we leave that to user space...
  */
 static void
-irnet_discovery_indication(discovery_t *	discovery,
+irnet_discovery_indication(discinfo_t *		discovery,
 			   DISCOVERY_MODE	mode,
 			   void *		priv)
 {
@@ -1643,21 +1643,12 @@ irnet_discovery_indication(discovery_t *
   DASSERT(priv == &irnet_server, , IRDA_OCB_ERROR,
 	  "Invalid instance (0x%X) !!!\n", (unsigned int) priv);
 
-  /* Check if node is discovered is a new one or an old one.
-   * We check when how long ago this node was discovered, with a
-   * coarse timeout (we may miss some discovery events or be delayed).
-   */
-  if((jiffies - discovery->first_timestamp) >= (sysctl_discovery_timeout * HZ))
-    {
-      return;		/* Too old, not interesting -> goodbye */
-    }
-
   DEBUG(IRDA_OCB_INFO, "Discovered new IrNET/IrLAN node %s...\n",
-	discovery->nickname);
+	discovery->info);
 
   /* Notify the control channel */
   irnet_post_event(NULL, IRNET_DISCOVER,
-		   discovery->saddr, discovery->daddr, discovery->nickname);
+		   discovery->saddr, discovery->daddr, discovery->info);
 
   DEXIT(IRDA_OCB_TRACE, "\n");
 }
@@ -1672,7 +1663,7 @@ irnet_discovery_indication(discovery_t *
  * check if it is a "new" node...
  */
 static void
-irnet_expiry_indication(discovery_t *	expiry,
+irnet_expiry_indication(discinfo_t *	expiry,
 			DISCOVERY_MODE	mode,
 			void *		priv)
 {
@@ -1683,11 +1674,11 @@ irnet_expiry_indication(discovery_t *	ex
 	  "Invalid instance (0x%X) !!!\n", (unsigned int) priv);
 
   DEBUG(IRDA_OCB_INFO, "IrNET/IrLAN node %s expired...\n",
-	expiry->nickname);
+	expiry->info);
 
   /* Notify the control channel */
   irnet_post_event(NULL, IRNET_EXPIRE,
-		   expiry->saddr, expiry->daddr, expiry->nickname);
+		   expiry->saddr, expiry->daddr, expiry->info);
 
   DEXIT(IRDA_OCB_TRACE, "\n");
 }
diff -u -p -r linux/net/irda-d4/irnet/irnet_irda.h linux/net/irda/irnet/irnet_irda.h
--- linux/net/irda-d4/irnet/irnet_irda.h	Mon Nov  4 14:30:07 2002
+++ linux/net/irda/irnet/irnet_irda.h	Wed Jan  8 17:00:47 2003
@@ -150,11 +150,11 @@ static void
 				    void *);
 #ifdef DISCOVERY_EVENTS
 static void
-	irnet_discovery_indication(discovery_t *,
+	irnet_discovery_indication(discinfo_t *,
 				   DISCOVERY_MODE,
 				   void *);
 static void
-	irnet_expiry_indication(discovery_t *,
+	irnet_expiry_indication(discinfo_t *,
 				DISCOVERY_MODE,
 				void *);
 #endif

^ permalink raw reply

* IS_ERR() in linux32.c
From: Greg Lindahl @ 2003-01-09  2:45 UTC (permalink / raw)
  To: linux-mips

The file arch/mips64/kernel/linux32.c has a bunch of uses of IS_ERR(),
some against pointers (which is what it's designed to be used with),
and some against integers. I see a patch posted in 2001 which fixes
that, but it was also fixing other things and didn't get applied.

Anyone have a comment? This is about 1/3 of the remaining warnings when
I do "make -s" on the kernel.

-- greg

^ permalink raw reply

* IrDA patches on the way for 2.5.55...
From: Jean Tourrilhes @ 2003-01-09  2:51 UTC (permalink / raw)
  To: Jeff Garzik, Linux kernel mailing list

	Hi Jeff,

	Now that I can again test IrDA on 2.5.X, this is time to send
you my next set of IrDA patches. I've picked the most important one in
my queue, the rest will come later. Those one have been on my web page
for more than 2 months, tested on 2.5.54 and are fairly important.
	Would you mind passing that to Linus ?

	Regards,

	Jean

P.S. : Happy new year...
P.S.2 : 16bit Pcmcia still doesn't seem to be happy on 2.5.54

-------------------------------------------------------------------

[FEATURE] : Add a new feature to the IrDA stack
[CORRECT] : Fix to have the correct/expected behaviour
[CRITICA] : Fix potential kernel crash

ir254_discovery_locking-2.diff :
------------------------------
	o [CRITICA] Fix remaining locking problem with discovery log
	o [CRITICA] Don't call expiry callback under spinlock
	o [FEATURE] Simplify/cleanup/optimise discovery/expiry code

ir254_driver_module_fixes-2.diff :
--------------------------------
	o [CORRECT] Use SET_MODULE_OWNER() in various IrDA drivers

ir254_new_wrapper-3.diff :
------------------------
	o [FEATURE] Properly inline in wrapper Tx path
	o [FEATURE] Rewrite/simplify/optimise wrapper Rx path
		Lower CPU overhead *and* kernel image size
	o [FEATURE] Add ZeroCopy in wrapper Rx path for drivers that support it
		I'll update drivers later on...

ir254_secondary_rr.diff :
-----------------------
	o [CORRECT] fix the secondary function to send RR and frames without
		the poll bit when it detect packet losses

ir254_ircomm_dce.diff :
---------------------
		<Patch from Jan Kiszka>
	o [CORRECT] Properly initialise IrCOMM status line (DCE settings)

^ permalink raw reply

* RE: opening a port..
From: mdew @ 2003-01-09  2:41 UTC (permalink / raw)
  To: Rob Sterenborg; +Cc: netfilter
In-Reply-To: <FD8F124A387AD6119F7900A0D218B321019A9D@hslex01.hslbz.local>

On Thu, 2003-01-09 at 03:24, Rob Sterenborg wrote:
> > ok, telnet from another machine to the router.
> > 
> > telnet 10.0.0.6 4662
> > Trying 10.0.0.6...
> > telnet: Unable to connect to remote host: Connection refused
> > 
> > what "service" should I be running? I simply want 4662 open both ways.
> 
> # netstat -an|grep 4662
> should tell you if your box is listening at all on port 4662.
> 
> If you run eDonkey server on the firewall box, open port in the INPUT
> chain.
> If your eDonkey server is *behind* the firewall, open the port in the
> FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662
iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?




^ permalink raw reply

* Re: length match problem
From: Fabrice MARIE @ 2003-01-09  2:39 UTC (permalink / raw)
  To: Jackfritt; +Cc: netfilter
In-Reply-To: <3E1CA2BF.6050707@boh.de>


Hello Joerg,

On Thursday 09 January 2003 06:14, Jackfritt wrote:
> Ok I have the following problem.
> iptables -A OUTPUT -o ppp0 -p tcp -m length --length :40 -j MARK --set-mark 10
> That should mark all ACK's or not ?
> When I try to do this I get the error:
> iptables: Invalid argument
> [...]
> So now my question is what am I doin wrong ?

Typically when the only error message from iptables
is 'Invalid Argument', the actual error message would
be most of the time in the kernel log.
i.e. If I run your command above, it tells me

# dmesg
MARK: can only be called from "mangle" table, not "filter"

So, you should be using a -t mangle in front..

Have a nice day,

Fabrice.
--
Fabrice MARIE

"Silly hacker, root is for administrators"
       -Unknown


^ permalink raw reply

* Re: SNAT in OUTPUT chain of the nat table question?
From: Joel Newkirk @ 2003-01-09  2:36 UTC (permalink / raw)
  To: bauer, netfilter
In-Reply-To: <20030109003721.GA26207@mit.edu>

On Wednesday 08 January 2003 07:37 pm, bauer@mit.edu wrote:
> Is there a good reason that I am unable to conceive of at the
> moment why SNAT is not a valid target in the OUTPUT chain of the
> nat table?

Turn this around somewhat.  Can you present a case where SNAT would need 
to be done in the nat OUTPUT chain, that could not also be performed in 
the nat POSTROUTING chain achieving the same effect?  Even if you're 
going to localhost, packets don't go from OUTPUT straight to INPUT.

That said, connections originating on the local box addressed to any IP 
of the box itself do NOT appear in the nat-PREROUTING chain. (If you try 
to DNAT in PREROUTING it still comes back in INPUT instead of 
forwarding) Obviously this is a case where DNAT would be required in nat 
OUTPUT, where it is in fact a valid target.  This is the only way to 
DNAT a connection from the box to itself and send it elsewhere.

> Thanks,
> Steve

j

(stealing someone else's apropos sig, I believe Antony Stone's :^)
--
Perfection in design is achieved not when there is nothing left to add, 
but rather when there is nothing left to take away.

 - Antoine de Saint-Exupery



^ permalink raw reply

* Re: patching iptables - how?
From: Fabrice MARIE @ 2003-01-09  2:34 UTC (permalink / raw)
  To: Mladen Meduric, netfilter
In-Reply-To: <20030108221616.1503.qmail@web12706.mail.yahoo.com>

On Thursday 09 January 2003 06:16, Mladen Meduric wrote:
> Hi all,
> just joined the list.
> Pretty new to linux/iptables (on SuSE8.0). I'm trying to patch from 1.2.5
> to 1.2.6a and then to 1.2.7a.
> Do have all patches. Tried "patch" command, but I seem can't figure it out
> properly. Would someone explain how to do this in couple of steps, please?
> Also, from reading other articles, after patching up or reinstalling
> iptables from scratch, is it necessary to recompile the kernel?

Hello,

If all you want is to apply the patches from patch-o-matic (especially the extensions), you can
have a look at the netfilter-extension-HOWTO:
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO.html
there is a little paragraph explaining how to use p-o-m.
For upgrading your iptables only, see the reply from Athan.

Have a nice day,

Fabrice.
--
Fabrice MARIE

"Silly hacker, root is for administrators"
       -Unknown


^ permalink raw reply

* Re: get_pteptr prototype
From: David Gibson @ 2003-01-09  2:33 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: paulus, devel list
In-Reply-To: <1042071086.1207.206.camel@granite.austin.ibm.com>


On Wed, Jan 08, 2003 at 06:11:25PM -0600, Hollis Blanchard wrote:
>
> On Wed, 2003-01-08 at 17:49, David Gibson wrote:
> > On Wed, Jan 08, 2003 at 09:48:48AM -0600, Hollis Blanchard wrote:
> > > It's simply a wrapper around successive pte/pmd/pgd_offset calls, with
> > > some error checking. Are you saying those calls are not the correct way
> > > to get the PTE pointer for an address?
> >
> > Trouble is that this will break badly in 2.5 where we use large-page
> > entries for the lowmem mapping.
>
> I'm happy to change it to something 2.5-friendly if someone can suggest
> how...
>
> Alternatively I can add 405LP to the XMON/KGDB/BDI2000 list of ifdefs
> that map the whole kernel writable, which would be overkill but avoid
> adding PTE manipulations.

Hmm... what's the reason that wakeup_info needs to be reserved in
head_4xx.S, rather than just being a normal variable in the data area
(which should be writable anyway)?  Its not obvious to me from the
patch.

Actually, skimming through the patch I noticed a minor nit: you only
have one .long in head_4xx.S reserving space for the wakeup_info
struct which is 3 words long.  In practice the . = in the exception
handlers will give you plenty of space, but I think it would be good
form to explicitly reserve the right amount of space.

--
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply

* Re: free software
From: Tomas Szepe @ 2003-01-09  2:32 UTC (permalink / raw)
  To: Billy Rose; +Cc: rms, lm, linux-kernel
In-Reply-To: <5.2.0.9.0.20030108181618.00b28100@pop.sbcglobal.yahoo.com>

> [passive_induction@sbcglobal.net]
> 
> after growing tired of trying to sift through the emails for tidbits of 
> useful code, i have come to the conclusion that this thread should be 
> geared towards something more constructive, otherwise i fear people will 
> begin to find `open source' and `free software' distasteful.

Would you guys *PLEASE* remove your earplugs and get this off lkml?
You have been hinted->told->flamed->insulted and you still don't get it.

Gear the thread towards whatever topics/issues/problems/points you find
important, but please do so somewhere else!  linux-kernel is NOT the place
for such discussions.

Thanks for understanding,
-- 
Tomas Szepe <szepe@pinerecords.com>

^ permalink raw reply

* Re: 405LP - Beech with SSX firmware
From: David Gibson @ 2003-01-09  2:23 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: embedded list
In-Reply-To: <1042053852.1207.176.camel@granite.austin.ibm.com>


On Wed, Jan 08, 2003 at 01:23:56PM -0600, Hollis Blanchard wrote:
> On Fri, 2002-12-20 at 17:36, Hollis Blanchard wrote:
> > Hi, this patch (copied from Arctic) allows Beech to boot with SSX
> > firmware. If there's a way to detect OpenBIOS vs PIBS (I've asked for
> > confirmation) then I think the Beech and Arctic ifdefs could be combined
> > in the file. There may not be though, and in the meantime this works.
>
> There is currently no way to detect PIBS, though I think I talked the
> developer into including "PIBS" string in the future.

I've applied the patch to 2_4_devel.

--
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply

* RE: Nvidia and its choice to read the GPL "differently"
From: Vlad@Vlad.geekizoid.com @ 2003-01-09  2:26 UTC (permalink / raw)
  To: rms; +Cc: linux-kernel
In-Reply-To: <E18WB8R-0004k9-00@fencepost.gnu.org>

Do you actually buy your own bullshit here?  If so, that's sad.  I used to
respect you.  I'd like to see you put your money where your mouth is - PROVE
that GNU (not just people who have release GPL'd software) contributed most
of the work to say Slackware, or Debian, or Red Hat.

Face it - you're full of it.  You're not fooling anyone either.

-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org]On Behalf Of Richard Stallman
Sent: Wednesday, January 08, 2003 2:00 AM
To: lm@bitmover.com
Cc: lm@bitmover.com; acahalan@cs.uml.edu; linux-kernel@vger.kernel.org
Subject: Re: Nvidia and its choice to read the GPL "differently"


    Great.  So not only is there no legal need to cite GNU in the Linux
    name, there is no ethical obligation either.

When you take part of my statement, stretch it, interpret it based on
assumptions you know I disagree with, and present the result as
something I said, that doesn't prove anything.  It is childish.

There is no ethical obligation to mention secondary contributions
incorporated in a large project.  There ethical obligation is to cite
the main developer.  In the GNU/Linux system, the GNU Project is the
principal contributor; the system is more GNU than anything else,
and we started it.


^ permalink raw reply

* Re: Problem running SMP on IBM xSeries 360
From: Sean Neakums @ 2003-01-09  2:15 UTC (permalink / raw)
  To: linux-smp
In-Reply-To: <2B2161DAD095C3458E0BCB9D99F574CB0B857C@sccsmxsusr06.pharma.aventis.com>

commence  Michael.Kropinack@aventis.com quotation:

> Can someone tell me why the kernel is seeing 4 CPU's when there are
> only 2?

Most likely your Pentium IVs support hyperthreading.

-- 
 /                          |
[|] Sean Neakums            |  Questions are a burden to others;
[|] <sneakums@zork.net>     |      answers a prison for oneself.
 \                          |

^ permalink raw reply

* Re: 2.4.19 ICMP redirects erroneously ignored
From: Tim Gardner @ 2003-01-09  2:21 UTC (permalink / raw)
  To: Ranjeet Shetye; +Cc: Linux Kernel Mailing List
In-Reply-To: <1042046214.17783.7.camel@ranjeet-linux-1>

I understand the ramifications of ICMP redirect and how it can be mis-used. 
However, the SuSE 8.1 default for non-forwarding 
(/proc/sys/net/ipv4ip_forward==0) Linux is to accept redirects. I also own 
the router, so I trust it.

rtg
On Wednesday 08 January 2003 10:16, Ranjeet Shetye wrote:
> On Thu, 2003-01-09 at 02:52, Tim Gardner wrote:
> > I'm getting pounded by ICMP redirects from my Nortel router. The
> > setup is a SuSE 8.1 (2.4.19) standard client with fixed IP and netmask.
> > The client is configured with a default route. However, there are
> > several routers on the subnet that the default router knows about.
> > Hence, the reason that the Nortel router emits ICMP redirects
> > which my client steadfastly ignores.
> >
> > I've RTFM, read the kernel source, and checked the relevant settings
> > (/proc/sys/net/ipv4/conf/all/*). I find in /proc/net/rt_cache that there
> > are 2 entries, one of which is marked RTCF_REDIRECTED.
> >
> > Why isn't this redirected route being used?
>
> AFAIK, because that would mean that you are allowing another machine to
> manipulate your routing tables by simply using ICMP. How do you know
> that you can trust the other machine, in this case, the nortel router ?
> The problem is not of (missing) functionality, its about trusting the
> integrity of the source of the ICMP redirect.
>
> > This seems like a problem that ought to be common to anyone that
> > has multiple routers on the same subnet. What am I missing?
> >
> > rtg
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/

-- 
Tim Gardner - timg@tpi.com 406-443-5357
TriplePoint, Inc. - http://www.tpi.com
PGP: http://www.tpi.com/PGP/Tim.txt

^ permalink raw reply

* Re: 2.4.20, .text.lock.swap cpu usage? (ibm x440)
From: James Cleverdon @ 2003-01-09  2:20 UTC (permalink / raw)
  To: Chris Wood, linux-kernel; +Cc: Andrea Arcangeli, Andrew Morton
In-Reply-To: <3E1A12B5.4020505@xmission.com>

On Monday 06 January 2003 03:35 pm, Chris Wood wrote:
> Due to kswapd problems in Redhat's 2.4.9 kernel, I have had to upgrade
> to the 2.4.20 kernel with the IBM Summit Patches for our IBM x440.  It
> has run very well with one exception, between 8:00am and 9:00am our
> server will see a cpu usage hit under the system resources (in top) and
> start to drag the server to a very slow situation where people can't
> access the server.
>
> See the following jpg of top as an example of the system usage.  It
> doesn't seem to be any one program.
>
> http://www.wencor.com/slow2.4.20.jpg
>
> When we start to have users log off the server (we have 300 telnet users
> that login) the system usually bounces right back to normal.  We have
> had to reboot once or twice to get it fully working again (lpd went into
> limbo and wouldn't come back).  After the server bounces back to normal,
> we can run the rest of the day without any trouble and under full heavy
> load.  I have never seen it happen at any other time of day and it
> doesn't happen every day.
>
> With some tips from James Cleverdon (IBM), I turned on some kernel
> debugging and got the following from readprofile when the server was
> having problems (truncated to the first 22 lines):
> 16480 total                                      0.0138
>    6383 .text.lock.swap                          110.0517
>    4689 .text.lock.vmscan                         28.2470
>    4486 shrink_cache                               4.6729
>     168 rw_swap_page_base                          0.6176
>     124 prune_icache                               0.5167
>      81 statm_pgd_range                            0.1534
>      51 .text.lock.inode                           0.0966
>      38 system_call                                0.6786
>      31 .text.lock.tty_io                          0.0951
>      31 .text.lock.locks                           0.1435
>      18 .text.lock.sched                           0.0373
>      16 _stext                                     0.2000
>      15 fput                                       0.0586
>      11 .text.lock.read_write                      0.0924
>       9 strnicmp                                   0.0703
>       9 do_wp_page                                 0.0110
>       9 do_page_fault                              0.0066
>       9 .text.lock.namei                           0.0073
>       9 .text.lock.fcntl                           0.0714
>       8 sys_read                                   0.0294
>
> Here is a snapshot when the server is fine, no problems (truncated):
> 1715833 total                                      1.4317
> 1677712 default_idle                             26214.2500
>    4355 system_call                               77.7679
>    2654 file_read_actor                           11.0583
>    2159 bounce_end_io_read                         5.8668
>    1752 put_filp                                  18.2500
>    1664 do_page_fault                              1.2137
>    1294 fget                                      20.2188
>    1246 do_wp_page                                 1.5270
>    1233 fput                                       4.8164
>    1138 posix_lock_file                            0.7903
>    1120 kmem_cache_alloc                           3.6842
>    1098 do_softirq                                 4.9018
>    1042 statm_pgd_range                            1.9735
>     882 kfree                                      6.1250
>     732 __loop_delay                              15.2500
>     673 flush_tlb_mm                               6.0089
>     610 fcntl_setlk64                              1.3616
>     554 __kill_fasync                              4.9464
>     498 zap_page_range                             0.4716
>     414 do_generic_file_read                       0.3696
>     409 __free_pages                               8.5208
>     401 sys_semop                                  0.3530
>
> I have to admit that most of this doesn't make a lot of sense to me and
> I don't know what the .text.lock.* processes are doing.  Any ideas?
> Anything I can try?
>
> Chris Wood
> Wencor West, Inc.

Chris,

You're showing all the signs of the "kswapd" bug present in v2.4 kernels.  
Well, kswapd gets blamed for the problem.  It is actually caused by using up 
nearly all of low memory with the buffer header and/or inode slab caches.  
(Cat /proc/slabinfo when kswapd is running >= 99% and see if those two caches 
have grown extra large.)  Anyway, kswapd gets triggered because a zone has 
hit its low memory threshold.  But kswapd can't swap buffer headers or 
inodes.  The situation is hopeless, yet kswapd presses on anyway, scouring 
every memory zone for pages to free, all the while holding important memory 
locks.

Meanwhile, every program that wants more memory will spin on those locks.  
That's what the .text.lock.* entries are:  the out-of-line spin code for each 
lock; it is used when the lock is already owned by some other CPU.

Net result:  a computer that runs like molasses in January.

Of the several proposed patches for this bug, Andrea Archangeli's and Andrew 
Morton's worked best in our tests.  I believe that Andrea was going to add in 
some of Andrew's code for the final fix.  The kernel that is on the SLES 8 / 
UL 1.0 gold CDs works fine so I assume the Vulcan Mind Meld on the patches 
went well.

Unfortunately, I don't have any references to the final patch set.

> -----------------------------------
> System Info From Here Down:
> IBM x440 - Dual Xeon 1.4ghz MP, with Hyperthreading turned on
> 6 gig RAM
> 2 internal 36gig drives mirrored
> 1 additional intel e1000 network card
> 2 IBM fibre adapters (QLA2300s) connected to a FastT700 SAN
> RedHat Advanced Server 2.1
> 2.4.20 kernel built using the RH 2.4.9e8summit .config file as template
>
[ Snip! ]

Our customers have seen this on large Dell boxes too.  I strongly suspect that 
any v2.4 system with lots of physical memory and high I/O bandwidth can cause 
this bug.


-- 
James Cleverdon
IBM xSeries Linux Solutions
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot com



^ permalink raw reply

* Re: patching iptables - how?
From: Vincent Lim @ 2003-01-09  2:11 UTC (permalink / raw)
  To: Mladen Meduric; +Cc: netfilter
In-Reply-To: <20030108221616.1503.qmail@web12706.mail.yahoo.com>

Mladen Meduric wrote:
> 
> Hi all,
> 
> just joined the list.
> Pretty new to linux/iptables (on SuSE8.0). I'm trying to patch from 1.2.5
> to 1.2.6a and then to 1.2.7a.

Why not just use 1.2.7a instead?
Anyway, the patch command should be like this:
# cd /path/to/iptables/source
# patch -p1 < /path/to/patch

Do this for all remaining patches.

> Do have all patches. Tried "patch" command, but I seem can't figure it out
> properly. Would someone explain how to do this in couple of steps, please?
> Also, from reading other articles, after patching up or reinstalling
> iptables from scratch, is it necessary to recompile the kernel?

In most cases (AFAIK), no. If you're using the same kernel during the
compilation (of iptables), iptables will reference whatever libraries
that exist for the current kernel. If you decide to switch kernels, you
probably might need to recompile iptables as certain libraries might
have underwent a significant tweak/hack/modification and might render
iptables in-operable.

-- 
Vincent Lim
Software Engineer
NESTAC Solution Sdn Bhd
vincent.lim@nestac.com | +(6012) 659-6609


^ permalink raw reply

* Re: [Lustre-devel] Re: fixing redundant network opens on Linux file creation
From: Bryan Henderson @ 2003-01-09  2:08 UTC (permalink / raw)
  To: Peter Braam
  Cc: Andreas Dilger, Jan Hudec, linux-fsdevel, linux-fsdevel-owner,
	Lustre Development Mailing List, Richard Sharpe, samba-technical,
	Mike Shaver, Steven French
In-Reply-To: <20030108191145.GE28656@peter.cfs>





>I have no objections to a name change.  We are not so religious about
>"intent" as a name.

How religious are you about the idea of having to have BOTH a lookup2()
that contains all the information necessary to create a directory if the
name is available, AND a subsequent "create directory" call?  Because once
you remove the word "intent" from the description, that looks even more
silly.

It is the relationship between those two (sometimes 3) redundant calls that
is the real substance in what otherwise appears to be just a naming issue.


^ permalink raw reply

* Re: free software [OT]
From: Mark Rutherford @ 2003-01-09  2:16 UTC (permalink / raw)
  To: Billy Rose, linux-kernel@vger.kernel.org
In-Reply-To: <5.2.0.9.0.20030108200715.020a23c0@pop.sbcglobal.yahoo.com>



Billy Rose wrote:

> At 02:00 AM 1/9/2003 +0000, Paulo Andre' wrote:
> >On Thu, 2003-01-09 at 01:52, Billy Rose wrote:
> > > after growing tired of trying to sift through the emails for tidbits of
> > > useful code, i have come to the conclusion that this thread should be
> > > geared towards something more constructive, otherwise i fear people will
> > > begin to find `open source' and `free software' distasteful.
> >
> ><snip>
> >
> >You're not RMS in disguise are you? I'm sorry but after all that Nvidia
> >noise I can believe in nearly anything.
> >
> >--
> >         Paulo Andre'
>
> `this thread' as stated above is in regards to the nvidia noise. no im not
> mr stallman, i happen to think linus is brilliant, as well as everyone else
> on this list.
>
> br

<sarcasm>
what if I thought he was god? :D
then I wouldnt think he is brilliant :D
</sarcasm>

all in good fun :-)

>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
Regards,
Mark Rutherford
mark@justirc.net


File: Mark Rutherford.ASC
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

mQGiBDqwRnsRBADTpKKSKAcphYdcVTvBpEFFNK1eL4dQ/pBwK4NimeoAA9ISD04L
Mv/CqH5g9D1wzXEhRBhbFZnmfoTPFEWH4Gjr4KIPdsXkTEfoJ2j55qksHWMkE10A
K8gZlI3Ovuf8BbIabfXmjf+XtId3F4+7+og4mc7EAkatYbbl/5pR0Niy3wCg/+I/
LUQPYGloF829jXaOW7C+tG8D/RZt8lAL/Z1NfGsQYZlE1X+Gcqf0J6HaMosnVuah
1zAbgUHCIvNq+TOC+0KydEvbs7tAq6m+Q4zQZaqEsMwufTCWxzh+v3thRBLIuT5E
jsTi4djkrdG3TTeAszymO/YEXQMg4Tq2hMiyeWlyTmH4C6enMu0zJMIu4OEef7+W
KpYhBACYnukDVI8Vnw1J5KaiCZYvERhj4cr3BTk7oeYxIRH1x5S6NXK0+uVcpusa
a8ZU4zcxvHh0k3iR8HIZcNh30eXbMF/J5pW9gorJuPwCC5Q7b+gUVaeec+1X+Wmt
2k8RAq9RtriUdrmVN5QcPBLFd4hOHQcWDcuyhmiFp68LFvxLSLQrTWFyayBSdXRo
ZXJmb3JkIDxNYXJrMjAwMEBiZWxsYXRsYW50aWMubmV0PokAWAQQEQIAGAUCOrBG
ewgLAwkIBwIBCgIZAQUbAwAAAAAKCRAudCWX7QO6ULcaAJwIsYHeAp6FC5OVWSOo
qc8O87kvBgCgz1cLgVXYcSlDWEeE32PFYb6akuy5Ag0EOrBGexAIAPZCV7cIfwgX
cqK61qlC8wXo+VMROU+28W65Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdMZIZJ+AyD
vWXpF9Sh01D49Vlf3HZSTz09jdvOmeFXklnN/biudE/F/Ha8g8VHMGHOfMlm/xX5
u/2RXscBqtNbno2gpXI61Brwv0YAWCvl9Ij9WE5J280gtJ3kkQc2azNsOA1FHQ98
iLMcfFstjvbzySPAQ/ClWxiNjrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq/zzhsSlA
GBGNfISnCnLWhsQDGcgHKXrKlQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2JSyIZJrqr
ol7DVekyCzsAAgIIAO5Bt3XOgo2GPNOCuLv6A6mRxPxwwVsYEMmVAIp/c5nluBMi
Tu4iQU5f3U9UqZMcFKyLr1Vh0bpO6RB6L/5tXWSRY2Yly9Ofg/e0Npgebkdd8GXE
+IuEDI4lr1kbO70hlxFUPKSOQRjSmmVKNhUAiXEFQ7OtB9k5GECsHrD6qxR6r/ny
XMBK2g2UUSh17Gx/pqH+XwXJ67DEQmF8hcnyiN9E3WQ5w3bIbKwFCaHF+tJbVnUd
XxszxQYrsb6Feo0FVdCD+VVPQGesv34CrnKuED/mF/WoI8a3eYCMiY03IQgW514X
JX+Jnmk9RFbTg75NdXIKDqKpB3wq39n3JmWRZG+JAEwEGBECAAwFAjqwRnsFGwwA
AAAACgkQLnQll+0DulAfjgCfbVxiUtJbpXPn6gVJlnlIzur1yvgAnjh/9bdLsSrd
cUaN07NL7N9NjgG1
=hpbN
-----END PGP PUBLIC KEY BLOCK-----



^ permalink raw reply

* Re: 2.4.19 ICMP redirects erroneously ignored
From: Ranjeet Shetye @ 2003-01-08 17:16 UTC (permalink / raw)
  To: timg; +Cc: Linux Kernel Mailing List
In-Reply-To: <200301081852.05547.rtg@tim.rtg.net>

On Thu, 2003-01-09 at 02:52, Tim Gardner wrote:
> I'm getting pounded by ICMP redirects from my Nortel router. The
> setup is a SuSE 8.1 (2.4.19) standard client with fixed IP and netmask.
> The client is configured with a default route. However, there are
> several routers on the subnet that the default router knows about.
> Hence, the reason that the Nortel router emits ICMP redirects
> which my client steadfastly ignores.
> 
> I've RTFM, read the kernel source, and checked the relevant settings 
> (/proc/sys/net/ipv4/conf/all/*). I find in /proc/net/rt_cache that there are 
> 2 entries, one of which is marked RTCF_REDIRECTED.
> 
> Why isn't this redirected route being used? 

AFAIK, because that would mean that you are allowing another machine to
manipulate your routing tables by simply using ICMP. How do you know
that you can trust the other machine, in this case, the nortel router ?
The problem is not of (missing) functionality, its about trusting the
integrity of the source of the ICMP redirect.

> 
> This seems like a problem that ought to be common to anyone that
> has multiple routers on the same subnet. What am I missing?
> 
> rtg
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-- 
Ranjeet Shetye
Senior Software Engineer
Zultys Technologies
Ranjeet dot Shetye2 at Zultys dot com
http://www.zultys.com/


^ permalink raw reply

* kernel compile error
From: Rodrigo F. Baroni @ 2003-01-09  2:15 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

Hello all,


    There is a good time that I have trying to compile
a kernel in a pc 233 mhz (motherboard lmr 591 -
chipset sis, all-on-board), and so the follow error
below happen.


     Does anybody knows what is going on please ?!
(it's a 2.4.18 kernel in a debian 3)




Rodrigo F Baroni
Computer Science Grad Student

_______________________________________________________________________
Busca Yahoo!
O melhor lugar para encontrar tudo o que você procura na Internet
http://br.busca.yahoo.com/

[-- Attachment #2: kernel_log.txt --]
[-- Type: text/plain, Size: 3284 bytes --]

make[2]: Entering directory `/usr/src/kernel-source-2.4.18/kernel'
gcc -D__KERNEL__ -I/usr/src/kernel-source-2.4.18/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pi
pe -mpreferred-stack-boundary=2 -march=i586   -DKBUILD_BASENAME=ksyms  -DEXPORT_SYMTAB -c ksyms.c
In file included from /usr/src/kernel-source-2.4.18/include/linux/modversions.h:64,
                 from /usr/src/kernel-source-2.4.18/include/linux/module.h:21,
                 from ksyms.c:14:
/usr/src/kernel-source-2.4.18/include/linux/modules/dec_and_lock.ver:2: warning: `atomic_dec_and_lock' redefined
/usr/src/kernel-source-2.4.18/include/linux/spinlock.h:48: warning: this is the location of the previous definition
In file included from /usr/src/kernel-source-2.4.18/include/linux/modversions.h:117,
                 from /usr/src/kernel-source-2.4.18/include/linux/module.h:21,
                 from ksyms.c:14:
/usr/src/kernel-source-2.4.18/include/linux/modules/i386_ksyms.ver:84: warning: `cpu_data' redefined
/usr/src/kernel-source-2.4.18/include/asm/processor.h:79: warning: this is the location of the previous definition
/usr/src/kernel-source-2.4.18/include/linux/modules/i386_ksyms.ver:88: warning: `smp_num_cpus' redefined
/usr/src/kernel-source-2.4.18/include/linux/smp.h:80: warning: this is the location of the previous definition
/usr/src/kernel-source-2.4.18/include/linux/modules/i386_ksyms.ver:90: warning: `cpu_online_map' redefined
/usr/src/kernel-source-2.4.18/include/linux/smp.h:88: warning: this is the location of the previous definition
/usr/src/kernel-source-2.4.18/include/linux/modules/i386_ksyms.ver:104: warning: `smp_call_function' redefined
/usr/src/kernel-source-2.4.18/include/linux/smp.h:87: warning: this is the location of the previous definition
In file included from /usr/src/kernel-source-2.4.18/include/linux/modversions.h:144,
                 from /usr/src/kernel-source-2.4.18/include/linux/module.h:21,
                 from ksyms.c:14:
/usr/src/kernel-source-2.4.18/include/linux/modules/ksyms.ver:526: warning: `del_timer_sync' redefined
/usr/src/kernel-source-2.4.18/include/linux/timer.h:30: warning: this is the location of the previous definition
In file included from /usr/src/kernel-source-2.4.18/include/linux/interrupt.h:45,
                 from ksyms.c:21:
/usr/src/kernel-source-2.4.18/include/asm/hardirq.h:37: warning: `synchronize_irq' redefined
/usr/src/kernel-source-2.4.18/include/linux/modules/i386_ksyms.ver:92: warning: this is the location of the previous definition
In file included from ksyms.c:17:
/usr/src/kernel-source-2.4.18/include/linux/kernel_stat.h: In function `kstat_irqs':
/usr/src/kernel-source-2.4.18/include/linux/kernel_stat.h:48: `smp_num_cpus' undeclared (first use in this function)
/usr/src/kernel-source-2.4.18/include/linux/kernel_stat.h:48: (Each undeclared identifier is reported only once
/usr/src/kernel-source-2.4.18/include/linux/kernel_stat.h:48: for each function it appears in.)
make[2]: *** [ksyms.o] Error 1
make[2]: Leaving directory `/usr/src/kernel-source-2.4.18/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.4.18/kernel'
make: *** [_dir_kernel] Error 2
carol:/usr/src/kernel-source-2.4.18# 


^ permalink raw reply

* Re: free software
From: Billy Rose @ 2003-01-09  2:11 UTC (permalink / raw)
  To: Paulo Andre'; +Cc: rms, lm, linux-kernel
In-Reply-To: <1042077617.28496.13.camel@nostromo.orion.int>

At 02:00 AM 1/9/2003 +0000, Paulo Andre' wrote:
>On Thu, 2003-01-09 at 01:52, Billy Rose wrote:
> > after growing tired of trying to sift through the emails for tidbits of
> > useful code, i have come to the conclusion that this thread should be
> > geared towards something more constructive, otherwise i fear people will
> > begin to find `open source' and `free software' distasteful.
>
><snip>
>
>You're not RMS in disguise are you? I'm sorry but after all that Nvidia
>noise I can believe in nearly anything.
>
>--
>         Paulo Andre'

`this thread' as stated above is in regards to the nvidia noise. no im not 
mr stallman, i happen to think linus is brilliant, as well as everyone else 
on this list.

br 



^ permalink raw reply

* Re(3): Making this list more readable
From: Carol Anne Ogdin @ 2003-01-09  2:02 UTC (permalink / raw)
  To: Athan; +Cc: Ian Batterbee, netfilter


[-- Attachment #1.1: Type: text/plain, Size: 2673 bytes --]

Thanks, Athan...

I try to get it in digest so I can read it all at once at the end of the 
day.  When I was getting it message-by-message, I was finding messages 
getting lost in my voracious spam-killing mode.  I'm trying to learn 
iptables by watching how you experts help other folks' questions.

Question:  Would anybody be interested in a more user-friendly web-based 
solution for this list, so people could go back and read old threads 
instead of posing the same questions over 'n' over again?  I've got a free 
one available to me, if you'd like to try it.

--Carol Anne 
Carol Anne Ogdin
http://www.net-working.com
530/295-3657
Deep Woods Technology, Inc.
http://www.deepwoods.com
CAOgdin@deepwoods.com
Leveraging technology to restore the soul of the organization





Athan <netfilter@miggy.org>
01/08/2003 05:27 PM

 
        To:     Ian Batterbee <ian.batterbee@aut.ac.nz>
        cc:     netfilter@lists.netfilter.org, Athan <netfilter@miggy.org>, Carol Anne 
Ogdin <caogdin@deepwoods.com>
        Subject:        Re: Subject: Re: Making this list more readable





On Thu, Jan 09, 2003 at 12:37:32PM +1300, Ian Batterbee wrote:
> I see the problem as well.. I think it's caused by the fact that many of 

> the individual messages in the  are content-transfer-encoding: 
> quoted-printable, but the digest has no content-transfer-encoding in the 

> header, so the quoted-printable data inside the messages included in the 

> digest is treated as plain text and incorrectly formatted.
> 
> If we know that ALL messages contained in the digest are 
> quoted-printable, then it would just be a matter of changing the 
> content-type of the digest, but I've noticed the problem doesn't occur 
> on all messages.. some are fine.. so...  I guess people's mailers are 
> simply posting as quoted-printable, and the digest process is just 
> including the message body as-is

  Having checked and found this list is run with mailman, and then
checked the options for a list I have admin access to the solution is to
just make the digests 'plain' rather than 'mime'.  I presume the former
means you get one big file in mbox style, which may cause some people
problems too I guess.  This list is mailman 2.0.11, the one I checked is
2.0.12, so there's not going to be any extra options in this list's
config for it.

  Of course you could just read it in normal mode rather than digest ;).

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
                    "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME



[-- Attachment #1.2: Type: text/html, Size: 4437 bytes --]

[-- Attachment #2: attorsoj.dat --]
[-- Type: application/octet-stream, Size: 248 bytes --]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj4c0AUACgkQzbc+I5XfxKdjiwCff0T7G1MaC99HlI3ZHnwDOx40
k7gAmway8PH8NLVpT6sWbWyzXSNLZ6mz
=7mWZ
-----END PGP SIGNATURE-----

^ permalink raw reply

* RE: opening a port..
From: mdew @ 2003-01-09  1:58 UTC (permalink / raw)
  To: Rob Sterenborg; +Cc: netfilter
In-Reply-To: <FD8F124A387AD6119F7900A0D218B321019A9D@hslex01.hslbz.local>

On Thu, 2003-01-09 at 03:24, Rob Sterenborg wrote:
> > ok, telnet from another machine to the router.
> > 
> > telnet 10.0.0.6 4662
> > Trying 10.0.0.6...
> > telnet: Unable to connect to remote host: Connection refused
> > 
> > what "service" should I be running? I simply want 4662 open both ways.
> 
> # netstat -an|grep 4662
> should tell you if your box is listening at all on port 4662.
> 
> If you run eDonkey server on the firewall box, open port in the INPUT
> chain.
> If your eDonkey server is *behind* the firewall, open the port in the
> FORWARD chain, and add a DNAT rule in the nat table -> PREROUTING chain.

the edonkey server is behind the firewall

210.54.175.12--->eth0 (Router) 10.0.0.6(eth1)--->10.0.0.x

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 210.54.175.12 --dport 4662 -j DNAT --to 10.0.0.6:4662
iptables -A FORWARD -p tcp -i eth0 -d 10.0.0.6 --dport 4662 -j ACCEPT

like that?



^ permalink raw reply

* Re: Linux 2.4.21pre3-ac2
From: Paulo Andre' @ 2003-01-09  2:02 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel
In-Reply-To: <200301090139.h091d9G26412@devserv.devel.redhat.com>

On Thu, 2003-01-09 at 01:39, Alan Cox wrote:
> The skb_padto bug is quite ugly so people really want to be using ac2 not
> ac1. 

Considering you seem to have revived 2.4-ac, would you be interested in collecting
various bugixes wrt cli/save_flags/restore_flags or is that better off in 2.5?
(or maybe it doesn't even really matter?)

--
	Paulo Andre'


^ permalink raw reply

* Re: free software
From: Paulo Andre' @ 2003-01-09  2:00 UTC (permalink / raw)
  To: Billy Rose; +Cc: rms, lm, linux-kernel
In-Reply-To: <5.2.0.9.0.20030108181618.00b28100@pop.sbcglobal.yahoo.com>

On Thu, 2003-01-09 at 01:52, Billy Rose wrote:
> after growing tired of trying to sift through the emails for tidbits of 
> useful code, i have come to the conclusion that this thread should be 
> geared towards something more constructive, otherwise i fear people will 
> begin to find `open source' and `free software' distasteful.

<snip>

You're not RMS in disguise are you? I'm sorry but after all that Nvidia
noise I can believe in nearly anything.

-- 
	Paulo Andre'


^ permalink raw reply

* free software
From: Billy Rose @ 2003-01-09  1:52 UTC (permalink / raw)
  To: rms; +Cc: lm, linux-kernel, linux-kernel

after growing tired of trying to sift through the emails for tidbits of 
useful code, i have come to the conclusion that this thread should be 
geared towards something more constructive, otherwise i fear people will 
begin to find `open source' and `free software' distasteful.

in an ideal world (star trek comes to mind), everything would be free, not 
just software. everything has stemmed in some way from an idea, or group of 
ideas, even if it is a piece of furniture. money would not exist in such a 
free world, and people would work for incentives based upon the type of job 
they perform (i.e. a trash collector is only required to work one day a 
month while a corporate ceo which must work 7 days a week) and/or their 
abilities. such a system would be formed from a 100% pure democracy with 0% 
capitalism. if you choose not to work (the choice is yours), you starve and 
die on the street, simple as that. but the choice is yours. freedom is 
about personal choices that do not impact others in a negative way which 
removes their freedom. open source software (democratic software + possible 
capitalistic gains), such as the linux kernel, is the first step needed 
towards free software (democratic software ~period~). mr stallman, please 
think of open source as a step towards what it is you are working for. the 
world will not change in a few short years. but, it does change, and change 
it has towards free software.

two separate arguments to show the counter productiveness of this whole 
thread (open source against free software):

in regards to the whole cam issue allowing modules to be used bypassing the 
include of the headers, it was mentioned that firmware is not software, and 
hence, is not subject to the gpl as such. i could argue against this point 
and win in court. it is quite simple. software and firmware are both 
generated via instructions that are compiled into a machine readable form. 
the only difference is that at runtime, the storage mechanisms are 
different. today, i inserted a floppy disk into a computer and updated the 
firmware on the system board. during the time that firmware was on the 
floppy, was it not a binary object no different than any other program? 
shouldnt it be conceived that all binaries within in a computer are equal 
under the vision of the law, regardless of storage type? or does a 
particular storage format encapsulate the contents to make them 
unsusceptible to certain types of law, and hence could be deemed as 
inadmissible in court. if such is the case, then who determines the 
containers that are admissible? what characteristics make a container 
exempt? could i program an eprom with the linux kernel + gnu system and 
close source it since it is in firmware? the question is quite ridiculous. 
a container would never make something contained within it exempt from law. 
hence, it is obviously legal for mr torvalds, mr stallman, and all the 
other copyright holders of linux and gnu to sue someone that uses it in a 
chip and does not make available the sources.

at the same time that the cam argument for closed sources can be shot down, 
it can be shown that the kernel can be opened up to allow closed source 
binaries to coexist with the gpl. a kernel patch, call it `sys_binary' can 
be created that is released under the gpl. it exports a very simple api 
with one function taking one parameter: kernel_request(struct_req *req), 
such that closed source binaries used as modules call upon it. based upon 
the values within the struct_req struct, the sys_binary patch (module?) 
calls one of the kernel sys functions passing it parameters retrieved from 
other members of the struct. the header file for this module is then 
released to _public_ _domain_. even if the patch is not included in the 
main kernel, hence not distributed with the kernel sources, the patch could 
be maintained somewhere accessible to the public with a version for each 
kernel. the closed source binary that calls upon kernel_request() could not 
be shown as a derivative of the kernel as _all_ programs request kernel 
functions, and this function is vague and general. furthermore, since the 
header file for sys_binary is released as public domain by its author, the 
header file can be used without discretion.

now, where have we gotten with all of this argument? what is accomplished 
is nothing. the drive towards a free software society does not gain from 
arguments within the community itself, even if the sides involved could be 
segregated into `cousins'. free software _needs_ the open source movement 
to allow society as a whole to come to terms with what free software stands 
for, and the benefits it can create. in years to come, perhaps truly free 
software will result from all of the efforts made by everyone working under 
the umbrella of `free software' today.

with the high level of energy i have seen coming from people about all of 
this, just imagine what could be accomplished if you teamed up and started 
working towards a truly free world of software? imagine not being able to 
access any software on your computer because a law was passed declaring the 
`hard drive' as a cam device. again, i ask you to please think about it... 
there are people with very large incentives trying to break apart this 
community.


billy rose



^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.