All of lore.kernel.org
 help / color / mirror / Atom feed
* [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number.
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
@ 2011-03-05  1:02 ` Greg KH
  2011-03-05  1:02 ` [02/18] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl Greg KH
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Tristan Ye, Joel Becker

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Tristan Ye <tristan.ye@oracle.com>

commit acf3bb007e5636ef4c17505affb0974175108553 upstream.

Current refcounttree codes actually didn't writeback the new pages out in
write-back mode, due to a bug of always passing a ZERO number of clusters
to 'ocfs2_cow_sync_writeback', the patch tries to pass a proper one in.

Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/refcounttree.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3236,7 +3236,7 @@ static int ocfs2_make_clusters_writable(
 					u32 num_clusters, unsigned int e_flags)
 {
 	int ret, delete, index, credits =  0;
-	u32 new_bit, new_len;
+	u32 new_bit, new_len, orig_num_clusters;
 	unsigned int set_len;
 	struct ocfs2_super *osb = OCFS2_SB(sb);
 	handle_t *handle;
@@ -3269,6 +3269,8 @@ static int ocfs2_make_clusters_writable(
 		goto out;
 	}
 
+	orig_num_clusters = num_clusters;
+
 	while (num_clusters) {
 		ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,
 					     p_cluster, num_clusters,
@@ -3356,7 +3358,8 @@ static int ocfs2_make_clusters_writable(
 	 * in write-back mode.
 	 */
 	if (context->get_clusters == ocfs2_di_get_clusters) {
-		ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters);
+		ret = ocfs2_cow_sync_writeback(sb, context, cpos,
+					       orig_num_clusters);
 		if (ret)
 			mlog_errno(ret);
 	}



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [02/18] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl.
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
  2011-03-05  1:02 ` [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number Greg KH
@ 2011-03-05  1:02 ` Greg KH
  2011-03-05  1:02 ` [03/18] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Greg KH
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Dave Airlie

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Dave Airlie <airlied@redhat.com>

commit 1922756124ddd53846877416d92ba4a802bc658f upstream.

This fixes CVE-2011-1013.

Reported-by: Matthiew Herrb (OpenBSD X.org team)
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/drm_irq.c |    3 ++-
 include/drm/drmP.h        |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -540,7 +540,8 @@ int drm_modeset_ctl(struct drm_device *d
 		    struct drm_file *file_priv)
 {
 	struct drm_modeset_ctl *modeset = data;
-	int crtc, ret = 0;
+	int ret = 0;
+	unsigned int crtc;
 
 	/* If drm_vblank_init() hasn't been called yet, just no-op */
 	if (!dev->num_crtcs)
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1016,7 +1016,7 @@ struct drm_device {
 	struct pci_controller *hose;
 #endif
 	struct drm_sg_mem *sg;	/**< Scatter gather memory */
-	int num_crtcs;                  /**< Number of CRTCs on this device */
+	unsigned int num_crtcs;                  /**< Number of CRTCs on this device */
 	void *dev_private;		/**< device private data */
 	void *mm_private;
 	struct address_space *dev_mapping;



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [03/18] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
  2011-03-05  1:02 ` [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number Greg KH
  2011-03-05  1:02 ` [02/18] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl Greg KH
@ 2011-03-05  1:02 ` Greg KH
  2011-03-05  1:02 ` [04/18] x86: Use u32 instead of long to set reset vector back to 0 Greg KH
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jochen Friedrich,
	Samuel Ortiz

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Jochen Friedrich <jochen@scram.de>

commit 9063f1f15eec35e5fd608879cef8be5728f2d12a upstream.

Call input_set_abs_params instead of manually setting absbit only.
This fixes this oops:

Unable to handle kernel NULL pointer dereference at virtual address 00000024
Internal error: Oops: 41b67017 [#1]
CPU: 0    Not tainted  (2.6.37 #4)
pc : [<c016d1fc>]    lr : [<00000000>]    psr: 20000093
sp : c19e5f30  ip : c19e5e6c  fp : c19e5f58
r10: 00000000  r9 : c19e4000  r8 : 00000003
r7 : 000001e4  r6 : 00000001  r5 : c1854400  r4 : 00000003
r3 : 00000018  r2 : 00000018  r1 : 00000018  r0 : c185447c
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: c1b6717f  Table: c1b6717f  DAC: 00000017
Stack: (0xc19e5f30 to 0xc19e6000)
5f20:                                     00000003 00000003 c1854400 00000013
5f40: 00000001 000001e4 000001c5 c19e5f80 c19e5f5c c016d5e8 c016cf5c 000001e4
5f60: c1854400 c18b5860 00000000 00000171 000001e4 c19e5fc4 c19e5f84 c01559a4
5f80: c016d584 c18b5868 00000000 c1bb5c40 c0035afc c18b5868 c18b5868 c1a55d54
5fa0: c18b5860 c0155750 00000013 00000000 00000000 00000000 c19e5ff4 c19e5fc8
5fc0: c0050174 c015575c 00000000 c18b5860 00000000 c19e5fd4 c19e5fd4 c1a55d54
5fe0: c00500f0 c003b464 00000000 c19e5ff8 c003b464 c00500fc 04000400 04000400
Backtrace:
Function entered at [<c016cf50>] from [<c016d5e8>]
Function entered at [<c016d578>] from [<c01559a4>]
 r8:000001e4 r7:00000171 r6:00000000 r5:c18b5860 r4:c1854400
Function entered at [<c0155750>] from [<c0050174>]
Function entered at [<c00500f0>] from [<c003b464>]
 r6:c003b464 r5:c00500f0 r4:c1a55d54
Code: e59520fc e1a03286 e0433186 e0822003 (e592000c)

>>PC;  c016d1fc <input_handle_event+2ac/5a0>   <=====

Trace; c016cf50 <input_handle_event+0/5a0>
Trace; c016d5e8 <input_event+70/88>
Trace; c016d578 <input_event+0/88>
Trace; c01559a4 <ucb1x00_thread+254/2dc>
Trace; c0155750 <ucb1x00_thread+0/2dc>
Trace; c0050174 <kthread+84/8c>
Trace; c00500f0 <kthread+0/8c>
Trace; c003b464 <do_exit+0/624>

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mfd/ucb1x00-ts.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00
 	idev->close      = ucb1x00_ts_close;
 
 	__set_bit(EV_ABS, idev->evbit);
-	__set_bit(ABS_X, idev->absbit);
-	__set_bit(ABS_Y, idev->absbit);
-	__set_bit(ABS_PRESSURE, idev->absbit);
 
 	input_set_drvdata(idev, ts);
 
+	ucb1x00_adc_enable(ts->ucb);
+	ts->x_res = ucb1x00_ts_read_xres(ts);
+	ts->y_res = ucb1x00_ts_read_yres(ts);
+	ucb1x00_adc_disable(ts->ucb);
+
+	input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0);
+	input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0);
+	input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0);
+
 	err = input_register_device(idev);
 	if (err)
 		goto fail;



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [04/18] x86: Use u32 instead of long to set reset vector back to 0
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (2 preceding siblings ...)
  2011-03-05  1:02 ` [03/18] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Greg KH
@ 2011-03-05  1:02 ` Greg KH
  2011-03-05  1:02 ` [05/18] fuse: fix hang of single threaded fuseblk filesystem Greg KH
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Don Zickus, Matthew Garrett,
	Ingo Molnar

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Don Zickus <dzickus@redhat.com>

commit 299c56966a72b9109d47c71a6db52097098703dd upstream.

A customer of ours, complained that when setting the reset
vector back to 0, it trashed other data and hung their box.
They noticed when only 4 bytes were set to 0 instead of 8,
everything worked correctly.

Mathew pointed out:

 |
 | We're supposed to be resetting trampoline_phys_low and
 | trampoline_phys_high here, which are two 16-bit values.
 | Writing 64 bits is definitely going to overwrite space
 | that we're not supposed to be touching.
 |

So limit the area modified to u32.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
LKML-Reference: <1297139100-424-1-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/include/asm/smpboot_hooks.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/include/asm/smpboot_hooks.h
+++ b/arch/x86/include/asm/smpboot_hooks.h
@@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_
 	 */
 	CMOS_WRITE(0, 0xf);
 
-	*((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
+	*((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0;
 }
 
 static inline void __init smpboot_setup_io_apic(void)



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [05/18] fuse: fix hang of single threaded fuseblk filesystem
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (3 preceding siblings ...)
  2011-03-05  1:02 ` [04/18] x86: Use u32 instead of long to set reset vector back to 0 Greg KH
@ 2011-03-05  1:02 ` Greg KH
  2011-03-05  1:03 ` [06/18] clockevents: Prevent oneshot mode when broadcast device is periodic Greg KH
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Miklos Szeredi

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit 5a18ec176c934ca1bc9dc61580a5e0e90a9b5733 upstream.

Single threaded NTFS-3G could get stuck if a delayed RELEASE reply
triggered a DESTROY request via path_put().

Fix this by

 a) making RELEASE requests synchronous, whenever possible, on fuseblk
 filesystems

 b) if not possible (triggered by an asynchronous read/write) then do
 the path_put() in a separate thread with schedule_work().

Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/fuse/file.c   |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
 fs/fuse/fuse_i.h |    6 +++++-
 2 files changed, 50 insertions(+), 8 deletions(-)

--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -86,18 +86,52 @@ struct fuse_file *fuse_file_get(struct f
 	return ff;
 }
 
+static void fuse_release_async(struct work_struct *work)
+{
+	struct fuse_req *req;
+	struct fuse_conn *fc;
+	struct path path;
+
+	req = container_of(work, struct fuse_req, misc.release.work);
+	path = req->misc.release.path;
+	fc = get_fuse_conn(path.dentry->d_inode);
+
+	fuse_put_request(fc, req);
+	path_put(&path);
+}
+
 static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
 {
-	path_put(&req->misc.release.path);
+	if (fc->destroy_req) {
+		/*
+		 * If this is a fuseblk mount, then it's possible that
+		 * releasing the path will result in releasing the
+		 * super block and sending the DESTROY request.  If
+		 * the server is single threaded, this would hang.
+		 * For this reason do the path_put() in a separate
+		 * thread.
+		 */
+		atomic_inc(&req->count);
+		INIT_WORK(&req->misc.release.work, fuse_release_async);
+		schedule_work(&req->misc.release.work);
+	} else {
+		path_put(&req->misc.release.path);
+	}
 }
 
-static void fuse_file_put(struct fuse_file *ff)
+static void fuse_file_put(struct fuse_file *ff, bool sync)
 {
 	if (atomic_dec_and_test(&ff->count)) {
 		struct fuse_req *req = ff->reserved_req;
 
-		req->end = fuse_release_end;
-		fuse_request_send_background(ff->fc, req);
+		if (sync) {
+			fuse_request_send(ff->fc, req);
+			path_put(&req->misc.release.path);
+			fuse_put_request(ff->fc, req);
+		} else {
+			req->end = fuse_release_end;
+			fuse_request_send_background(ff->fc, req);
+		}
 		kfree(ff);
 	}
 }
@@ -219,8 +253,12 @@ void fuse_release_common(struct file *fi
 	 * Normally this will send the RELEASE request, however if
 	 * some asynchronous READ or WRITE requests are outstanding,
 	 * the sending will be delayed.
+	 *
+	 * Make the release synchronous if this is a fuseblk mount,
+	 * synchronous RELEASE is allowed (and desirable) in this case
+	 * because the server can be trusted not to screw up.
 	 */
-	fuse_file_put(ff);
+	fuse_file_put(ff, ff->fc->destroy_req != NULL);
 }
 
 static int fuse_open(struct inode *inode, struct file *file)
@@ -549,7 +587,7 @@ static void fuse_readpages_end(struct fu
 		unlock_page(page);
 	}
 	if (req->ff)
-		fuse_file_put(req->ff);
+		fuse_file_put(req->ff, false);
 }
 
 static void fuse_send_readpages(struct fuse_req *req, struct file *file)
@@ -1129,7 +1167,7 @@ static ssize_t fuse_direct_write(struct
 static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req)
 {
 	__free_page(req->pages[0]);
-	fuse_file_put(req->ff);
+	fuse_file_put(req->ff, false);
 }
 
 static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -21,6 +21,7 @@
 #include <linux/rwsem.h>
 #include <linux/rbtree.h>
 #include <linux/poll.h>
+#include <linux/workqueue.h>
 
 /** Max number of pages that can be used in a single read request */
 #define FUSE_MAX_PAGES_PER_REQ 32
@@ -254,7 +255,10 @@ struct fuse_req {
 	union {
 		struct fuse_forget_in forget_in;
 		struct {
-			struct fuse_release_in in;
+			union {
+				struct fuse_release_in in;
+				struct work_struct work;
+			};
 			struct path path;
 		} release;
 		struct fuse_init_in init_in;



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [06/18] clockevents: Prevent oneshot mode when broadcast device is periodic
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (4 preceding siblings ...)
  2011-03-05  1:02 ` [05/18] fuse: fix hang of single threaded fuseblk filesystem Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [07/18] ext2: Fix link count corruption under heavy link+rename load Greg KH
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Thomas Gleixner <tglx@linutronix.de>

commit 3a142a0672b48a853f00af61f184c7341ac9c99d upstream.

When the per cpu timer is marked CLOCK_EVT_FEAT_C3STOP, then we only
can switch into oneshot mode, when the backup broadcast device
supports oneshot mode as well. Otherwise we would try to switch the
broadcast device into an unsupported mode unconditionally. This went
unnoticed so far as the current available broadcast devices support
oneshot mode. Seth unearthed this problem while debugging and working
around an hpet related BIOS wreckage.

Add the necessary check to tick_is_oneshot_available().

Reported-and-tested-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <alpine.LFD.2.00.1102252231200.2701@localhost6.localdomain6>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/time/tick-broadcast.c |   10 ++++++++++
 kernel/time/tick-common.c    |    6 +++++-
 kernel/time/tick-internal.h  |    3 +++
 3 files changed, 18 insertions(+), 1 deletion(-)

--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -600,4 +600,14 @@ int tick_broadcast_oneshot_active(void)
 	return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT;
 }
 
+/*
+ * Check whether the broadcast device supports oneshot.
+ */
+bool tick_broadcast_oneshot_available(void)
+{
+	struct clock_event_device *bc = tick_broadcast_device.evtdev;
+
+	return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false;
+}
+
 #endif
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -51,7 +51,11 @@ int tick_is_oneshot_available(void)
 {
 	struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
 
-	return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT);
+	if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT))
+		return 0;
+	if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))
+		return 1;
+	return tick_broadcast_oneshot_available();
 }
 
 /*
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -37,6 +37,7 @@ extern void tick_shutdown_broadcast_ones
 extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
 extern int tick_broadcast_oneshot_active(void);
 extern void tick_check_oneshot_broadcast(int cpu);
+bool tick_broadcast_oneshot_available(void);
 # else /* BROADCAST */
 static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 {
@@ -47,6 +48,7 @@ static inline void tick_broadcast_switch
 static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
 static inline int tick_broadcast_oneshot_active(void) { return 0; }
 static inline void tick_check_oneshot_broadcast(int cpu) { }
+static inline bool tick_broadcast_oneshot_available(void) { return true; }
 # endif /* !BROADCAST */
 
 #else /* !ONESHOT */
@@ -77,6 +79,7 @@ static inline int tick_resume_broadcast_
 	return 0;
 }
 static inline int tick_broadcast_oneshot_active(void) { return 0; }
+static inline bool tick_broadcast_oneshot_available(void) { return false; }
 #endif /* !TICK_ONESHOT */
 
 /*



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [07/18] ext2: Fix link count corruption under heavy link+rename load
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (5 preceding siblings ...)
  2011-03-05  1:03 ` [06/18] clockevents: Prevent oneshot mode when broadcast device is periodic Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [08/18] sctp: Fix oops when sending queued ASCONF chunks Greg KH
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Al Viro, Josh Hunt, Jan Kara

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Josh Hunt <johunt@akamai.com>

commit e8a80c6f769dd4622d8b211b398452158ee60c0b upstream.

vfs_rename_other() does not lock renamed inode with i_mutex. Thus changing
i_nlink in a non-atomic manner (which happens in ext2_rename()) can corrupt
it as reported and analyzed by Josh.

In fact, there is no good reason to mess with i_nlink of the moved file.
We did it presumably to simulate linking into the new directory and unlinking
from an old one. But the practical effect of this is disputable because fsck
can possibly treat file as being properly linked into both directories without
writing any error which is confusing. So we just stop increment-decrement
games with i_nlink which also fixes the corruption.

CC: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Josh Hunt <johunt@akamai.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext2/namei.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -327,7 +327,6 @@ static int ext2_rename (struct inode * o
 		new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page);
 		if (!new_de)
 			goto out_dir;
-		inode_inc_link_count(old_inode);
 		ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
 		new_inode->i_ctime = CURRENT_TIME_SEC;
 		if (dir_de)
@@ -339,12 +338,9 @@ static int ext2_rename (struct inode * o
 			if (new_dir->i_nlink >= EXT2_LINK_MAX)
 				goto out_dir;
 		}
-		inode_inc_link_count(old_inode);
 		err = ext2_add_link(new_dentry, old_inode);
-		if (err) {
-			inode_dec_link_count(old_inode);
+		if (err)
 			goto out_dir;
-		}
 		if (dir_de)
 			inode_inc_link_count(new_dir);
 	}
@@ -352,12 +348,11 @@ static int ext2_rename (struct inode * o
 	/*
 	 * Like most other Unix systems, set the ctime for inodes on a
  	 * rename.
-	 * inode_dec_link_count() will mark the inode dirty.
 	 */
 	old_inode->i_ctime = CURRENT_TIME_SEC;
+	mark_inode_dirty(old_inode);
 
 	ext2_delete_entry (old_de, old_page);
-	inode_dec_link_count(old_inode);
 
 	if (dir_de) {
 		if (old_dir != new_dir)



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [08/18] sctp: Fix oops when sending queued ASCONF chunks
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (6 preceding siblings ...)
  2011-03-05  1:03 ` [07/18] ext2: Fix link count corruption under heavy link+rename load Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [09/18] virtio: set pci bus master enable bit Greg KH
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Yuansong Qiao,
	Shuaijun Zhang, Vlad Yasevich, David S. Miller, maximilian attems

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Vlad Yasevich <vladislav.yasevich@hp.com>

commit c0786693404cffd80ca3cb6e75ee7b35186b2825 upstream.

When we finish processing ASCONF_ACK chunk, we try to send
the next queued ASCONF.  This action runs the sctp state
machine recursively and it's not prepared to do so.

kernel BUG at kernel/timer.c:790!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/module/ipv6/initstate
Modules linked in: sha256_generic sctp libcrc32c ipv6 dm_multipath
uinput 8139too i2c_piix4 8139cp mii i2c_core pcspkr virtio_net joydev
floppy virtio_blk virtio_pci [last unloaded: scsi_wait_scan]

Pid: 0, comm: swapper Not tainted 2.6.34-rc4 #15 /Bochs
EIP: 0060:[<c044a2ef>] EFLAGS: 00010286 CPU: 0
EIP is at add_timer+0xd/0x1b
EAX: cecbab14 EBX: 000000f0 ECX: c0957b1c EDX: 03595cf4
ESI: cecba800 EDI: cf276f00 EBP: c0957aa0 ESP: c0957aa0
 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process swapper (pid: 0, ti=c0956000 task=c0988ba0 task.ti=c0956000)
Stack:
 c0957ae0 d1851214 c0ab62e4 c0ab5f26 0500ffff 00000004 00000005 00000004
<0> 00000000 d18694fd 00000004 1666b892 cecba800 cecba800 c0957b14
00000004
<0> c0957b94 d1851b11 ceda8b00 cecba800 cf276f00 00000001 c0957b14
000000d0
Call Trace:
 [<d1851214>] ? sctp_side_effects+0x607/0xdfc [sctp]
 [<d1851b11>] ? sctp_do_sm+0x108/0x159 [sctp]
 [<d1863386>] ? sctp_pname+0x0/0x1d [sctp]
 [<d1861a56>] ? sctp_primitive_ASCONF+0x36/0x3b [sctp]
 [<d185657c>] ? sctp_process_asconf_ack+0x2a4/0x2d3 [sctp]
 [<d184e35c>] ? sctp_sf_do_asconf_ack+0x1dd/0x2b4 [sctp]
 [<d1851ac1>] ? sctp_do_sm+0xb8/0x159 [sctp]
 [<d1863334>] ? sctp_cname+0x0/0x52 [sctp]
 [<d1854377>] ? sctp_assoc_bh_rcv+0xac/0xe1 [sctp]
 [<d1858f0f>] ? sctp_inq_push+0x2d/0x30 [sctp]
 [<d186329d>] ? sctp_rcv+0x797/0x82e [sctp]

Tested-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Yuansong Qiao <ysqiao@research.ait.ie>
Signed-off-by: Shuaijun Zhang <szhang@research.ait.ie>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/net/sctp/command.h |    1 +
 net/sctp/sm_make_chunk.c   |   15 ---------------
 net/sctp/sm_sideeffect.c   |   26 ++++++++++++++++++++++++++
 net/sctp/sm_statefuns.c    |    8 +++++++-
 4 files changed, 34 insertions(+), 16 deletions(-)

--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -107,6 +107,7 @@ typedef enum {
 	SCTP_CMD_T1_RETRAN,	 /* Mark for retransmission after T1 timeout  */
 	SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
 	SCTP_CMD_SEND_MSG,	 /* Send the whole use message */
+	SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3361,21 +3361,6 @@ int sctp_process_asconf_ack(struct sctp_
 	sctp_chunk_free(asconf);
 	asoc->addip_last_asconf = NULL;
 
-	/* Send the next asconf chunk from the addip chunk queue. */
-	if (!list_empty(&asoc->addip_chunk_list)) {
-		struct list_head *entry = asoc->addip_chunk_list.next;
-		asconf = list_entry(entry, struct sctp_chunk, list);
-
-		list_del_init(entry);
-
-		/* Hold the chunk until an ASCONF_ACK is received. */
-		sctp_chunk_hold(asconf);
-		if (sctp_primitive_ASCONF(asoc, asconf))
-			sctp_chunk_free(asconf);
-		else
-			asoc->addip_last_asconf = asconf;
-	}
-
 	return retval;
 }
 
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -997,6 +997,29 @@ static int sctp_cmd_send_msg(struct sctp
 }
 
 
+/* Sent the next ASCONF packet currently stored in the association.
+ * This happens after the ASCONF_ACK was succeffully processed.
+ */
+static void sctp_cmd_send_asconf(struct sctp_association *asoc)
+{
+	/* Send the next asconf chunk from the addip chunk
+	 * queue.
+	 */
+	if (!list_empty(&asoc->addip_chunk_list)) {
+		struct list_head *entry = asoc->addip_chunk_list.next;
+		struct sctp_chunk *asconf = list_entry(entry,
+						struct sctp_chunk, list);
+		list_del_init(entry);
+
+		/* Hold the chunk until an ASCONF_ACK is received. */
+		sctp_chunk_hold(asconf);
+		if (sctp_primitive_ASCONF(asoc, asconf))
+			sctp_chunk_free(asconf);
+		else
+			asoc->addip_last_asconf = asconf;
+	}
+}
+
 
 /* These three macros allow us to pull the debugging code out of the
  * main flow of sctp_do_sm() to keep attention focused on the real
@@ -1650,6 +1673,9 @@ static int sctp_cmd_interpreter(sctp_eve
 			}
 			error = sctp_cmd_send_msg(asoc, cmd->obj.msg);
 			break;
+		case SCTP_CMD_SEND_NEXT_ASCONF:
+			sctp_cmd_send_asconf(asoc);
+			break;
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
 			       cmd->verb, cmd->obj.ptr);
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3670,8 +3670,14 @@ sctp_disposition_t sctp_sf_do_asconf_ack
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 
 		if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
-					     asconf_ack))
+					     asconf_ack)) {
+			/* Successfully processed ASCONF_ACK.  We can
+			 * release the next asconf if we have one.
+			 */
+			sctp_add_cmd_sf(commands, SCTP_CMD_SEND_NEXT_ASCONF,
+					SCTP_NULL());
 			return SCTP_DISPOSITION_CONSUME;
+		}
 
 		abort = sctp_make_abort(asoc, asconf_ack,
 					sizeof(sctp_errhdr_t));



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [09/18] virtio: set pci bus master enable bit
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (7 preceding siblings ...)
  2011-03-05  1:03 ` [08/18] sctp: Fix oops when sending queued ASCONF chunks Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [10/18] netxen: fix set mac addr Greg KH
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Michael S. Tsirkin,
	maximilian attems

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Michael S. Tsirkin <mst@redhat.com>

commit bc505f373979692d51a86d40925f77a8b09d17b9 upstream.

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

This patch fixes hotplug of virtio devices
with Linux guests and qemu 0.11-0.12.

Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/virtio/virtio_pci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -647,6 +647,7 @@ static int __devinit virtio_pci_probe(st
 		goto out_req_regions;
 
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);
 
 	/* we use the subsystem vendor/device id as the virtio vendor/device
 	 * id.  this allows us to use the same PCI vendor/device id for all



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [10/18] netxen: fix set mac addr
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (8 preceding siblings ...)
  2011-03-05  1:03 ` [09/18] virtio: set pci bus master enable bit Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [11/18] HID: add support for Acan FG-8100 barcode reader Greg KH
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Amit Kumar Salecha,
	David S. Miller, maximilian attems

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Amit Kumar Salecha <amit.salecha@qlogic.com>

commit d49c9640975355c79f346869831bf9780d185de0 upstream.

o If tx and rx resources are not available, during set mac request.
  Then this request wont be passed to firmware and it will be added to
  driver mac list and will never make it to firmware.
  So if resources are not available, don't add it to driver mac list.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/netxen/netxen_nic_hw.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -685,6 +685,9 @@ void netxen_p3_nic_set_multi(struct net_
 	struct list_head *head;
 	nx_mac_list_t *cur;
 
+	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
+		return;
+
 	list_splice_tail_init(&adapter->mac_list, &del_list);
 
 	nx_p3_nic_add_mac(adapter, adapter->mac_addr, &del_list);



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [11/18] HID: add support for Acan FG-8100 barcode reader
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (9 preceding siblings ...)
  2011-03-05  1:03 ` [10/18] netxen: fix set mac addr Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [12/18] p54usb: add Senao NUB-350 usbid Greg KH
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jiri Kosina,
	maximilian attems

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Jiri Kosina <jkosina@suse.cz>

commit e8d0eab4d9eda9f5e97852f780f020bfb134f9f0 upstream.

Acan FG-8100 barcode reader (0x04b4/0xbca1) has vendor ID of
cypress and requires the same MIN/MAX swap descriptor quirk
as other barcode readers from cypress.

Reported-by: Stijn Ghesquiere <stijn@applesnail.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/hid/hid-core.c    |    1 +
 drivers/hid/hid-cypress.c |    2 ++
 drivers/hid/hid-ids.h     |    1 +
 3 files changed, 4 insertions(+)

--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1297,6 +1297,7 @@ static const struct hid_device_id hid_bl
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
--- a/drivers/hid/hid-cypress.c
+++ b/drivers/hid/hid-cypress.c
@@ -126,6 +126,8 @@ static const struct hid_device_id cp_dev
 		.driver_data = CP_RDESC_SWAPPED_MIN_MAX },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2),
 		.driver_data = CP_RDESC_SWAPPED_MIN_MAX },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3),
+		.driver_data = CP_RDESC_SWAPPED_MIN_MAX },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE),
 		.driver_data = CP_2WHEEL_MOUSE_HACK },
 	{ }
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -148,6 +148,7 @@
 #define USB_DEVICE_ID_CYPRESS_ULTRAMOUSE	0x7417
 #define USB_DEVICE_ID_CYPRESS_BARCODE_1	0xde61
 #define USB_DEVICE_ID_CYPRESS_BARCODE_2	0xde64
+#define USB_DEVICE_ID_CYPRESS_BARCODE_3	0xbca1
 
 #define USB_VENDOR_ID_DEALEXTREAME	0x10c5
 #define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701	0x819a



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [12/18] p54usb: add Senao NUB-350 usbid
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (10 preceding siblings ...)
  2011-03-05  1:03 ` [11/18] HID: add support for Acan FG-8100 barcode reader Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [13/18] dccp: fix oops on Reset after close Greg KH
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Christian Lamparter,
	John W. Linville

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Christian Lamparter <chunkeey@googlemail.com>

commit 2b799a6b25bb9f9fbc478782cd9503e8066ab618 upstream.

Reported-by: Mark Davis
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/p54/p54usb.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -95,6 +95,7 @@ static struct usb_device_id p54u_table[]
 	{USB_DEVICE(0x1413, 0x5400)},   /* Telsey 802.11g USB2.0 Adapter */
 	{USB_DEVICE(0x1435, 0x0427)},	/* Inventel UR054G */
 	{USB_DEVICE(0x1668, 0x1050)},	/* Actiontec 802UIG-1 */
+	{USB_DEVICE(0x1740, 0x1000)},	/* Senao NUB-350 */
 	{USB_DEVICE(0x2001, 0x3704)},	/* DLink DWL-G122 rev A2 */
 	{USB_DEVICE(0x2001, 0x3705)},	/* D-Link DWL-G120 rev C1 */
 	{USB_DEVICE(0x413c, 0x5513)},	/* Dell WLA3310 USB Wireless Adapter */



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [13/18] dccp: fix oops on Reset after close
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (11 preceding siblings ...)
  2011-03-05  1:03 ` [12/18] p54usb: add Senao NUB-350 usbid Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [14/18] e1000e: disable broken PHY wakeup for ICH10 LOMs, use MAC wakeup instead Greg KH
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Gerrit Renker,
	David S. Miller

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Gerrit Renker <gerrit@erg.abdn.ac.uk>

commit 720dc34bbbe9493c7bd48b2243058b4e447a929d upstream.

This fixes a bug in the order of dccp_rcv_state_process() that still permitted
reception even after closing the socket. A Reset after close thus causes a NULL
pointer dereference by not preventing operations on an already torn-down socket.

 dccp_v4_do_rcv()
	|
	| state other than OPEN
	v
 dccp_rcv_state_process()
	|
	| DCCP_PKT_RESET
	v
 dccp_rcv_reset()
	|
	v
 dccp_time_wait()

 WARNING: at net/ipv4/inet_timewait_sock.c:141 __inet_twsk_hashdance+0x48/0x128()
 Modules linked in: arc4 ecb carl9170 rt2870sta(C) mac80211 r8712u(C) crc_ccitt ah
 [<c0038850>] (unwind_backtrace+0x0/0xec) from [<c0055364>] (warn_slowpath_common)
 [<c0055364>] (warn_slowpath_common+0x4c/0x64) from [<c0055398>] (warn_slowpath_n)
 [<c0055398>] (warn_slowpath_null+0x1c/0x24) from [<c02b72d0>] (__inet_twsk_hashd)
 [<c02b72d0>] (__inet_twsk_hashdance+0x48/0x128) from [<c031caa0>] (dccp_time_wai)
 [<c031caa0>] (dccp_time_wait+0x40/0xc8) from [<c031c15c>] (dccp_rcv_state_proces)
 [<c031c15c>] (dccp_rcv_state_process+0x120/0x538) from [<c032609c>] (dccp_v4_do_)
 [<c032609c>] (dccp_v4_do_rcv+0x11c/0x14c) from [<c0286594>] (release_sock+0xac/0)
 [<c0286594>] (release_sock+0xac/0x110) from [<c031fd34>] (dccp_close+0x28c/0x380)
 [<c031fd34>] (dccp_close+0x28c/0x380) from [<c02d9a78>] (inet_release+0x64/0x70)

The fix is by testing the socket state first. Receiving a packet in Closed state
now also produces the required "No connection" Reset reply of RFC 4340, 8.3.1.

Reported-and-tested-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/dccp/input.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -616,6 +616,9 @@ int dccp_rcv_state_process(struct sock *
 		/* Caller (dccp_v4_do_rcv) will send Reset */
 		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
 		return 1;
+	} else if (sk->sk_state == DCCP_CLOSED) {
+		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
+		return 1;
 	}
 
 	if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) {
@@ -678,10 +681,6 @@ int dccp_rcv_state_process(struct sock *
 	}
 
 	switch (sk->sk_state) {
-	case DCCP_CLOSED:
-		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
-		return 1;
-
 	case DCCP_REQUESTING:
 		queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len);
 		if (queued >= 0)



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [14/18] e1000e: disable broken PHY wakeup for ICH10 LOMs, use MAC wakeup instead
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (12 preceding siblings ...)
  2011-03-05  1:03 ` [13/18] dccp: fix oops on Reset after close Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [15/18] r8169: disable ASPM Greg KH
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Bruce Allan, Jeff Kirsher

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Bruce Allan <bruce.w.allan@intel.com>

commit 4def99bbfd46e05c5e03b5b282cb4ee30e27ff19 upstream.

When support for 82577/82578 was added[1] in 2.6.31, PHY wakeup was in-
advertently enabled (even though it does not function properly) on ICH10
LOMs.  This patch makes it so that the ICH10 LOMs use MAC wakeup instead
as was done with the initial support for those devices (i.e. 82567LM-3,
82567LF-3 and 82567V-4).

[1] commit a4f58f5455ba0efda36fb33c37074922d1527a10

Reported-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/e1000e/netdev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5186,7 +5186,8 @@ static int __devinit e1000_probe(struct
 		/* APME bit in EEPROM is mapped to WUC.APME */
 		eeprom_data = er32(WUC);
 		eeprom_apme_mask = E1000_WUC_APME;
-		if (eeprom_data & E1000_WUC_PHY_WAKE)
+		if ((hw->mac.type > e1000_ich10lan) &&
+		    (eeprom_data & E1000_WUC_PHY_WAKE))
 			adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP;
 	} else if (adapter->flags & FLAG_APME_IN_CTRL3) {
 		if (adapter->flags & FLAG_APME_CHECK_PORT_B &&



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [15/18] r8169: disable ASPM
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (13 preceding siblings ...)
  2011-03-05  1:03 ` [14/18] e1000e: disable broken PHY wakeup for ICH10 LOMs, use MAC wakeup instead Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [16/18] usb: iowarrior: dont trust report_size for buffer size Greg KH
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Stanislaw Gruszka,
	David S. Miller

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit ba04c7c93bbcb48ce880cf75b6e9dffcd79d4c7b upstream.

For some time is known that ASPM is causing troubles on r8169, i.e. make
device randomly stop working without any errors in dmesg.

Currently Tomi Leppikangas reports that system with r8169 device hangs
with MCE errors when ASPM is enabled:
https://bugzilla.redhat.com/show_bug.cgi?id=642861#c4

Lets disable ASPM for r8169 devices at all, to avoid problems with
r8169 PCIe devices at least for some users.

Reported-by: Tomi Leppikangas <tomi.leppikangas@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/r8169.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -23,6 +23,7 @@
 #include <linux/tcp.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
+#include <linux/pci-aspm.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -3030,6 +3031,11 @@ rtl8169_init_one(struct pci_dev *pdev, c
 	mii->reg_num_mask = 0x1f;
 	mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII);
 
+	/* disable ASPM completely as that cause random device stop working
+	 * problems as well as full system hangs for some PCIe devices users */
+	pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+				     PCIE_LINK_STATE_CLKPM);
+
 	/* enable device (incl. PCI PM wakeup and hotplug setup) */
 	rc = pci_enable_device(pdev);
 	if (rc < 0) {



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [16/18] usb: iowarrior: dont trust report_size for buffer size
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (14 preceding siblings ...)
  2011-03-05  1:03 ` [15/18] r8169: disable ASPM Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  1:03 ` [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS Greg KH
  2011-03-05  1:03 ` [18/18] CIFS: Fix oplock break handling (try #2) Greg KH
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Kees Cook, Brandon Philips

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Kees Cook <kees.cook@canonical.com>

commit 3ed780117dbe5acb64280d218f0347f238dafed0 upstream.

If the iowarrior devices in this case statement support more than 8 bytes
per report, it is possible to write past the end of a kernel heap allocation.
This will probably never be possible, but change the allocation to be more
defensive anyway.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Brandon Philips <bphilips@suse.de>


---
 drivers/usb/misc/iowarrior.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -373,7 +373,7 @@ static ssize_t iowarrior_write(struct fi
 	case USB_DEVICE_ID_CODEMERCS_IOWPV2:
 	case USB_DEVICE_ID_CODEMERCS_IOW40:
 		/* IOW24 and IOW40 use a synchronous call */
-		buf = kmalloc(8, GFP_KERNEL);	/* 8 bytes are enough for both products */
+		buf = kmalloc(count, GFP_KERNEL);
 		if (!buf) {
 			retval = -ENOMEM;
 			goto exit;



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (15 preceding siblings ...)
  2011-03-05  1:03 ` [16/18] usb: iowarrior: dont trust report_size for buffer size Greg KH
@ 2011-03-05  1:03 ` Greg KH
  2011-03-05  9:36   ` Ian Campbell
  2011-03-05  1:03 ` [18/18] CIFS: Fix oplock break handling (try #2) Greg KH
  17 siblings, 1 reply; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Ian Campbell,
	David S. Miller, Haiyang Zhang, Mike Surcouf, Hank Janssen

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Ian Campbell <Ian.Campbell@citrix.com>

commit d11327ad6695db8117c78d70611e71102ceec2ac upstream.

NETDEV_NOTIFY_PEER is an explicit request by the driver to send a link
notification while NETDEV_UP/NETDEV_CHANGEADDR generate link
notifications as a sort of side effect.

In the later cases the sysctl option is present because link
notification events can have undesired effects e.g. if the link is
flapping. I don't think this applies in the case of an explicit
request from a driver.

This patch makes NETDEV_NOTIFY_PEER unconditional, if preferred we
could add a new sysctl for this case which defaults to on.

This change causes Xen post-migration ARP notifications (which cause
switches to relearn their MAC tables etc) to be sent by default.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[reported to solve hyperv live migration problem - gkh]
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Mike Surcouf <mike@surcouf.co.uk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/devinet.c |   30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1025,6 +1025,21 @@ static inline bool inetdev_valid_mtu(uns
 	return mtu >= 68;
 }
 
+static void inetdev_send_gratuitous_arp(struct net_device *dev,
+					struct in_device *in_dev)
+
+{
+	struct in_ifaddr *ifa = in_dev->ifa_list;
+
+	if (!ifa)
+		return;
+
+	arp_send(ARPOP_REQUEST, ETH_P_ARP,
+		 ifa->ifa_address, dev,
+		 ifa->ifa_address, NULL,
+		 dev->dev_addr, NULL);
+}
+
 /* Called only under RTNL semaphore */
 
 static int inetdev_event(struct notifier_block *this, unsigned long event,
@@ -1076,18 +1091,13 @@ static int inetdev_event(struct notifier
 		}
 		ip_mc_up(in_dev);
 		/* fall through */
-	case NETDEV_NOTIFY_PEERS:
 	case NETDEV_CHANGEADDR:
+		if (!IN_DEV_ARP_NOTIFY(in_dev))
+			break;
+		/* fall through */
+	case NETDEV_NOTIFY_PEERS:
 		/* Send gratuitous ARP to notify of link change */
-		if (IN_DEV_ARP_NOTIFY(in_dev)) {
-			struct in_ifaddr *ifa = in_dev->ifa_list;
-
-			if (ifa)
-				arp_send(ARPOP_REQUEST, ETH_P_ARP,
-					 ifa->ifa_address, dev,
-					 ifa->ifa_address, NULL,
-					 dev->dev_addr, NULL);
-		}
+		inetdev_send_gratuitous_arp(dev, in_dev);
 		break;
 	case NETDEV_DOWN:
 		ip_mc_down(in_dev);



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [18/18] CIFS: Fix oplock break handling (try #2)
  2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
                   ` (16 preceding siblings ...)
  2011-03-05  1:03 ` [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS Greg KH
@ 2011-03-05  1:03 ` Greg KH
  17 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Pavel Shilovsky,
	Steve French

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

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

From: Pavel Shilovsky <piastryyy@gmail.com>

commit 12fed00de963433128b5366a21a55808fab2f756 upstream.

When we get oplock break notification we should set the appropriate
value of OplockLevel field in oplock break acknowledge according to
the oplock level held by the client in this time. As we only can have
level II oplock or no oplock in the case of oplock break, we should be
aware only about clientCanCacheRead field in cifsInodeInfo structure.

Also fix bug connected with wrong interpretation of OplockLevel field
during oplock break notification processing.

Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/cifs/cifsproto.h |    2 +-
 fs/cifs/cifssmb.c   |    4 +++-
 fs/cifs/file.c      |   17 +++++++++--------
 3 files changed, 13 insertions(+), 10 deletions(-)

--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -323,7 +323,7 @@ extern int CIFSSMBLock(const int xid, st
 			const __u16 netfid, const __u64 len,
 			const __u64 offset, const __u32 numUnlock,
 			const __u32 numLock, const __u8 lockType,
-			const bool waitFlag);
+			const bool waitFlag, const __u8 oplock_level);
 extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
 			const __u16 smb_file_id, const int get_flag,
 			const __u64 len, struct file_lock *,
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1641,7 +1641,8 @@ int
 CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
 	    const __u16 smb_file_id, const __u64 len,
 	    const __u64 offset, const __u32 numUnlock,
-	    const __u32 numLock, const __u8 lockType, const bool waitFlag)
+	    const __u32 numLock, const __u8 lockType,
+	    const bool waitFlag, const __u8 oplock_level)
 {
 	int rc = 0;
 	LOCK_REQ *pSMB = NULL;
@@ -1669,6 +1670,7 @@ CIFSSMBLock(const int xid, struct cifsTc
 	pSMB->NumberOfLocks = cpu_to_le16(numLock);
 	pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock);
 	pSMB->LockType = lockType;
+	pSMB->OplockLevel = oplock_level;
 	pSMB->AndXCommand = 0xFF;	/* none */
 	pSMB->Fid = smb_file_id; /* netfid stays le */
 
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -825,12 +825,12 @@ int cifs_lock(struct file *file, int cmd
 
 		/* BB we could chain these into one lock request BB */
 		rc = CIFSSMBLock(xid, tcon, netfid, length, pfLock->fl_start,
-				 0, 1, lockType, 0 /* wait flag */ );
+				 0, 1, lockType, 0 /* wait flag */, 0);
 		if (rc == 0) {
 			rc = CIFSSMBLock(xid, tcon, netfid, length,
 					 pfLock->fl_start, 1 /* numUnlock */ ,
 					 0 /* numLock */ , lockType,
-					 0 /* wait flag */ );
+					 0 /* wait flag */, 0);
 			pfLock->fl_type = F_UNLCK;
 			if (rc != 0)
 				cERROR(1, ("Error unlocking previously locked "
@@ -873,8 +873,8 @@ int cifs_lock(struct file *file, int cmd
 
 		if (numLock) {
 			rc = CIFSSMBLock(xid, tcon, netfid, length,
-					pfLock->fl_start,
-					0, numLock, lockType, wait_flag);
+					 pfLock->fl_start, 0, numLock, lockType,
+					 wait_flag, 0);
 
 			if (rc == 0) {
 				/* For Windows locks we must store them. */
@@ -894,9 +894,9 @@ int cifs_lock(struct file *file, int cmd
 						(pfLock->fl_start + length) >=
 						(li->offset + li->length)) {
 					stored_rc = CIFSSMBLock(xid, tcon,
-							netfid,
-							li->length, li->offset,
-							1, 0, li->type, false);
+							netfid, li->length,
+							li->offset, 1, 0,
+							li->type, false, 0);
 					if (stored_rc)
 						rc = stored_rc;
 
@@ -2314,7 +2314,8 @@ cifs_oplock_break(struct slow_work *work
 	 */
 	if (!cfile->closePend && !cfile->oplock_break_cancelled) {
 		rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0,
-				 LOCKING_ANDX_OPLOCK_RELEASE, false);
+				 LOCKING_ANDX_OPLOCK_RELEASE, false,
+				 cinode->clientCanCacheRead ? 1 : 0);
 		cFYI(1, ("Oplock release rc = %d", rc));
 	}
 }



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [00/18] 2.6.32.32-longterm review
@ 2011-03-05  1:04 Greg KH
  2011-03-05  1:02 ` [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number Greg KH
                   ` (17 more replies)
  0 siblings, 18 replies; 21+ messages in thread
From: Greg KH @ 2011-03-05  1:04 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan

This is the start of the longterm review cycle for the 2.6.32.32 release.
There are 18 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let us know.  If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.

Responses should be made by Tuesday March 8 2011, 00:00:00 UTC.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v2.6/longterm-review/patch-2.6.32.32-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h


 Makefile                             |    2 +-
 arch/x86/include/asm/smpboot_hooks.h |    2 +-
 drivers/gpu/drm/drm_irq.c            |    3 +-
 drivers/hid/hid-core.c               |    1 +
 drivers/hid/hid-cypress.c            |    2 +
 drivers/hid/hid-ids.h                |    1 +
 drivers/mfd/ucb1x00-ts.c             |   12 ++++++--
 drivers/net/e1000e/netdev.c          |    3 +-
 drivers/net/netxen/netxen_nic_hw.c   |    3 ++
 drivers/net/r8169.c                  |    6 ++++
 drivers/net/wireless/p54/p54usb.c    |    1 +
 drivers/usb/misc/iowarrior.c         |    2 +-
 drivers/virtio/virtio_pci.c          |    1 +
 fs/cifs/cifsproto.h                  |    2 +-
 fs/cifs/cifssmb.c                    |    4 ++-
 fs/cifs/file.c                       |   17 ++++++-----
 fs/ext2/namei.c                      |    9 +----
 fs/fuse/file.c                       |   52 +++++++++++++++++++++++++++++----
 fs/fuse/fuse_i.h                     |    6 +++-
 fs/ocfs2/refcounttree.c              |    7 +++-
 include/drm/drmP.h                   |    2 +-
 include/net/sctp/command.h           |    1 +
 kernel/time/tick-broadcast.c         |   10 ++++++
 kernel/time/tick-common.c            |    6 +++-
 kernel/time/tick-internal.h          |    3 ++
 net/dccp/input.c                     |    7 ++--
 net/ipv4/devinet.c                   |   30 +++++++++++++------
 net/sctp/sm_make_chunk.c             |   15 ----------
 net/sctp/sm_sideeffect.c             |   26 +++++++++++++++++
 net/sctp/sm_statefuns.c              |    8 ++++-
 30 files changed, 177 insertions(+), 67 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.
  2011-03-05  1:03 ` [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS Greg KH
@ 2011-03-05  9:36   ` Ian Campbell
  2011-03-05 17:45     ` Mike Surcouf
  0 siblings, 1 reply; 21+ messages in thread
From: Ian Campbell @ 2011-03-05  9:36 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel@vger.kernel.org, stable@kernel.org,
	stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	David S. Miller, Haiyang Zhang, Mike Surcouf, Hank Janssen

On Sat, 2011-03-05 at 01:03 +0000, Greg KH wrote:
> 2.6.32-longterm review patch.  If anyone has any objections, please let us know.
> 
> ------------------
> 
> From: Ian Campbell <Ian.Campbell@citrix.com>
> 
> commit d11327ad6695db8117c78d70611e71102ceec2ac upstream.
> 
> NETDEV_NOTIFY_PEER is an explicit request by the driver to send a link
> notification while NETDEV_UP/NETDEV_CHANGEADDR generate link
> notifications as a sort of side effect.
> 
> In the later cases the sysctl option is present because link
> notification events can have undesired effects e.g. if the link is
> flapping. I don't think this applies in the case of an explicit
> request from a driver.
> 
> This patch makes NETDEV_NOTIFY_PEER unconditional, if preferred we
> could add a new sysctl for this case which defaults to on.
> 
> This change causes Xen post-migration ARP notifications (which cause
> switches to relearn their MAC tables etc) to be sent by default.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> [reported to solve hyperv live migration problem - gkh]

I hadn't spotted this second caller of netif_notify_peers under
drivers/staging but, yes, I rather suspect it will help hyperv as well
as Xen given that 7c161d0b900ea9bd9fc5ea5d3fa9916e9eb0dd88 "staging: hv:
Enable sending GARP packet after live migration" is already in the
stable and longterm trees.

Ian.

> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Mike Surcouf <mike@surcouf.co.uk>
> Cc: Hank Janssen <hjanssen@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  net/ipv4/devinet.c |   30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1025,6 +1025,21 @@ static inline bool inetdev_valid_mtu(uns
>  	return mtu >= 68;
>  }
>  
> +static void inetdev_send_gratuitous_arp(struct net_device *dev,
> +					struct in_device *in_dev)
> +
> +{
> +	struct in_ifaddr *ifa = in_dev->ifa_list;
> +
> +	if (!ifa)
> +		return;
> +
> +	arp_send(ARPOP_REQUEST, ETH_P_ARP,
> +		 ifa->ifa_address, dev,
> +		 ifa->ifa_address, NULL,
> +		 dev->dev_addr, NULL);
> +}
> +
>  /* Called only under RTNL semaphore */
>  
>  static int inetdev_event(struct notifier_block *this, unsigned long event,
> @@ -1076,18 +1091,13 @@ static int inetdev_event(struct notifier
>  		}
>  		ip_mc_up(in_dev);
>  		/* fall through */
> -	case NETDEV_NOTIFY_PEERS:
>  	case NETDEV_CHANGEADDR:
> +		if (!IN_DEV_ARP_NOTIFY(in_dev))
> +			break;
> +		/* fall through */
> +	case NETDEV_NOTIFY_PEERS:
>  		/* Send gratuitous ARP to notify of link change */
> -		if (IN_DEV_ARP_NOTIFY(in_dev)) {
> -			struct in_ifaddr *ifa = in_dev->ifa_list;
> -
> -			if (ifa)
> -				arp_send(ARPOP_REQUEST, ETH_P_ARP,
> -					 ifa->ifa_address, dev,
> -					 ifa->ifa_address, NULL,
> -					 dev->dev_addr, NULL);
> -		}
> +		inetdev_send_gratuitous_arp(dev, in_dev);
>  		break;
>  	case NETDEV_DOWN:
>  		ip_mc_down(in_dev);
> 
> 



^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.
  2011-03-05  9:36   ` Ian Campbell
@ 2011-03-05 17:45     ` Mike Surcouf
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Surcouf @ 2011-03-05 17:45 UTC (permalink / raw)
  To: Ian Campbell, Greg KH
  Cc: linux-kernel@vger.kernel.org, stable@kernel.org,
	stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	David S. Miller, Haiyang Zhang, Hank Janssen

Hi Ian/Greg

I just tested your patch with a custom kernel Greg compiled for me and it works for hyperv too as one would expect.
I can now see that a GARP is sent (using wireshark) and that my switch tables are updating.  

Many thanks for your work on this and Thanks to Greg for his help.

Regards

Mike

________________________________________
From: Ian Campbell [Ian.Campbell@eu.citrix.com]
Sent: 05 March 2011 09:36
To: Greg KH
Cc: linux-kernel@vger.kernel.org; stable@kernel.org; stable-review@kernel.org; torvalds@linux-foundation.org; akpm@linux-foundation.org; alan@lxorguk.ukuu.org.uk; David S. Miller; Haiyang Zhang; Mike Surcouf; Hank Janssen
Subject: Re: [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.

On Sat, 2011-03-05 at 01:03 +0000, Greg KH wrote:
> 2.6.32-longterm review patch.  If anyone has any objections, please let us know.
>
> ------------------
>
> From: Ian Campbell <Ian.Campbell@citrix.com>
>
> commit d11327ad6695db8117c78d70611e71102ceec2ac upstream.
>
> NETDEV_NOTIFY_PEER is an explicit request by the driver to send a link
> notification while NETDEV_UP/NETDEV_CHANGEADDR generate link
> notifications as a sort of side effect.
>
> In the later cases the sysctl option is present because link
> notification events can have undesired effects e.g. if the link is
> flapping. I don't think this applies in the case of an explicit
> request from a driver.
>
> This patch makes NETDEV_NOTIFY_PEER unconditional, if preferred we
> could add a new sysctl for this case which defaults to on.
>
> This change causes Xen post-migration ARP notifications (which cause
> switches to relearn their MAC tables etc) to be sent by default.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> [reported to solve hyperv live migration problem - gkh]

I hadn't spotted this second caller of netif_notify_peers under
drivers/staging but, yes, I rather suspect it will help hyperv as well
as Xen given that 7c161d0b900ea9bd9fc5ea5d3fa9916e9eb0dd88 "staging: hv:
Enable sending GARP packet after live migration" is already in the
stable and longterm trees.

Ian.

> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Mike Surcouf <mike@surcouf.co.uk>
> Cc: Hank Janssen <hjanssen@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
>  net/ipv4/devinet.c |   30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
>
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1025,6 +1025,21 @@ static inline bool inetdev_valid_mtu(uns
>       return mtu >= 68;
>  }
>
> +static void inetdev_send_gratuitous_arp(struct net_device *dev,
> +                                     struct in_device *in_dev)
> +
> +{
> +     struct in_ifaddr *ifa = in_dev->ifa_list;
> +
> +     if (!ifa)
> +             return;
> +
> +     arp_send(ARPOP_REQUEST, ETH_P_ARP,
> +              ifa->ifa_address, dev,
> +              ifa->ifa_address, NULL,
> +              dev->dev_addr, NULL);
> +}
> +
>  /* Called only under RTNL semaphore */
>
>  static int inetdev_event(struct notifier_block *this, unsigned long event,
> @@ -1076,18 +1091,13 @@ static int inetdev_event(struct notifier
>               }
>               ip_mc_up(in_dev);
>               /* fall through */
> -     case NETDEV_NOTIFY_PEERS:
>       case NETDEV_CHANGEADDR:
> +             if (!IN_DEV_ARP_NOTIFY(in_dev))
> +                     break;
> +             /* fall through */
> +     case NETDEV_NOTIFY_PEERS:
>               /* Send gratuitous ARP to notify of link change */
> -             if (IN_DEV_ARP_NOTIFY(in_dev)) {
> -                     struct in_ifaddr *ifa = in_dev->ifa_list;
> -
> -                     if (ifa)
> -                             arp_send(ARPOP_REQUEST, ETH_P_ARP,
> -                                      ifa->ifa_address, dev,
> -                                      ifa->ifa_address, NULL,
> -                                      dev->dev_addr, NULL);
> -             }
> +             inetdev_send_gratuitous_arp(dev, in_dev);
>               break;
>       case NETDEV_DOWN:
>               ip_mc_down(in_dev);
>
>

----------------------------------------------------------------------
A E Surcouf and Sons Ltd. - Privacy, Security and Confidentiality Notice

This e-mail and any attachments may contain confidential and privileged
information. If you have received this e-mail in error please notify us
immediately and delete it from your system. You must not copy, distribute,
disclose or otherwise use any part of it. This email has been scanned
by current virus software, however it is the responsibility of the 
recipient to ensure that this e-mail is virus free and no responsibility
is accepted by A E Surcouf and Sons Ltd. for any loss or damage arising in
any way from receipt or use of it. Unencrypted electronic mail is not 
secure and may not be authentic.
-----------------------------------------------------------------------

 



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-03-05 17:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05  1:04 [00/18] 2.6.32.32-longterm review Greg KH
2011-03-05  1:02 ` [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number Greg KH
2011-03-05  1:02 ` [02/18] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl Greg KH
2011-03-05  1:02 ` [03/18] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Greg KH
2011-03-05  1:02 ` [04/18] x86: Use u32 instead of long to set reset vector back to 0 Greg KH
2011-03-05  1:02 ` [05/18] fuse: fix hang of single threaded fuseblk filesystem Greg KH
2011-03-05  1:03 ` [06/18] clockevents: Prevent oneshot mode when broadcast device is periodic Greg KH
2011-03-05  1:03 ` [07/18] ext2: Fix link count corruption under heavy link+rename load Greg KH
2011-03-05  1:03 ` [08/18] sctp: Fix oops when sending queued ASCONF chunks Greg KH
2011-03-05  1:03 ` [09/18] virtio: set pci bus master enable bit Greg KH
2011-03-05  1:03 ` [10/18] netxen: fix set mac addr Greg KH
2011-03-05  1:03 ` [11/18] HID: add support for Acan FG-8100 barcode reader Greg KH
2011-03-05  1:03 ` [12/18] p54usb: add Senao NUB-350 usbid Greg KH
2011-03-05  1:03 ` [13/18] dccp: fix oops on Reset after close Greg KH
2011-03-05  1:03 ` [14/18] e1000e: disable broken PHY wakeup for ICH10 LOMs, use MAC wakeup instead Greg KH
2011-03-05  1:03 ` [15/18] r8169: disable ASPM Greg KH
2011-03-05  1:03 ` [16/18] usb: iowarrior: dont trust report_size for buffer size Greg KH
2011-03-05  1:03 ` [17/18] arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS Greg KH
2011-03-05  9:36   ` Ian Campbell
2011-03-05 17:45     ` Mike Surcouf
2011-03-05  1:03 ` [18/18] CIFS: Fix oplock break handling (try #2) Greg KH

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.