stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 00/24] 3.6.6-stable review
@ 2012-11-02 17:06 Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 01/24] ext4: fix unjournaled inode bitmap modification Greg Kroah-Hartman
                   ` (24 more replies)
  0 siblings, 25 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, torvalds, akpm, alan

This is the start of the stable review cycle for the 3.6.6 release.
There are 24 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 me know.

Responses should be made by Sun Nov  4 17:02:39 UTC 2012.
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/v3.0/stable-review/patch-3.6.6-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 3.6.6-rc1

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau: headless mode by default if pci class != vga display

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau: fix suspend/resume when in headless mode

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau: silence modesetting spam on pre-gf8 chipsets

Jiri Slaby <jslaby@suse.cz>
    HID: microsoft: fix invalid rdesc for 3k kbd

Nicholas Bellinger <nab@linux-iscsi.org>
    target: Fix double-free of se_cmd in target_complete_tmr_failure

Bernhard Kohl <bernhard.kohl@nsn.com>
    target: reintroduce some obsolete SCSI-2 commands

Roland Dreier <roland@purestorage.com>
    qla2xxx: Update target lookup session tables when a target session changes

Paul Bolle <pebolle@tiscali.nl>
    USB: io_edgeport: remove unused variable

Johan Hovold <jhovold@gmail.com>
    USB: iuu_phoenix: fix backported patches

Johan Hovold <jhovold@gmail.com>
    USB: mos7840: fix port-data memory leak

Alex Elder <elder@inktank.com>
    ceph: avoid 32-bit page index overflow

Sage Weil <sage@inktank.com>
    libceph: check for invalid mapping

Yan, Zheng <zheng.z.yan@intel.com>
    ceph: Fix oops when handling mdsmap that decreases max_mds

David Zafman <david.zafman@inktank.com>
    ceph: fix dentry reference leak in encode_fh()

Sage Weil <sage@inktank.com>
    libceph: avoid NULL kref_put when osd reset races with alloc_msg

Alex Elder <elder@inktank.com>
    rbd: reset BACKOFF if unable to re-queue

Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    floppy: properly handle failure on add_disk loop

Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    floppy: do put_disk on current dr if blk_init_queue fails

Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop

NeilBrown <neilb@suse.de>
    md/raid1: Fix assembling of arrays containing Replacements.

Mathias Nyman <mathias.nyman@linux.intel.com>
    gpiolib: Don't return -EPROBE_DEFER to sysfs, or for invalid gpios

Dan Carpenter <dan.carpenter@oracle.com>
    gpio-timberdale: fix a potential wrapping issue

Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
    blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg

Eric Sandeen <sandeen@redhat.com>
    ext4: fix unjournaled inode bitmap modification


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

Diffstat:

 Makefile                                |   4 +-
 block/blk-cgroup.c                      |   7 ++
 drivers/block/floppy.c                  |  27 +++--
 drivers/gpio/gpio-timberdale.c          |   4 +-
 drivers/gpio/gpiolib.c                  |  10 +-
 drivers/gpu/drm/nouveau/nouveau_drv.c   |  20 ++--
 drivers/gpu/drm/nouveau/nouveau_state.c |   4 +-
 drivers/gpu/drm/nouveau/nv04_dac.c      |   8 +-
 drivers/gpu/drm/nouveau/nv04_dfp.c      |   6 +-
 drivers/gpu/drm/nouveau/nv04_tv.c       |   4 +-
 drivers/hid/hid-microsoft.c             |  18 ++-
 drivers/md/raid1.c                      |   2 +-
 drivers/scsi/qla2xxx/qla_target.c       |  25 ++--
 drivers/scsi/qla2xxx/qla_target.h       |   1 +
 drivers/scsi/qla2xxx/tcm_qla2xxx.c      |  73 ++++++++++++
 drivers/target/target_core_sbc.c        |  18 +++
 drivers/target/target_core_transport.c  |   1 -
 drivers/usb/serial/io_edgeport.c        |   1 -
 drivers/usb/serial/iuu_phoenix.c        |   3 +-
 drivers/usb/serial/mos7840.c            | 198 ++++++++++++--------------------
 fs/ceph/addr.c                          |  11 +-
 fs/ceph/export.c                        |   2 +
 fs/ceph/mds_client.c                    |   3 +-
 fs/ext4/ialloc.c                        |  19 ++-
 include/linux/ceph/osd_client.h         |   2 +-
 include/linux/ceph/osdmap.h             |   6 +-
 net/ceph/messenger.c                    |   6 +-
 net/ceph/osd_client.c                   |  32 ++++--
 net/ceph/osdmap.c                       |  18 ++-
 29 files changed, 310 insertions(+), 223 deletions(-)



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

* [ 01/24] ext4: fix unjournaled inode bitmap modification
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 02/24] blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Nix, Eric Sandeen, Theodore Tso

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Eric Sandeen <sandeen@redhat.com>

commit ffb5387e85d528fb6d0d924abfa3fbf0fc484071 upstream.

commit 119c0d4460b001e44b41dcf73dc6ee794b98bd31 changed
ext4_new_inode() such that the inode bitmap was being modified
outside a transaction, which could lead to corruption, and was
discovered when journal_checksum found a bad checksum in the
journal during log replay.

Nix ran into this when using the journal_async_commit mount
option, which enables journal checksumming.  The ensuing
journal replay failures due to the bad checksums led to
filesystem corruption reported as the now infamous
"Apparent serious progressive ext4 data corruption bug"

[ Changed by tytso to only call ext4_journal_get_write_access() only
  when we're fairly certain that we're going to allocate the inode. ]

I've tested this by mounting with journal_checksum and
running fsstress then dropping power; I've also tested by
hacking DM to create snapshots w/o first quiescing, which
allows me to test journal replay repeatedly w/o actually
power-cycling the box.  Without the patch I hit a journal
checksum error every time.  With this fix it survives
many iterations.

Reported-by: Nix <nix@esperi.org.uk>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/ialloc.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -716,6 +716,10 @@ repeat_in_this_group:
 				   "inode=%lu", ino + 1);
 			continue;
 		}
+		BUFFER_TRACE(inode_bitmap_bh, "get_write_access");
+		err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
+		if (err)
+			goto fail;
 		ext4_lock_group(sb, group);
 		ret2 = ext4_test_and_set_bit(ino, inode_bitmap_bh->b_data);
 		ext4_unlock_group(sb, group);
@@ -729,6 +733,11 @@ repeat_in_this_group:
 	goto out;
 
 got:
+	BUFFER_TRACE(inode_bitmap_bh, "call ext4_handle_dirty_metadata");
+	err = ext4_handle_dirty_metadata(handle, NULL, inode_bitmap_bh);
+	if (err)
+		goto fail;
+
 	/* We may have to initialize the block bitmap if it isn't already */
 	if (ext4_has_group_desc_csum(sb) &&
 	    gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
@@ -762,11 +771,6 @@ got:
 			goto fail;
 	}
 
-	BUFFER_TRACE(inode_bitmap_bh, "get_write_access");
-	err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
-	if (err)
-		goto fail;
-
 	BUFFER_TRACE(group_desc_bh, "get_write_access");
 	err = ext4_journal_get_write_access(handle, group_desc_bh);
 	if (err)
@@ -814,11 +818,6 @@ got:
 	}
 	ext4_unlock_group(sb, group);
 
-	BUFFER_TRACE(inode_bitmap_bh, "call ext4_handle_dirty_metadata");
-	err = ext4_handle_dirty_metadata(handle, NULL, inode_bitmap_bh);
-	if (err)
-		goto fail;
-
 	BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata");
 	err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh);
 	if (err)



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

* [ 02/24] blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 01/24] ext4: fix unjournaled inode bitmap modification Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 03/24] gpio-timberdale: fix a potential wrapping issue Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Junichi Nomura, Vivek Goyal, Tejun Heo,
	Jens Axboe

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

commit 65635cbc37e011e71b208257a25e7c1078cd039b upstream.

blk_put_rl() does not call blkg_put() for q->root_rl because we
don't take request list reference on q->root_blkg.
However, if root_blkg is once attached then detached (freed),
blk_put_rl() is confused by the bogus pointer in q->root_blkg.

For example, with !CONFIG_BLK_DEV_THROTTLING &&
CONFIG_CFQ_GROUP_IOSCHED,
switching IO scheduler from cfq to deadline will cause system stall
after the following warning with 3.6:

> WARNING: at /work/build/linux/block/blk-cgroup.h:250
> blk_put_rl+0x4d/0x95()
> Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf
> ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4
> Pid: 0, comm: swapper/0 Not tainted 3.6.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff810453bd>] warn_slowpath_common+0x85/0x9d
>  [<ffffffff810453ef>] warn_slowpath_null+0x1a/0x1c
>  [<ffffffff811d5f8d>] blk_put_rl+0x4d/0x95
>  [<ffffffff811d614a>] __blk_put_request+0xc3/0xcb
>  [<ffffffff811d71a3>] blk_finish_request+0x232/0x23f
>  [<ffffffff811d76c3>] ? blk_end_bidi_request+0x34/0x5d
>  [<ffffffff811d76d1>] blk_end_bidi_request+0x42/0x5d
>  [<ffffffff811d7728>] blk_end_request+0x10/0x12
>  [<ffffffff812cdf16>] scsi_io_completion+0x207/0x4d5
>  [<ffffffff812c6fcf>] scsi_finish_command+0xfa/0x103
>  [<ffffffff812ce2f8>] scsi_softirq_done+0xff/0x108
>  [<ffffffff811dcea5>] blk_done_softirq+0x8d/0xa1
>  [<ffffffff810915d5>] ?
>  generic_smp_call_function_single_interrupt+0x9f/0xd7
>  [<ffffffff8104cf5b>] __do_softirq+0x102/0x213
>  [<ffffffff8108a5ec>] ? lock_release_holdtime+0xb6/0xbb
>  [<ffffffff8104d2b4>] ? raise_softirq_irqoff+0x9/0x3d
>  [<ffffffff81424dfc>] call_softirq+0x1c/0x30
>  [<ffffffff81011beb>] do_softirq+0x4b/0xa3
>  [<ffffffff8104cdb0>] irq_exit+0x53/0xd5
>  [<ffffffff8102d865>] smp_call_function_single_interrupt+0x34/0x36
>  [<ffffffff8142486f>] call_function_single_interrupt+0x6f/0x80
>  <EOI>  [<ffffffff8101800b>] ? mwait_idle+0x94/0xcd
>  [<ffffffff81018002>] ? mwait_idle+0x8b/0xcd
>  [<ffffffff81017811>] cpu_idle+0xbb/0x114
>  [<ffffffff81401fbd>] rest_init+0xc1/0xc8
>  [<ffffffff81401efc>] ? csum_partial_copy_generic+0x16c/0x16c
>  [<ffffffff81cdbd3d>] start_kernel+0x3d4/0x3e1
>  [<ffffffff81cdb79e>] ? kernel_init+0x1f7/0x1f7
>  [<ffffffff81cdb2dd>] x86_64_start_reservations+0xb8/0xbd
>  [<ffffffff81cdb3e3>] x86_64_start_kernel+0x101/0x110

This patch clears q->root_blkg and q->root_rl.blkg when root blkg
is destroyed.

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/blk-cgroup.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -285,6 +285,13 @@ static void blkg_destroy_all(struct requ
 		blkg_destroy(blkg);
 		spin_unlock(&blkcg->lock);
 	}
+
+	/*
+	 * root blkg is destroyed.  Just clear the pointer since
+	 * root_rl does not take reference on root blkg.
+	 */
+	q->root_blkg = NULL;
+	q->root_rl.blkg = NULL;
 }
 
 static void blkg_rcu_free(struct rcu_head *rcu_head)



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

* [ 03/24] gpio-timberdale: fix a potential wrapping issue
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 01/24] ext4: fix unjournaled inode bitmap modification Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 02/24] blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 04/24] gpiolib: Dont return -EPROBE_DEFER to sysfs, or for invalid gpios Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Dan Carpenter, Linus Walleij

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit d79550a7bc35c16476ebdc27c78378d8093390ec upstream.

->last_ier is an unsigned long but the high bits can't be used int the
original code because the shift wraps.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpio-timberdale.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -116,7 +116,7 @@ static void timbgpio_irq_disable(struct
 	unsigned long flags;
 
 	spin_lock_irqsave(&tgpio->lock, flags);
-	tgpio->last_ier &= ~(1 << offset);
+	tgpio->last_ier &= ~(1UL << offset);
 	iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
 	spin_unlock_irqrestore(&tgpio->lock, flags);
 }
@@ -128,7 +128,7 @@ static void timbgpio_irq_enable(struct i
 	unsigned long flags;
 
 	spin_lock_irqsave(&tgpio->lock, flags);
-	tgpio->last_ier |= 1 << offset;
+	tgpio->last_ier |= 1UL << offset;
 	iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
 	spin_unlock_irqrestore(&tgpio->lock, flags);
 }



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

* [ 04/24] gpiolib: Dont return -EPROBE_DEFER to sysfs, or for invalid gpios
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2012-11-02 17:06 ` [ 03/24] gpio-timberdale: fix a potential wrapping issue Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 05/24] md/raid1: Fix assembling of arrays containing Replacements Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Mathias Nyman, Linus Walleij

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit ad2fab36d7922401c4576fb7ea9b21a47a29a17f upstream.

gpios requested with invalid numbers, or gpios requested from userspace via sysfs
should not try to be deferred on failure.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpiolib.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -623,9 +623,11 @@ static ssize_t export_store(struct class
 	 */
 
 	status = gpio_request(gpio, "sysfs");
-	if (status < 0)
+	if (status < 0) {
+		if (status == -EPROBE_DEFER)
+			status = -ENODEV;
 		goto done;
-
+	}
 	status = gpio_export(gpio, true);
 	if (status < 0)
 		gpio_free(gpio);
@@ -1191,8 +1193,10 @@ int gpio_request(unsigned gpio, const ch
 
 	spin_lock_irqsave(&gpio_lock, flags);
 
-	if (!gpio_is_valid(gpio))
+	if (!gpio_is_valid(gpio)) {
+		status = -EINVAL;
 		goto done;
+	}
 	desc = &gpio_desc[gpio];
 	chip = desc->chip;
 	if (chip == NULL)



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

* [ 05/24] md/raid1: Fix assembling of arrays containing Replacements.
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2012-11-02 17:06 ` [ 04/24] gpiolib: Dont return -EPROBE_DEFER to sysfs, or for invalid gpios Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 06/24] floppy: dont call alloc_ordered_workqueue inside the alloc_disk loop Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, NeilBrown

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: NeilBrown <neilb@suse.de>

commit 02b898f2f04e418094f0093a3ad0b415bcdbe8eb upstream.

setup_conf in raid1.c uses conf->raid_disks before assigning
a value.  It is used when including 'Replacement' devices.

The consequence is that assembling an array which contains a
replacement will misbehave and either not include the replacement, or
not include the device being replaced.

Though this doesn't lead directly to data corruption, it could lead to
reduced data safety.

So use mddev->raid_disks, which is initialised, instead.

Bug was introduced by commit c19d57980b38a5bb613a898937a1cf85f422fb9b
      md/raid1: recognise replacements when assembling arrays.

in 3.3, so fix is suitable for 3.3.y thru 3.6.y.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/raid1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2699,7 +2699,7 @@ static struct r1conf *setup_conf(struct
 		    || disk_idx < 0)
 			continue;
 		if (test_bit(Replacement, &rdev->flags))
-			disk = conf->mirrors + conf->raid_disks + disk_idx;
+			disk = conf->mirrors + mddev->raid_disks + disk_idx;
 		else
 			disk = conf->mirrors + disk_idx;
 



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

* [ 06/24] floppy: dont call alloc_ordered_workqueue inside the alloc_disk loop
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2012-11-02 17:06 ` [ 05/24] md/raid1: Fix assembling of arrays containing Replacements Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 07/24] floppy: do put_disk on current dr if blk_init_queue fails Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Vivek Goyal, Ben Hutchings,
	Herton Ronaldo Krzesinski, Jiri Kosina, Jens Axboe

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

commit b54e1f88897bcacc2cd359f48ea3b39eaf55f084 upstream.

Since commit 070ad7e ("floppy: convert to delayed work and single-thread
wq"), we end up calling alloc_ordered_workqueue multiple times inside
the loop, which shouldn't be intended. Besides the leak, other side
effect in the current code is if blk_init_queue fails, we would end up
calling unregister_blkdev even if we didn't call yet register_blkdev.

Just moved the allocation of floppy_wq before the loop, and adjusted the
code accordingly.

Acked-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/floppy.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4138,6 +4138,10 @@ static int __init do_floppy_init(void)
 
 	raw_cmd = NULL;
 
+	floppy_wq = alloc_ordered_workqueue("floppy", 0);
+	if (!floppy_wq)
+		return -ENOMEM;
+
 	for (dr = 0; dr < N_DRIVE; dr++) {
 		disks[dr] = alloc_disk(1);
 		if (!disks[dr]) {
@@ -4145,16 +4149,10 @@ static int __init do_floppy_init(void)
 			goto out_put_disk;
 		}
 
-		floppy_wq = alloc_ordered_workqueue("floppy", 0);
-		if (!floppy_wq) {
-			err = -ENOMEM;
-			goto out_put_disk;
-		}
-
 		disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock);
 		if (!disks[dr]->queue) {
 			err = -ENOMEM;
-			goto out_destroy_workq;
+			goto out_put_disk;
 		}
 
 		blk_queue_max_hw_sectors(disks[dr]->queue, 64);
@@ -4318,8 +4316,6 @@ out_release_dma:
 out_unreg_region:
 	blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
 	platform_driver_unregister(&floppy_driver);
-out_destroy_workq:
-	destroy_workqueue(floppy_wq);
 out_unreg_blkdev:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
 out_put_disk:
@@ -4335,6 +4331,7 @@ out_put_disk:
 		}
 		put_disk(disks[dr]);
 	}
+	destroy_workqueue(floppy_wq);
 	return err;
 }
 



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

* [ 07/24] floppy: do put_disk on current dr if blk_init_queue fails
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2012-11-02 17:06 ` [ 06/24] floppy: dont call alloc_ordered_workqueue inside the alloc_disk loop Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 08/24] floppy: properly handle failure on add_disk loop Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Ben Hutchings,
	Herton Ronaldo Krzesinski, Jiri Kosina, Jens Axboe

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

commit 238ab78469c6ab7845b43d5061cd3c92331b2452 upstream.

If blk_init_queue fails, we do not call put_disk on the current dr
(dr is decremented first in the error handling loop).

Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/floppy.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4151,6 +4151,7 @@ static int __init do_floppy_init(void)
 
 		disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock);
 		if (!disks[dr]->queue) {
+			put_disk(disks[dr]);
 			err = -ENOMEM;
 			goto out_put_disk;
 		}



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

* [ 08/24] floppy: properly handle failure on add_disk loop
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2012-11-02 17:06 ` [ 07/24] floppy: do put_disk on current dr if blk_init_queue fails Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 09/24] rbd: reset BACKOFF if unable to re-queue Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Herton Ronaldo Krzesinski, Jiri Kosina,
	Jens Axboe

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

commit d60e7ec18c3fb2cbf90969ccd42889eb2d03aef9 upstream.

On floppy initialization, if something failed inside the loop we call
add_disk, there was no cleanup of previous iterations in the error
handling.

Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/floppy.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4293,7 +4293,7 @@ static int __init do_floppy_init(void)
 
 		err = platform_device_register(&floppy_device[drive]);
 		if (err)
-			goto out_release_dma;
+			goto out_remove_drives;
 
 		err = device_create_file(&floppy_device[drive].dev,
 					 &dev_attr_cmos);
@@ -4311,6 +4311,15 @@ static int __init do_floppy_init(void)
 
 out_unreg_platform_dev:
 	platform_device_unregister(&floppy_device[drive]);
+out_remove_drives:
+	while (drive--) {
+		if ((allowed_drive_mask & (1 << drive)) &&
+		    fdc_state[FDC(drive)].version != FDC_NONE) {
+			del_gendisk(disks[drive]);
+			device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
+			platform_device_unregister(&floppy_device[drive]);
+		}
+	}
 out_release_dma:
 	if (atomic_read(&usage_count))
 		floppy_release_irq_and_dma();



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

* [ 09/24] rbd: reset BACKOFF if unable to re-queue
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2012-11-02 17:06 ` [ 08/24] floppy: properly handle failure on add_disk loop Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 10/24] libceph: avoid NULL kref_put when osd reset races with alloc_msg Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Alex Elder, Sage Weil

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Alex Elder <elder@inktank.com>

commit 588377d6199034c36d335e7df5818b731fea072c upstream.

If ceph_fault() is unable to queue work after a delay, it sets the
BACKOFF connection flag so con_work() will attempt to do so.

In con_work(), when BACKOFF is set, if queue_delayed_work() doesn't
result in newly-queued work, it simply ignores this condition and
proceeds as if no backoff delay were desired.  There are two
problems with this--one of which is a bug.

The first problem is simply that the intended behavior is to back
off, and if we aren't able queue the work item to run after a delay
we're not doing that.

The only reason queue_delayed_work() won't queue work is if the
provided work item is already queued.  In the messenger, this
means that con_work() is already scheduled to be run again.  So
if we simply set the BACKOFF flag again when this occurs, we know
the next con_work() call will again attempt to hold off activity
on the connection until after the delay.

The second problem--the bug--is a leak of a reference count.  If
queue_delayed_work() returns 0 in con_work(), con->ops->put() drops
the connection reference held on entry to con_work().  However,
processing is (was) allowed to continue, and at the end of the
function a second con->ops->put() is called.

This patch fixes both problems.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/ceph/messenger.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2300,10 +2300,11 @@ restart:
 			mutex_unlock(&con->mutex);
 			return;
 		} else {
-			con->ops->put(con);
 			dout("con_work %p FAILED to back off %lu\n", con,
 			     con->delay);
+			set_bit(CON_FLAG_BACKOFF, &con->flags);
 		}
+		goto done;
 	}
 
 	if (con->state == CON_STATE_STANDBY) {



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

* [ 10/24] libceph: avoid NULL kref_put when osd reset races with alloc_msg
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2012-11-02 17:06 ` [ 09/24] rbd: reset BACKOFF if unable to re-queue Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:06 ` [ 11/24] ceph: fix dentry reference leak in encode_fh() Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Sage Weil

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Sage Weil <sage@inktank.com>

commit 9bd952615a42d7e2ce3fa2c632e808e804637a1a upstream.

The ceph_on_in_msg_alloc() method drops con->mutex while it allocates a
message.  If that races with a timeout that resends a zillion messages and
resets the connection, and the ->alloc_msg() method returns a NULL message,
it will call ceph_msg_put(NULL) and BUG.

Fix by only calling put if msg is non-NULL.

Fixes http://tracker.newdream.net/issues/3142

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/ceph/messenger.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2750,7 +2750,8 @@ static int ceph_con_in_msg_alloc(struct
 		msg = con->ops->alloc_msg(con, hdr, skip);
 		mutex_lock(&con->mutex);
 		if (con->state != CON_STATE_OPEN) {
-			ceph_msg_put(msg);
+			if (msg)
+				ceph_msg_put(msg);
 			return -EAGAIN;
 		}
 		con->in_msg = msg;



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

* [ 11/24] ceph: fix dentry reference leak in encode_fh()
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2012-11-02 17:06 ` [ 10/24] libceph: avoid NULL kref_put when osd reset races with alloc_msg Greg Kroah-Hartman
@ 2012-11-02 17:06 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 12/24] ceph: Fix oops when handling mdsmap that decreases max_mds Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David Zafman, Sage Weil

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: David Zafman <david.zafman@inktank.com>

commit 52eb5a900a9863a8b77a895f770e5d825c8e02c6 upstream.

Call to d_find_alias() needs a corresponding dput()

This fixes http://tracker.newdream.net/issues/3271

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ceph/export.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -90,6 +90,8 @@ static int ceph_encode_fh(struct inode *
 		*max_len = handle_length;
 		type = 255;
 	}
+	if (dentry)
+		dput(dentry);
 	return type;
 }
 



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

* [ 12/24] ceph: Fix oops when handling mdsmap that decreases max_mds
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2012-11-02 17:06 ` [ 11/24] ceph: fix dentry reference leak in encode_fh() Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 13/24] libceph: check for invalid mapping Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Yan, Zheng, Sage Weil

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: "Yan, Zheng" <zheng.z.yan@intel.com>

commit 3e8f43a089f06279c5f76a9ccd42578eebf7bfa5 upstream.

When i >= newmap->m_max_mds, ceph_mdsmap_get_addr(newmap, i) return
NULL. Passing NULL to memcmp() triggers oops.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ceph/mds_client.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2625,7 +2625,8 @@ static void check_new_map(struct ceph_md
 		     ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "",
 		     session_state_name(s->s_state));
 
-		if (memcmp(ceph_mdsmap_get_addr(oldmap, i),
+		if (i >= newmap->m_max_mds ||
+		    memcmp(ceph_mdsmap_get_addr(oldmap, i),
 			   ceph_mdsmap_get_addr(newmap, i),
 			   sizeof(struct ceph_entity_addr))) {
 			if (s->s_state == CEPH_MDS_SESSION_OPENING) {



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

* [ 13/24] libceph: check for invalid mapping
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2012-11-02 17:07 ` [ 12/24] ceph: Fix oops when handling mdsmap that decreases max_mds Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 14/24] ceph: avoid 32-bit page index overflow Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Sage Weil, Alex Elder

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Sage Weil <sage@inktank.com>

commit d63b77f4c552cc3a20506871046ab0fcbc332609 upstream.

If we encounter an invalid (e.g., zeroed) mapping, return an error
and avoid a divide by zero.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/ceph/osd_client.h |    2 +-
 include/linux/ceph/osdmap.h     |    6 +++---
 net/ceph/osd_client.c           |   32 ++++++++++++++++++++------------
 net/ceph/osdmap.c               |   18 ++++++++++++++++--
 4 files changed, 40 insertions(+), 18 deletions(-)

--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -207,7 +207,7 @@ extern void ceph_osdc_handle_reply(struc
 extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
 				 struct ceph_msg *msg);
 
-extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc,
+extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc,
 			struct ceph_file_layout *layout,
 			u64 snapid,
 			u64 off, u64 *plen, u64 *bno,
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -109,9 +109,9 @@ extern struct ceph_osdmap *osdmap_apply_
 extern void ceph_osdmap_destroy(struct ceph_osdmap *map);
 
 /* calculate mapping of a file extent to an object */
-extern void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
-					  u64 off, u64 *plen,
-					  u64 *bno, u64 *oxoff, u64 *oxlen);
+extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
+					 u64 off, u64 *plen,
+					 u64 *bno, u64 *oxoff, u64 *oxlen);
 
 /* calculate mapping of object to a placement group */
 extern int ceph_calc_object_layout(struct ceph_object_layout *ol,
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -52,7 +52,7 @@ static int op_has_extent(int op)
 		op == CEPH_OSD_OP_WRITE);
 }
 
-void ceph_calc_raw_layout(struct ceph_osd_client *osdc,
+int ceph_calc_raw_layout(struct ceph_osd_client *osdc,
 			struct ceph_file_layout *layout,
 			u64 snapid,
 			u64 off, u64 *plen, u64 *bno,
@@ -62,12 +62,15 @@ void ceph_calc_raw_layout(struct ceph_os
 	struct ceph_osd_request_head *reqhead = req->r_request->front.iov_base;
 	u64 orig_len = *plen;
 	u64 objoff, objlen;    /* extent in object */
+	int r;
 
 	reqhead->snapid = cpu_to_le64(snapid);
 
 	/* object extent? */
-	ceph_calc_file_object_mapping(layout, off, plen, bno,
-				      &objoff, &objlen);
+	r = ceph_calc_file_object_mapping(layout, off, plen, bno,
+					  &objoff, &objlen);
+	if (r < 0)
+		return r;
 	if (*plen < orig_len)
 		dout(" skipping last %llu, final file extent %llu~%llu\n",
 		     orig_len - *plen, off, *plen);
@@ -83,7 +86,7 @@ void ceph_calc_raw_layout(struct ceph_os
 
 	dout("calc_layout bno=%llx %llu~%llu (%d pages)\n",
 	     *bno, objoff, objlen, req->r_num_pages);
-
+	return 0;
 }
 EXPORT_SYMBOL(ceph_calc_raw_layout);
 
@@ -112,20 +115,25 @@ EXPORT_SYMBOL(ceph_calc_raw_layout);
  *
  * fill osd op in request message.
  */
-static void calc_layout(struct ceph_osd_client *osdc,
-			struct ceph_vino vino,
-			struct ceph_file_layout *layout,
-			u64 off, u64 *plen,
-			struct ceph_osd_request *req,
-			struct ceph_osd_req_op *op)
+static int calc_layout(struct ceph_osd_client *osdc,
+		       struct ceph_vino vino,
+		       struct ceph_file_layout *layout,
+		       u64 off, u64 *plen,
+		       struct ceph_osd_request *req,
+		       struct ceph_osd_req_op *op)
 {
 	u64 bno;
+	int r;
 
-	ceph_calc_raw_layout(osdc, layout, vino.snap, off,
-			     plen, &bno, req, op);
+	r = ceph_calc_raw_layout(osdc, layout, vino.snap, off,
+				 plen, &bno, req, op);
+	if (r < 0)
+		return r;
 
 	snprintf(req->r_oid, sizeof(req->r_oid), "%llx.%08llx", vino.ino, bno);
 	req->r_oid_len = strlen(req->r_oid);
+
+	return r;
 }
 
 /*
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -984,7 +984,7 @@ bad:
  * for now, we write only a single su, until we can
  * pass a stride back to the caller.
  */
-void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
+int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
 				   u64 off, u64 *plen,
 				   u64 *ono,
 				   u64 *oxoff, u64 *oxlen)
@@ -998,11 +998,17 @@ void ceph_calc_file_object_mapping(struc
 
 	dout("mapping %llu~%llu  osize %u fl_su %u\n", off, *plen,
 	     osize, su);
+	if (su == 0 || sc == 0)
+		goto invalid;
 	su_per_object = osize / su;
+	if (su_per_object == 0)
+		goto invalid;
 	dout("osize %u / su %u = su_per_object %u\n", osize, su,
 	     su_per_object);
 
-	BUG_ON((su & ~PAGE_MASK) != 0);
+	if ((su & ~PAGE_MASK) != 0)
+		goto invalid;
+
 	/* bl = *off / su; */
 	t = off;
 	do_div(t, su);
@@ -1030,6 +1036,14 @@ void ceph_calc_file_object_mapping(struc
 	*plen = *oxlen;
 
 	dout(" obj extent %llu~%llu\n", *oxoff, *oxlen);
+	return 0;
+
+invalid:
+	dout(" invalid layout\n");
+	*ono = 0;
+	*oxoff = 0;
+	*oxlen = 0;
+	return -EINVAL;
 }
 EXPORT_SYMBOL(ceph_calc_file_object_mapping);
 



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

* [ 14/24] ceph: avoid 32-bit page index overflow
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2012-11-02 17:07 ` [ 13/24] libceph: check for invalid mapping Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 15/24] USB: mos7840: fix port-data memory leak Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Mohamed Pakkeer, Alex Elder, Sage Weil

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Alex Elder <elder@inktank.com>

commit 6285bc231277419255f3498d3eb5ddc9f8e7fe79 upstream.

A pgoff_t is defined (by default) to have type (unsigned long).  On
architectures such as i686 that's a 32-bit type.  The ceph address
space code was attempting to produce 64 bit offsets by shifting a
page's index by PAGE_CACHE_SHIFT, but the result was not what was
desired because the shift occurred before the result got promoted
to 64 bits.

Fix this by converting all uses of page->index used in this way to
use the page_offset() macro, which ensures the 64-bit result has the
intended value.

This fixes http://tracker.newdream.net/issues/3112

Reported-by:  Mohamed Pakkeer <pakkeer.mohideen@realimage.com>
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ceph/addr.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -205,7 +205,7 @@ static int readpage_nounlock(struct file
 	dout("readpage inode %p file %p page %p index %lu\n",
 	     inode, filp, page, page->index);
 	err = ceph_osdc_readpages(osdc, ceph_vino(inode), &ci->i_layout,
-				  page->index << PAGE_CACHE_SHIFT, &len,
+				  (u64) page_offset(page), &len,
 				  ci->i_truncate_seq, ci->i_truncate_size,
 				  &page, 1, 0);
 	if (err == -ENOENT)
@@ -286,7 +286,7 @@ static int start_read(struct inode *inod
 	int nr_pages = 0;
 	int ret;
 
-	off = page->index << PAGE_CACHE_SHIFT;
+	off = (u64) page_offset(page);
 
 	/* count pages */
 	next_index = page->index;
@@ -426,7 +426,7 @@ static int writepage_nounlock(struct pag
 	struct ceph_inode_info *ci;
 	struct ceph_fs_client *fsc;
 	struct ceph_osd_client *osdc;
-	loff_t page_off = page->index << PAGE_CACHE_SHIFT;
+	loff_t page_off = page_offset(page);
 	int len = PAGE_CACHE_SIZE;
 	loff_t i_size;
 	int err = 0;
@@ -817,8 +817,7 @@ get_more_pages:
 			/* ok */
 			if (locked_pages == 0) {
 				/* prepare async write request */
-				offset = (unsigned long long)page->index
-					<< PAGE_CACHE_SHIFT;
+				offset = (u64) page_offset(page);
 				len = wsize;
 				req = ceph_osdc_new_request(&fsc->client->osdc,
 					    &ci->i_layout,
@@ -1180,7 +1179,7 @@ static int ceph_page_mkwrite(struct vm_a
 	struct inode *inode = vma->vm_file->f_dentry->d_inode;
 	struct page *page = vmf->page;
 	struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
-	loff_t off = page->index << PAGE_CACHE_SHIFT;
+	loff_t off = page_offset(page);
 	loff_t size, len;
 	int ret;
 



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

* [ 15/24] USB: mos7840: fix port-data memory leak
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2012-11-02 17:07 ` [ 14/24] ceph: avoid 32-bit page index overflow Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 16/24] USB: iuu_phoenix: fix backported patches Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Johan Hovold

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Johan Hovold <jhovold@gmail.com>

commit 80c00750f0c9867a65b30a17880939b6bc660a77 upstream.

Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the indentation was kept intact using a do-while(0) in order
to facilitate review. A follow-up patch will remove it.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

This a backport of 80c00750f0c9867 from v3.7-rc to v3.6.5 as requested.

Thanks,
Johan


 drivers/usb/serial/mos7840.c |  198 +++++++++++++++----------------------------
 1 file changed, 71 insertions(+), 127 deletions(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2405,52 +2405,43 @@ static int mos7840_calc_num_ports(struct
 	return mos7840_num_ports;
 }
 
-/****************************************************************************
- * mos7840_startup
- ****************************************************************************/
-
-static int mos7840_startup(struct usb_serial *serial)
+static int mos7840_port_probe(struct usb_serial_port *port)
 {
+	struct usb_serial *serial = port->serial;
 	struct moschip_port *mos7840_port;
-	struct usb_device *dev;
-	int i, status;
+	int status;
+	int pnum;
 	__u16 Data;
 
-	if (!serial) {
-		dbg("%s", "Invalid Handler");
-		return -1;
-	}
-
-	dev = serial->dev;
-
 	/* we set up the pointers to the endpoints in the mos7840_open *
 	 * function, as the structures aren't created yet.             */
 
-	/* set up port private structures */
-	for (i = 0; i < serial->num_ports; ++i) {
-		dbg ("mos7840_startup: configuring port %d............", i);
+	pnum = port->number - serial->minor;
+
+	/* FIXME: remove do-while(0) loop used to keep stable patch minimal.
+	 */
+	do {
+		dbg("mos7840_startup: configuring port %d............", pnum);
 		mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
 		if (mos7840_port == NULL) {
-			dev_err(&dev->dev, "%s - Out of memory\n", __func__);
-			status = -ENOMEM;
-			i--; /* don't follow NULL pointer cleaning up */
-			goto error;
+			dev_err(&port->dev, "%s - Out of memory\n", __func__);
+			return -ENOMEM;
 		}
 
 		/* Initialize all port interrupt end point to port 0 int
 		 * endpoint. Our device has only one interrupt end point
 		 * common to all port */
 
-		mos7840_port->port = serial->port[i];
-		mos7840_set_port_private(serial->port[i], mos7840_port);
+		mos7840_port->port = port;
+		mos7840_set_port_private(port, mos7840_port);
 		spin_lock_init(&mos7840_port->pool_lock);
 
 		/* minor is not initialised until later by
 		 * usb-serial.c:get_free_serial() and cannot therefore be used
 		 * to index device instances */
-		mos7840_port->port_num = i + 1;
-		dbg ("serial->port[i]->number = %d", serial->port[i]->number);
-		dbg ("serial->port[i]->serial->minor = %d", serial->port[i]->serial->minor);
+		mos7840_port->port_num = pnum + 1;
+		dbg("port->number = %d", port->number);
+		dbg("port->serial->minor = %d", port->serial->minor);
 		dbg ("mos7840_port->port_num = %d", mos7840_port->port_num);
 		dbg ("serial->minor = %d", serial->minor);
 
@@ -2480,10 +2471,10 @@ static int mos7840_startup(struct usb_se
 			mos7840_port->DcrRegOffset = 0x1c;
 		}
 		mos7840_dump_serial_port(mos7840_port);
-		mos7840_set_port_private(serial->port[i], mos7840_port);
+		mos7840_set_port_private(port, mos7840_port);
 
 		/* enable rx_disable bit in control register */
-		status = mos7840_get_reg_sync(serial->port[i],
+		status = mos7840_get_reg_sync(port,
 				 mos7840_port->ControlRegOffset, &Data);
 		if (status < 0) {
 			dbg("Reading ControlReg failed status-0x%x", status);
@@ -2491,12 +2482,13 @@ static int mos7840_startup(struct usb_se
 		} else
 			dbg("ControlReg Reading success val is %x, status%d",
 			    Data, status);
+
 		Data |= 0x08;	/* setting driver done bit */
 		Data |= 0x04;	/* sp1_bit to have cts change reflect in
 				   modem status reg */
 
 		/* Data |= 0x20; //rx_disable bit */
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 					 mos7840_port->ControlRegOffset, Data);
 		if (status < 0) {
 			dbg("Writing ControlReg failed(rx_disable) status-0x%x", status);
@@ -2508,7 +2500,7 @@ static int mos7840_startup(struct usb_se
 		/* Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2
 		   and 0x24 in DCR3 */
 		Data = 0x01;
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 			 (__u16) (mos7840_port->DcrRegOffset + 0), Data);
 		if (status < 0) {
 			dbg("Writing DCR0 failed status-0x%x", status);
@@ -2517,7 +2509,7 @@ static int mos7840_startup(struct usb_se
 			dbg("DCR0 Writing success status%d", status);
 
 		Data = 0x05;
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 			 (__u16) (mos7840_port->DcrRegOffset + 1), Data);
 		if (status < 0) {
 			dbg("Writing DCR1 failed status-0x%x", status);
@@ -2526,7 +2518,7 @@ static int mos7840_startup(struct usb_se
 			dbg("DCR1 Writing success status%d", status);
 
 		Data = 0x24;
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 			 (__u16) (mos7840_port->DcrRegOffset + 2), Data);
 		if (status < 0) {
 			dbg("Writing DCR2 failed status-0x%x", status);
@@ -2536,7 +2528,7 @@ static int mos7840_startup(struct usb_se
 
 		/* write values in clkstart0x0 and clkmulti 0x20 */
 		Data = 0x0;
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 					 CLK_START_VALUE_REGISTER, Data);
 		if (status < 0) {
 			dbg("Writing CLK_START_VALUE_REGISTER failed status-0x%x", status);
@@ -2545,7 +2537,7 @@ static int mos7840_startup(struct usb_se
 			dbg("CLK_START_VALUE_REGISTER Writing success status%d", status);
 
 		Data = 0x20;
-		status = mos7840_set_reg_sync(serial->port[i],
+		status = mos7840_set_reg_sync(port,
 					CLK_MULTI_REGISTER, Data);
 		if (status < 0) {
 			dbg("Writing CLK_MULTI_REGISTER failed status-0x%x",
@@ -2557,7 +2549,7 @@ static int mos7840_startup(struct usb_se
 
 		/* write value 0x0 to scratchpad register */
 		Data = 0x00;
-		status = mos7840_set_uart_reg(serial->port[i],
+		status = mos7840_set_uart_reg(port,
 						SCRATCH_PAD_REGISTER, Data);
 		if (status < 0) {
 			dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x",
@@ -2572,7 +2564,7 @@ static int mos7840_startup(struct usb_se
 		    && (serial->num_ports == 2)) {
 
 			Data = 0xff;
-			status = mos7840_set_reg_sync(serial->port[i],
+			status = mos7840_set_reg_sync(port,
 				      (__u16) (ZLP_REG1 +
 				      ((__u16)mos7840_port->port_num)), Data);
 			dbg("ZLIP offset %x",
@@ -2580,14 +2572,14 @@ static int mos7840_startup(struct usb_se
 					((__u16) mos7840_port->port_num)));
 			if (status < 0) {
 				dbg("Writing ZLP_REG%d failed status-0x%x",
-				    i + 2, status);
+				    pnum + 2, status);
 				break;
 			} else
 				dbg("ZLP_REG%d Writing success status%d",
-				    i + 2, status);
+				    pnum + 2, status);
 		} else {
 			Data = 0xff;
-			status = mos7840_set_reg_sync(serial->port[i],
+			status = mos7840_set_reg_sync(port,
 			      (__u16) (ZLP_REG1 +
 			      ((__u16)mos7840_port->port_num) - 0x1), Data);
 			dbg("ZLIP offset %x",
@@ -2595,11 +2587,11 @@ static int mos7840_startup(struct usb_se
 				     ((__u16) mos7840_port->port_num) - 0x1));
 			if (status < 0) {
 				dbg("Writing ZLP_REG%d failed status-0x%x",
-				    i + 1, status);
+				    pnum + 1, status);
 				break;
 			} else
 				dbg("ZLP_REG%d Writing success status%d",
-				    i + 1, status);
+				    pnum + 1, status);
 
 		}
 		mos7840_port->control_urb = usb_alloc_urb(0, GFP_KERNEL);
@@ -2636,105 +2628,58 @@ static int mos7840_startup(struct usb_se
 			mos7840_port->led_flag = false;
 
 			/* Turn off LED */
-			mos7840_set_led_sync(serial->port[i],
+			mos7840_set_led_sync(port,
 						MODEM_CONTROL_REGISTER, 0x0300);
 		}
-	}
-	dbg ("mos7840_startup: all ports configured...........");
+	} while (0);
 
-	/* Zero Length flag enable */
-	Data = 0x0f;
-	status = mos7840_set_reg_sync(serial->port[0], ZLP_REG5, Data);
-	if (status < 0) {
-		dbg("Writing ZLP_REG5 failed status-0x%x", status);
-		goto error;
-	} else
-		dbg("ZLP_REG5 Writing success status%d", status);
-
-	/* setting configuration feature to one */
-	usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
-			(__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, MOS_WDR_TIMEOUT);
+	if (pnum == serial->num_ports - 1) {
+		dbg("mos7840_startup: all ports configured...........");
+
+		/* Zero Length flag enable */
+		Data = 0x0f;
+		status = mos7840_set_reg_sync(serial->port[0], ZLP_REG5, Data);
+		if (status < 0) {
+			dbg("Writing ZLP_REG5 failed status-0x%x", status);
+			goto error;
+		} else
+			dbg("ZLP_REG5 Writing success status%d", status);
+
+		/* setting configuration feature to one */
+		usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+				0x03, 0x00, 0x01, 0x00, NULL, 0x00,
+				MOS_WDR_TIMEOUT);
+	}
 	return 0;
 error:
-	for (/* nothing */; i >= 0; i--) {
-		mos7840_port = mos7840_get_port_private(serial->port[i]);
+	kfree(mos7840_port->dr);
+	kfree(mos7840_port->ctrl_buf);
+	usb_free_urb(mos7840_port->control_urb);
+	kfree(mos7840_port);
 
-		kfree(mos7840_port->dr);
-		kfree(mos7840_port->ctrl_buf);
-		usb_free_urb(mos7840_port->control_urb);
-		kfree(mos7840_port);
-	}
 	return status;
 }
 
-/****************************************************************************
- * mos7840_disconnect
- *	This function is called whenever the device is removed from the usb bus.
- ****************************************************************************/
-
-static void mos7840_disconnect(struct usb_serial *serial)
+static int mos7840_port_remove(struct usb_serial_port *port)
 {
-	int i;
-	unsigned long flags;
 	struct moschip_port *mos7840_port;
 
-	if (!serial) {
-		dbg("%s", "Invalid Handler");
-		return;
-	}
-
-	/* check for the ports to be closed,close the ports and disconnect */
+	mos7840_port = mos7840_get_port_private(port);
 
-	/* free private structure allocated for serial port  *
-	 * stop reads and writes on all ports                */
+	if (mos7840_port->has_led) {
+		/* Turn off LED */
+		mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300);
 
-	for (i = 0; i < serial->num_ports; ++i) {
-		mos7840_port = mos7840_get_port_private(serial->port[i]);
-		dbg ("mos7840_port %d = %p", i, mos7840_port);
-		if (mos7840_port) {
-			usb_kill_urb(mos7840_port->control_urb);
-		}
+		del_timer_sync(&mos7840_port->led_timer1);
+		del_timer_sync(&mos7840_port->led_timer2);
 	}
-}
-
-/****************************************************************************
- * mos7840_release
- *	This function is called when the usb_serial structure is freed.
- ****************************************************************************/
+	usb_kill_urb(mos7840_port->control_urb);
+	usb_free_urb(mos7840_port->control_urb);
+	kfree(mos7840_port->ctrl_buf);
+	kfree(mos7840_port->dr);
+	kfree(mos7840_port);
 
-static void mos7840_release(struct usb_serial *serial)
-{
-	int i;
-	struct moschip_port *mos7840_port;
-
-	if (!serial) {
-		dbg("%s", "Invalid Handler");
-		return;
-	}
-
-	/* check for the ports to be closed,close the ports and disconnect */
-
-	/* free private structure allocated for serial port  *
-	 * stop reads and writes on all ports                */
-
-	for (i = 0; i < serial->num_ports; ++i) {
-		mos7840_port = mos7840_get_port_private(serial->port[i]);
-		dbg("mos7840_port %d = %p", i, mos7840_port);
-		if (mos7840_port) {
-			if (mos7840_port->has_led) {
-				/* Turn off LED */
-				mos7840_set_led_sync(mos7840_port->port,
-						MODEM_CONTROL_REGISTER, 0x0300);
-
-				del_timer_sync(&mos7840_port->led_timer1);
-				del_timer_sync(&mos7840_port->led_timer2);
-			}
-			usb_free_urb(mos7840_port->control_urb);
-			kfree(mos7840_port->ctrl_buf);
-			kfree(mos7840_port->dr);
-			kfree(mos7840_port);
-		}
-	}
+	return 0;
 }
 
 static struct usb_serial_driver moschip7840_4port_device = {
@@ -2762,9 +2707,8 @@ static struct usb_serial_driver moschip7
 	.tiocmget = mos7840_tiocmget,
 	.tiocmset = mos7840_tiocmset,
 	.get_icount = mos7840_get_icount,
-	.attach = mos7840_startup,
-	.disconnect = mos7840_disconnect,
-	.release = mos7840_release,
+	.port_probe = mos7840_port_probe,
+	.port_remove = mos7840_port_remove,
 	.read_bulk_callback = mos7840_bulk_in_callback,
 	.read_int_callback = mos7840_interrupt_callback,
 };



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

* [ 16/24] USB: iuu_phoenix: fix backported patches
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2012-11-02 17:07 ` [ 15/24] USB: mos7840: fix port-data memory leak Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 17/24] USB: io_edgeport: remove unused variable Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Fengguang Wu, Johan Hovold

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Johan Hovold <jhovold@gmail.com>

Fix two memory leaks involving dbgbuf that were introduced in port-probe
error paths when backporting the following port-data fixes from v3.7
(which doesn't have dbgbuf):

0978c94 USB: iuu_phoenix: fix sysfs-attribute creation
5363655 USB: iuu_phoenix: fix port-data memory leak

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/iuu_phoenix.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -105,7 +105,7 @@ static int iuu_port_probe(struct usb_ser
 	}
 
 	priv->dbgbuf = kzalloc(256, GFP_KERNEL);
-	if (!priv->writebuf) {
+	if (!priv->dbgbuf) {
 		kfree(priv->writebuf);
 		kfree(priv->buf);
 		kfree(priv);
@@ -120,6 +120,7 @@ static int iuu_port_probe(struct usb_ser
 
 	ret = iuu_create_sysfs_attrs(port);
 	if (ret) {
+		kfree(priv->dbgbuf);
 		kfree(priv->writebuf);
 		kfree(priv->buf);
 		kfree(priv);



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

* [ 17/24] USB: io_edgeport: remove unused variable
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2012-11-02 17:07 ` [ 16/24] USB: iuu_phoenix: fix backported patches Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 18/24] qla2xxx: Update target lookup session tables when a target session changes Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Paul Bolle

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Paul Bolle <pebolle@tiscali.nl>

The stable commit 12ddc74e8e25107eda81aceb74e3311c1480b381
("USB: io_edgeport: fix port-data memory leak") left one variable
unused:
    drivers/usb/serial/io_edgeport.c: In function 'edge_release':
    drivers/usb/serial/io_edgeport.c:3155:6: warning: unused variable 'i' [-Wunused-variable]

Remove this unused variable.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/io_edgeport.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -3152,7 +3152,6 @@ static void edge_disconnect(struct usb_s
 static void edge_release(struct usb_serial *serial)
 {
 	struct edgeport_serial *edge_serial = usb_get_serial_data(serial);
-	int i;
 
 	dbg("%s", __func__);
 



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

* [ 18/24] qla2xxx: Update target lookup session tables when a target session changes
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2012-11-02 17:07 ` [ 17/24] USB: io_edgeport: remove unused variable Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 19/24] target: reintroduce some obsolete SCSI-2 commands Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Roland Dreier, Chad Dupuis, Arun Easi,
	Saurav Kashyap, Nicholas Bellinger

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Roland Dreier <roland@purestorage.com>

commit c8292d1da53fa60c7516ab03a9d83f7ea266d335 upstream.

It is possible for the target code to change the loop_id or s_id of a
target session in reaction to an FC fabric change.  However, the
session structures are stored in tables that are indexed by these two
keys, and if we just change the session structure but leave the
pointers to it in the old places in the table, havoc can ensue.  For
example, a new session might come along that should go in the old slot
in the table and overwrite the old session pointer.

To handle this, add a new tgt_ops->update_sess() method that also
updates the "by loop_id" and "by s_id" lookup tables when a session
changes, so that the keys where a session pointer is stored in these
tables always matches the keys in the session structure itself.

(nab: Drop unnecessary double inversion with FCF_CONF_COMP_SUPPORTED
      usage)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/qla2xxx/qla_target.c  |   25 +++++-------
 drivers/scsi/qla2xxx/qla_target.h  |    1 
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |   73 +++++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+), 14 deletions(-)

--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -557,6 +557,7 @@ static bool qlt_check_fcport_exist(struc
 	int pmap_len;
 	fc_port_t *fcport;
 	int global_resets;
+	unsigned long flags;
 
 retry:
 	global_resets = atomic_read(&ha->tgt.qla_tgt->tgt_global_resets_count);
@@ -625,10 +626,10 @@ retry:
 	    sess->s_id.b.area, sess->loop_id, fcport->d_id.b.domain,
 	    fcport->d_id.b.al_pa, fcport->d_id.b.area, fcport->loop_id);
 
-	sess->s_id = fcport->d_id;
-	sess->loop_id = fcport->loop_id;
-	sess->conf_compl_supported = !!(fcport->flags &
-	    FCF_CONF_COMP_SUPPORTED);
+	spin_lock_irqsave(&ha->hardware_lock, flags);
+	ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
+				(fcport->flags & FCF_CONF_COMP_SUPPORTED));
+	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 	res = true;
 
@@ -740,10 +741,9 @@ static struct qla_tgt_sess *qlt_create_s
 				qlt_undelete_sess(sess);
 
 			kref_get(&sess->se_sess->sess_kref);
-			sess->s_id = fcport->d_id;
-			sess->loop_id = fcport->loop_id;
-			sess->conf_compl_supported = !!(fcport->flags &
-			    FCF_CONF_COMP_SUPPORTED);
+			ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
+						(fcport->flags & FCF_CONF_COMP_SUPPORTED));
+
 			if (sess->local && !local)
 				sess->local = 0;
 			spin_unlock_irqrestore(&ha->hardware_lock, flags);
@@ -796,8 +796,7 @@ static struct qla_tgt_sess *qlt_create_s
 	 */
 	kref_get(&sess->se_sess->sess_kref);
 
-	sess->conf_compl_supported = !!(fcport->flags &
-	    FCF_CONF_COMP_SUPPORTED);
+	sess->conf_compl_supported = (fcport->flags & FCF_CONF_COMP_SUPPORTED);
 	BUILD_BUG_ON(sizeof(sess->port_name) != sizeof(fcport->port_name));
 	memcpy(sess->port_name, fcport->port_name, sizeof(sess->port_name));
 
@@ -869,10 +868,8 @@ void qlt_fc_port_added(struct scsi_qla_h
 			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf007,
 			    "Reappeared sess %p\n", sess);
 		}
-		sess->s_id = fcport->d_id;
-		sess->loop_id = fcport->loop_id;
-		sess->conf_compl_supported = !!(fcport->flags &
-		    FCF_CONF_COMP_SUPPORTED);
+		ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
+					(fcport->flags & FCF_CONF_COMP_SUPPORTED));
 	}
 
 	if (sess && sess->local) {
--- a/drivers/scsi/qla2xxx/qla_target.h
+++ b/drivers/scsi/qla2xxx/qla_target.h
@@ -648,6 +648,7 @@ struct qla_tgt_func_tmpl {
 
 	int (*check_initiator_node_acl)(struct scsi_qla_host *, unsigned char *,
 					void *, uint8_t *, uint16_t);
+	void (*update_sess)(struct qla_tgt_sess *, port_id_t, uint16_t, bool);
 	struct qla_tgt_sess *(*find_sess_by_loop_id)(struct scsi_qla_host *,
 						const uint16_t);
 	struct qla_tgt_sess *(*find_sess_by_s_id)(struct scsi_qla_host *,
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1468,6 +1468,78 @@ static int tcm_qla2xxx_check_initiator_n
 	return 0;
 }
 
+static void tcm_qla2xxx_update_sess(struct qla_tgt_sess *sess, port_id_t s_id,
+				    uint16_t loop_id, bool conf_compl_supported)
+{
+	struct qla_tgt *tgt = sess->tgt;
+	struct qla_hw_data *ha = tgt->ha;
+	struct tcm_qla2xxx_lport *lport = ha->tgt.target_lport_ptr;
+	struct se_node_acl *se_nacl = sess->se_sess->se_node_acl;
+	struct tcm_qla2xxx_nacl *nacl = container_of(se_nacl,
+			struct tcm_qla2xxx_nacl, se_node_acl);
+	u32 key;
+
+
+	if (sess->loop_id != loop_id || sess->s_id.b24 != s_id.b24)
+		pr_info("Updating session %p from port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x loop_id %d -> %d s_id %x:%x:%x -> %x:%x:%x\n",
+			sess,
+			sess->port_name[0], sess->port_name[1],
+			sess->port_name[2], sess->port_name[3],
+			sess->port_name[4], sess->port_name[5],
+			sess->port_name[6], sess->port_name[7],
+			sess->loop_id, loop_id,
+			sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa,
+			s_id.b.domain, s_id.b.area, s_id.b.al_pa);
+
+	if (sess->loop_id != loop_id) {
+		/*
+		 * Because we can shuffle loop IDs around and we
+		 * update different sessions non-atomically, we might
+		 * have overwritten this session's old loop ID
+		 * already, and we might end up overwriting some other
+		 * session that will be updated later.  So we have to
+		 * be extra careful and we can't warn about those things...
+		 */
+		if (lport->lport_loopid_map[sess->loop_id].se_nacl == se_nacl)
+			lport->lport_loopid_map[sess->loop_id].se_nacl = NULL;
+
+		lport->lport_loopid_map[loop_id].se_nacl = se_nacl;
+
+		sess->loop_id = loop_id;
+	}
+
+	if (sess->s_id.b24 != s_id.b24) {
+		key = (((u32) sess->s_id.b.domain << 16) |
+		       ((u32) sess->s_id.b.area   <<  8) |
+		       ((u32) sess->s_id.b.al_pa));
+
+		if (btree_lookup32(&lport->lport_fcport_map, key))
+			WARN(btree_remove32(&lport->lport_fcport_map, key) != se_nacl,
+			     "Found wrong se_nacl when updating s_id %x:%x:%x\n",
+			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
+		else
+			WARN(1, "No lport_fcport_map entry for s_id %x:%x:%x\n",
+			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
+
+		key = (((u32) s_id.b.domain << 16) |
+		       ((u32) s_id.b.area   <<  8) |
+		       ((u32) s_id.b.al_pa));
+
+		if (btree_lookup32(&lport->lport_fcport_map, key)) {
+			WARN(1, "Already have lport_fcport_map entry for s_id %x:%x:%x\n",
+			     s_id.b.domain, s_id.b.area, s_id.b.al_pa);
+			btree_update32(&lport->lport_fcport_map, key, se_nacl);
+		} else {
+			btree_insert32(&lport->lport_fcport_map, key, se_nacl, GFP_ATOMIC);
+		}
+
+		sess->s_id = s_id;
+		nacl->nport_id = key;
+	}
+
+	sess->conf_compl_supported = conf_compl_supported;
+}
+
 /*
  * Calls into tcm_qla2xxx used by qla2xxx LLD I/O path.
  */
@@ -1478,6 +1550,7 @@ static struct qla_tgt_func_tmpl tcm_qla2
 	.free_cmd		= tcm_qla2xxx_free_cmd,
 	.free_mcmd		= tcm_qla2xxx_free_mcmd,
 	.free_session		= tcm_qla2xxx_free_session,
+	.update_sess		= tcm_qla2xxx_update_sess,
 	.check_initiator_node_acl = tcm_qla2xxx_check_initiator_node_acl,
 	.find_sess_by_s_id	= tcm_qla2xxx_find_sess_by_s_id,
 	.find_sess_by_loop_id	= tcm_qla2xxx_find_sess_by_loop_id,



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

* [ 19/24] target: reintroduce some obsolete SCSI-2 commands
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2012-11-02 17:07 ` [ 18/24] qla2xxx: Update target lookup session tables when a target session changes Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 20/24] target: Fix double-free of se_cmd in target_complete_tmr_failure Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Bernhard Kohl, Christoph Hellwig,
	Nicholas Bellinger

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Bernhard Kohl <bernhard.kohl@nsn.com>

commit 1a1ff38c4cebf23be8bf0009a76b082a13bd25cb upstream.

With kernel 3.6 some obsolete SCSI-2 commands including SEEK_10 have
have been removed by commit 1fd032ee10d2816c947f5d5b9abda95e728f0a8f
"target: move code for CDB emulation".

There are still clients out there which use these old SCSI-2 commands.
This mainly happens when running VMs with legacy guest systems,
connected via SCSI command pass-through to iSCSI targets. Make them
happy and return status GOOD.

Many real SCSI disks or external iSCSI storage devices still support
these old commands. So let's make LIO backward compatible as well.

This patch adds support for the previously removed SEEK_10 and
additionally the SEEK_6 and REZERO_UNIT commands.

Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/target_core_sbc.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -128,6 +128,12 @@ static int sbc_emulate_verify(struct se_
 	return 0;
 }
 
+static int sbc_emulate_noop(struct se_cmd *cmd)
+{
+	target_complete_cmd(cmd, GOOD);
+	return 0;
+}
+
 static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors)
 {
 	return cmd->se_dev->se_sub_dev->se_dev_attrib.block_size * sectors;
@@ -524,6 +530,18 @@ int sbc_parse_cdb(struct se_cmd *cmd, st
 		size = 0;
 		cmd->execute_cmd = sbc_emulate_verify;
 		break;
+	case REZERO_UNIT:
+	case SEEK_6:
+	case SEEK_10:
+		/*
+		 * There are still clients out there which use these old SCSI-2
+		 * commands. This mainly happens when running VMs with legacy
+		 * guest systems, connected via SCSI command pass-through to
+		 * iSCSI targets. Make them happy and return status GOOD.
+		 */
+		size = 0;
+		cmd->execute_cmd = sbc_emulate_noop;
+		break;
 	default:
 		ret = spc_parse_cdb(cmd, &size);
 		if (ret)



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

* [ 20/24] target: Fix double-free of se_cmd in target_complete_tmr_failure
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2012-11-02 17:07 ` [ 19/24] target: reintroduce some obsolete SCSI-2 commands Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 21/24] HID: microsoft: fix invalid rdesc for 3k kbd Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Nicholas Bellinger, Christoph Hellwig,
	Roland Dreier, Andy Grover

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Nicholas Bellinger <nab@linux-iscsi.org>

commit e13d5fef88c40b87c8430f8274c3a9ca32ef90bc upstream.

Fabric drivers currently expect to internally release se_cmd in the event
of a TMR failure during target_submit_tmr(), which means the immediate call
to transport_generic_free_cmd() after TFO->queue_tm_rsp() from within
target_complete_tmr_failure() workqueue context is wrong.

This is done as some fabrics expect TMR operations to be acknowledged
before releasing the descriptor, so the assumption that core is releasing
se_cmd associated TMR memory is incorrect.  This fixes a OOPs where
transport_generic_free_cmd() was being called more than once.

This bug was originally observed with tcm_qla2xxx fabric ports.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Andy Grover <agrover@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/target_core_transport.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1553,7 +1553,6 @@ static void target_complete_tmr_failure(
 
 	se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST;
 	se_cmd->se_tfo->queue_tm_rsp(se_cmd);
-	transport_generic_free_cmd(se_cmd, 0);
 }
 
 /**



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

* [ 21/24] HID: microsoft: fix invalid rdesc for 3k kbd
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2012-11-02 17:07 ` [ 20/24] target: Fix double-free of se_cmd in target_complete_tmr_failure Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 22/24] drm/nouveau: silence modesetting spam on pre-gf8 chipsets Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jiri Slaby, Jiri Kosina

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Jiri Slaby <jslaby@suse.cz>

commit 3ccc60f9d8c39180c205dba1a020735bda1b2491 upstream.

Microsoft Digital Media Keyboard 3000 has two interfaces, and the
second one has a report descriptor with a bug. The second collection
says:
05 01 -- global; usage page -- 01 -- Generic Desktop Controls
09 80 -- local; usage -- 80 -- System Control
a1 01 -- main; collection -- 01 -- application

85 03 -- global; report ID -- 03
19 00 -- local; Usage Minimum -- 00
29 ff -- local; Usage Maximum -- ff
15 00 -- global; Logical Minimum -- 0
26 ff 00 -- global; Logical Maximum -- ff
81 00 -- main; input

c0 -- main; End Collection

I.e. it makes us think that there are all kinds of usages of system
control. That the keyboard is a not only a keyboard, but also a
joystick, mouse, gamepad, keypad, etc. The same as for the Wireless
Desktop Receiver, this should be Physical Min/Max. So fix that
appropriately.

References: https://bugzilla.novell.com/show_bug.cgi?id=776834
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hid/hid-microsoft.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

--- a/drivers/hid/hid-microsoft.c
+++ b/drivers/hid/hid-microsoft.c
@@ -29,22 +29,30 @@
 #define MS_RDESC		0x08
 #define MS_NOGET		0x10
 #define MS_DUPLICATE_USAGES	0x20
+#define MS_RDESC_3K		0x40
 
-/*
- * Microsoft Wireless Desktop Receiver (Model 1028) has
- * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
- */
 static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
 	unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
 
+	/*
+	 * Microsoft Wireless Desktop Receiver (Model 1028) has
+	 * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
+	 */
 	if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 &&
 			rdesc[559] == 0x29) {
 		hid_info(hdev, "fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");
 		rdesc[557] = 0x35;
 		rdesc[559] = 0x45;
 	}
+	/* the same as above (s/usage/physical/) */
+	if ((quirks & MS_RDESC_3K) && *rsize == 106 &&
+			!memcmp((char []){ 0x19, 0x00, 0x29, 0xff },
+				&rdesc[94], 4)) {
+		rdesc[94] = 0x35;
+		rdesc[96] = 0x45;
+	}
 	return rdesc;
 }
 
@@ -193,7 +201,7 @@ static const struct hid_device_id ms_dev
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB),
 		.driver_data = MS_PRESENTER },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K),
-		.driver_data = MS_ERGONOMY },
+		.driver_data = MS_ERGONOMY | MS_RDESC_3K },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0),
 		.driver_data = MS_NOGET },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),



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

* [ 22/24] drm/nouveau: silence modesetting spam on pre-gf8 chipsets
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2012-11-02 17:07 ` [ 21/24] HID: microsoft: fix invalid rdesc for 3k kbd Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 23/24] drm/nouveau: fix suspend/resume when in headless mode Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ben Skeggs

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Ben Skeggs <bskeggs@redhat.com>

commit cee59f15a60cc6269a25e3f6fbf1a577d6ab8115 upstream.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/nv04_dac.c |    8 ++++----
 drivers/gpu/drm/nouveau/nv04_dfp.c |    6 +++---
 drivers/gpu/drm/nouveau/nv04_tv.c  |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

--- a/drivers/gpu/drm/nouveau/nv04_dac.c
+++ b/drivers/gpu/drm/nouveau/nv04_dac.c
@@ -210,7 +210,7 @@ out:
 	NVWriteVgaCrtc(dev, 0, NV_CIO_CR_MODE_INDEX, saved_cr_mode);
 
 	if (blue == 0x18) {
-		NV_INFO(dev, "Load detected on head A\n");
+		NV_DEBUG(dev, "Load detected on head A\n");
 		return connector_status_connected;
 	}
 
@@ -323,7 +323,7 @@ nv17_dac_detect(struct drm_encoder *enco
 
 	if (nv17_dac_sample_load(encoder) &
 	    NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI) {
-		NV_INFO(dev, "Load detected on output %c\n",
+		NV_DEBUG(dev, "Load detected on output %c\n",
 			'@' + ffs(dcb->or));
 		return connector_status_connected;
 	} else {
@@ -398,7 +398,7 @@ static void nv04_dac_commit(struct drm_e
 
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
-	NV_INFO(dev, "Output %s is running on CRTC %d using output %c\n",
+	NV_DEBUG(dev, "Output %s is running on CRTC %d using output %c\n",
 		drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
 		nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
@@ -447,7 +447,7 @@ static void nv04_dac_dpms(struct drm_enc
 		return;
 	nv_encoder->last_dpms = mode;
 
-	NV_INFO(dev, "Setting dpms mode %d on vga encoder (output %d)\n",
+	NV_DEBUG(dev, "Setting dpms mode %d on vga encoder (output %d)\n",
 		     mode, nv_encoder->dcb->index);
 
 	nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON);
--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
+++ b/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -476,7 +476,7 @@ static void nv04_dfp_commit(struct drm_e
 
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
-	NV_INFO(dev, "Output %s is running on CRTC %d using output %c\n",
+	NV_DEBUG(dev, "Output %s is running on CRTC %d using output %c\n",
 		drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
 		nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
@@ -519,7 +519,7 @@ static void nv04_lvds_dpms(struct drm_en
 		return;
 	nv_encoder->last_dpms = mode;
 
-	NV_INFO(dev, "Setting dpms mode %d on lvds encoder (output %d)\n",
+	NV_DEBUG(dev, "Setting dpms mode %d on lvds encoder (output %d)\n",
 		     mode, nv_encoder->dcb->index);
 
 	if (was_powersaving && is_powersaving_dpms(mode))
@@ -564,7 +564,7 @@ static void nv04_tmds_dpms(struct drm_en
 		return;
 	nv_encoder->last_dpms = mode;
 
-	NV_INFO(dev, "Setting dpms mode %d on tmds encoder (output %d)\n",
+	NV_DEBUG(dev, "Setting dpms mode %d on tmds encoder (output %d)\n",
 		     mode, nv_encoder->dcb->index);
 
 	nv04_dfp_update_backlight(encoder, mode);
--- a/drivers/gpu/drm/nouveau/nv04_tv.c
+++ b/drivers/gpu/drm/nouveau/nv04_tv.c
@@ -69,7 +69,7 @@ static void nv04_tv_dpms(struct drm_enco
 	struct nv04_mode_state *state = &dev_priv->mode_reg;
 	uint8_t crtc1A;
 
-	NV_INFO(dev, "Setting dpms mode %d on TV encoder (output %d)\n",
+	NV_DEBUG(dev, "Setting dpms mode %d on TV encoder (output %d)\n",
 		mode, nv_encoder->dcb->index);
 
 	state->pllsel &= ~(PLLSEL_TV_CRTC1_MASK | PLLSEL_TV_CRTC2_MASK);
@@ -162,7 +162,7 @@ static void nv04_tv_commit(struct drm_en
 
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
-	NV_INFO(dev, "Output %s is running on CRTC %d using output %c\n",
+	NV_DEBUG(dev, "Output %s is running on CRTC %d using output %c\n",
 		      drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base), nv_crtc->index,
 		      '@' + ffs(nv_encoder->dcb->or));
 }



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

* [ 23/24] drm/nouveau: fix suspend/resume when in headless mode
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2012-11-02 17:07 ` [ 22/24] drm/nouveau: silence modesetting spam on pre-gf8 chipsets Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-02 17:07 ` [ 24/24] drm/nouveau: headless mode by default if pci class != vga display Greg Kroah-Hartman
  2012-11-05  7:37 ` [ 00/24] 3.6.6-stable review Zhi Yong Wu
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ben Skeggs

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Ben Skeggs <bskeggs@redhat.com>

Backport of fixes from upstream commit:
9430738d80223a1cd791a2baa74fa170d3df1262

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/nouveau_drv.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -188,11 +188,13 @@ nouveau_pci_suspend(struct pci_dev *pdev
 	if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
 		return 0;
 
-	NV_INFO(dev, "Disabling display...\n");
-	nouveau_display_fini(dev);
+	if (dev->mode_config.num_crtc) {
+		NV_INFO(dev, "Disabling display...\n");
+		nouveau_display_fini(dev);
 
-	NV_INFO(dev, "Disabling fbcon...\n");
-	nouveau_fbcon_set_suspend(dev, 1);
+		NV_INFO(dev, "Disabling fbcon...\n");
+		nouveau_fbcon_set_suspend(dev, 1);
+	}
 
 	NV_INFO(dev, "Unpinning framebuffer(s)...\n");
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -359,10 +361,12 @@ nouveau_pci_resume(struct pci_dev *pdev)
 			NV_ERROR(dev, "Could not pin/map cursor.\n");
 	}
 
-	nouveau_fbcon_set_suspend(dev, 0);
-	nouveau_fbcon_zfill_all(dev);
+	if (dev->mode_config.num_crtc) {
+		nouveau_fbcon_set_suspend(dev, 0);
+		nouveau_fbcon_zfill_all(dev);
 
-	nouveau_display_init(dev);
+		nouveau_display_init(dev);
+	}
 
 	/* Force CLUT to get re-loaded during modeset */
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {



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

* [ 24/24] drm/nouveau: headless mode by default if pci class != vga display
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2012-11-02 17:07 ` [ 23/24] drm/nouveau: fix suspend/resume when in headless mode Greg Kroah-Hartman
@ 2012-11-02 17:07 ` Greg Kroah-Hartman
  2012-11-05  7:37 ` [ 00/24] 3.6.6-stable review Zhi Yong Wu
  24 siblings, 0 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-02 17:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ben Skeggs

3.6-stable review patch.  If anyone has any objections, please let me know.

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

From: Ben Skeggs <bskeggs@redhat.com>

This is to prevent nouveau from taking over the console on headless boards
such as Tesla.

Backport of upstream commit: e412e95a268fa8544858ebfe066826b290430d51

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/nouveau_drv.c   |    2 --
 drivers/gpu/drm/nouveau/nouveau_state.c |    4 +++-
 2 files changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -488,9 +488,7 @@ static int __init nouveau_init(void)
 #ifdef CONFIG_VGA_CONSOLE
 		if (vgacon_text_force())
 			nouveau_modeset = 0;
-		else
 #endif
-			nouveau_modeset = 1;
 	}
 
 	if (!nouveau_modeset)
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -50,6 +50,7 @@ static int nouveau_init_engine_ptrs(stru
 {
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
 	struct nouveau_engine *engine = &dev_priv->engine;
+	u32 pclass = dev->pdev->class >> 8;
 
 	switch (dev_priv->chipset & 0xf0) {
 	case 0x00:
@@ -428,7 +429,8 @@ static int nouveau_init_engine_ptrs(stru
 	}
 
 	/* headless mode */
-	if (nouveau_modeset == 2) {
+	if (nouveau_modeset == 2 ||
+	    (nouveau_modeset < 0 && pclass != PCI_CLASS_DISPLAY_VGA)) {
 		engine->display.early_init = nouveau_stub_init;
 		engine->display.late_takedown = nouveau_stub_takedown;
 		engine->display.create = nouveau_stub_init;



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

* Re: [ 00/24] 3.6.6-stable review
  2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2012-11-02 17:07 ` [ 24/24] drm/nouveau: headless mode by default if pci class != vga display Greg Kroah-Hartman
@ 2012-11-05  7:37 ` Zhi Yong Wu
  2012-11-05  7:41   ` Greg Kroah-Hartman
  24 siblings, 1 reply; 29+ messages in thread
From: Zhi Yong Wu @ 2012-11-05  7:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, torvalds, akpm, alan, Nicholas A. Bellinger,
	bernhard.kohl, herton.krzesinski

HI, greg

Some of the patchset haven't passed the check of checkpatch.pl as below:

WARNING: line over 80 characters
#85: FILE: drivers/block/floppy.c:4319:
+			device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);

WARNING: line over 80 characters
#419: FILE: drivers/scsi/qla2xxx/qla_target.c:744:
+			ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,

WARNING: line over 80 characters
#420: FILE: drivers/scsi/qla2xxx/qla_target.c:745:
+						(fcport->flags & FCF_CONF_COMP_SUPPORTED));

WARNING: line over 80 characters
#443: FILE: drivers/scsi/qla2xxx/qla_target.c:871:
+		ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,

WARNING: line over 80 characters
#444: FILE: drivers/scsi/qla2xxx/qla_target.c:872:
+					(fcport->flags & FCF_CONF_COMP_SUPPORTED));

WARNING: line over 80 characters
#488: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1491:
+			sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa,

WARNING: line over 80 characters
#514: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1517:
+			WARN(btree_remove32(&lport->lport_fcport_map, key) != se_nacl,

WARNING: line over 80 characters
#516: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1519:
+			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);

WARNING: line over 80 characters
#519: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1522:
+			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);

WARNING: line over 80 characters
#530: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1533:
+			btree_insert32(&lport->lport_fcport_map, key, se_nacl, GFP_ATOMIC);

total: 0 errors, 10 warnings, 1094 lines checked


On Sat, Nov 3, 2012 at 1:06 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> This is the start of the stable review cycle for the 3.6.6 release.
> There are 24 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 me know.
>
> Responses should be made by Sun Nov  4 17:02:39 UTC 2012.
> 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/v3.0/stable-review/patch-3.6.6-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>     Linux 3.6.6-rc1
>
> Ben Skeggs <bskeggs@redhat.com>
>     drm/nouveau: headless mode by default if pci class != vga display
>
> Ben Skeggs <bskeggs@redhat.com>
>     drm/nouveau: fix suspend/resume when in headless mode
>
> Ben Skeggs <bskeggs@redhat.com>
>     drm/nouveau: silence modesetting spam on pre-gf8 chipsets
>
> Jiri Slaby <jslaby@suse.cz>
>     HID: microsoft: fix invalid rdesc for 3k kbd
>
> Nicholas Bellinger <nab@linux-iscsi.org>
>     target: Fix double-free of se_cmd in target_complete_tmr_failure
>
> Bernhard Kohl <bernhard.kohl@nsn.com>
>     target: reintroduce some obsolete SCSI-2 commands
>
> Roland Dreier <roland@purestorage.com>
>     qla2xxx: Update target lookup session tables when a target session changes
>
> Paul Bolle <pebolle@tiscali.nl>
>     USB: io_edgeport: remove unused variable
>
> Johan Hovold <jhovold@gmail.com>
>     USB: iuu_phoenix: fix backported patches
>
> Johan Hovold <jhovold@gmail.com>
>     USB: mos7840: fix port-data memory leak
>
> Alex Elder <elder@inktank.com>
>     ceph: avoid 32-bit page index overflow
>
> Sage Weil <sage@inktank.com>
>     libceph: check for invalid mapping
>
> Yan, Zheng <zheng.z.yan@intel.com>
>     ceph: Fix oops when handling mdsmap that decreases max_mds
>
> David Zafman <david.zafman@inktank.com>
>     ceph: fix dentry reference leak in encode_fh()
>
> Sage Weil <sage@inktank.com>
>     libceph: avoid NULL kref_put when osd reset races with alloc_msg
>
> Alex Elder <elder@inktank.com>
>     rbd: reset BACKOFF if unable to re-queue
>
> Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
>     floppy: properly handle failure on add_disk loop
>
> Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
>     floppy: do put_disk on current dr if blk_init_queue fails
>
> Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
>     floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop
>
> NeilBrown <neilb@suse.de>
>     md/raid1: Fix assembling of arrays containing Replacements.
>
> Mathias Nyman <mathias.nyman@linux.intel.com>
>     gpiolib: Don't return -EPROBE_DEFER to sysfs, or for invalid gpios
>
> Dan Carpenter <dan.carpenter@oracle.com>
>     gpio-timberdale: fix a potential wrapping issue
>
> Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
>     blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg
>
> Eric Sandeen <sandeen@redhat.com>
>     ext4: fix unjournaled inode bitmap modification
>
>
> -------------
>
> Diffstat:
>
>  Makefile                                |   4 +-
>  block/blk-cgroup.c                      |   7 ++
>  drivers/block/floppy.c                  |  27 +++--
>  drivers/gpio/gpio-timberdale.c          |   4 +-
>  drivers/gpio/gpiolib.c                  |  10 +-
>  drivers/gpu/drm/nouveau/nouveau_drv.c   |  20 ++--
>  drivers/gpu/drm/nouveau/nouveau_state.c |   4 +-
>  drivers/gpu/drm/nouveau/nv04_dac.c      |   8 +-
>  drivers/gpu/drm/nouveau/nv04_dfp.c      |   6 +-
>  drivers/gpu/drm/nouveau/nv04_tv.c       |   4 +-
>  drivers/hid/hid-microsoft.c             |  18 ++-
>  drivers/md/raid1.c                      |   2 +-
>  drivers/scsi/qla2xxx/qla_target.c       |  25 ++--
>  drivers/scsi/qla2xxx/qla_target.h       |   1 +
>  drivers/scsi/qla2xxx/tcm_qla2xxx.c      |  73 ++++++++++++
>  drivers/target/target_core_sbc.c        |  18 +++
>  drivers/target/target_core_transport.c  |   1 -
>  drivers/usb/serial/io_edgeport.c        |   1 -
>  drivers/usb/serial/iuu_phoenix.c        |   3 +-
>  drivers/usb/serial/mos7840.c            | 198 ++++++++++++--------------------
>  fs/ceph/addr.c                          |  11 +-
>  fs/ceph/export.c                        |   2 +
>  fs/ceph/mds_client.c                    |   3 +-
>  fs/ext4/ialloc.c                        |  19 ++-
>  include/linux/ceph/osd_client.h         |   2 +-
>  include/linux/ceph/osdmap.h             |   6 +-
>  net/ceph/messenger.c                    |   6 +-
>  net/ceph/osd_client.c                   |  32 ++++--
>  net/ceph/osdmap.c                       |  18 ++-
>  29 files changed, 310 insertions(+), 223 deletions(-)
>
>
> --
> 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,

Zhi Yong Wu

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

* Re: [ 00/24] 3.6.6-stable review
  2012-11-05  7:37 ` [ 00/24] 3.6.6-stable review Zhi Yong Wu
@ 2012-11-05  7:41   ` Greg Kroah-Hartman
  2012-11-05  7:46     ` Zhi Yong Wu
  0 siblings, 1 reply; 29+ messages in thread
From: Greg Kroah-Hartman @ 2012-11-05  7:41 UTC (permalink / raw)
  To: Zhi Yong Wu
  Cc: linux-kernel, stable, torvalds, akpm, alan, Nicholas A. Bellinger,
	bernhard.kohl, herton.krzesinski

On Mon, Nov 05, 2012 at 03:37:31PM +0800, Zhi Yong Wu wrote:
> HI, greg
> 
> Some of the patchset haven't passed the check of checkpatch.pl as below:
> 
> WARNING: line over 80 characters
> #85: FILE: drivers/block/floppy.c:4319:
> +			device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
> 
> WARNING: line over 80 characters
> #419: FILE: drivers/scsi/qla2xxx/qla_target.c:744:
> +			ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
> 
> WARNING: line over 80 characters
> #420: FILE: drivers/scsi/qla2xxx/qla_target.c:745:
> +						(fcport->flags & FCF_CONF_COMP_SUPPORTED));
> 
> WARNING: line over 80 characters
> #443: FILE: drivers/scsi/qla2xxx/qla_target.c:871:
> +		ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
> 
> WARNING: line over 80 characters
> #444: FILE: drivers/scsi/qla2xxx/qla_target.c:872:
> +					(fcport->flags & FCF_CONF_COMP_SUPPORTED));
> 
> WARNING: line over 80 characters
> #488: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1491:
> +			sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa,
> 
> WARNING: line over 80 characters
> #514: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1517:
> +			WARN(btree_remove32(&lport->lport_fcport_map, key) != se_nacl,
> 
> WARNING: line over 80 characters
> #516: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1519:
> +			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
> 
> WARNING: line over 80 characters
> #519: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1522:
> +			     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
> 
> WARNING: line over 80 characters
> #530: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1533:
> +			btree_insert32(&lport->lport_fcport_map, key, se_nacl, GFP_ATOMIC);
> 
> total: 0 errors, 10 warnings, 1094 lines checked

That's fine, take those up with the people who send them in for the
upstream kernel, I take them no-changes for the stable releases.

And really, the 80 characters is just a "hint", it's not a hard and fast
rule for anything here.  Especially for the old, and horrible, floppy
and scsi drivers :)

thanks,

greg k-h

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

* Re: [ 00/24] 3.6.6-stable review
  2012-11-05  7:41   ` Greg Kroah-Hartman
@ 2012-11-05  7:46     ` Zhi Yong Wu
  2012-11-05  8:19       ` Willy Tarreau
  0 siblings, 1 reply; 29+ messages in thread
From: Zhi Yong Wu @ 2012-11-05  7:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, torvalds, akpm, alan, Nicholas A. Bellinger,
	bernhard.kohl, herton.krzesinski

On Mon, Nov 5, 2012 at 3:41 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Mon, Nov 05, 2012 at 03:37:31PM +0800, Zhi Yong Wu wrote:
>> HI, greg
>>
>> Some of the patchset haven't passed the check of checkpatch.pl as below:
>>
>> WARNING: line over 80 characters
>> #85: FILE: drivers/block/floppy.c:4319:
>> +                     device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
>>
>> WARNING: line over 80 characters
>> #419: FILE: drivers/scsi/qla2xxx/qla_target.c:744:
>> +                     ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
>>
>> WARNING: line over 80 characters
>> #420: FILE: drivers/scsi/qla2xxx/qla_target.c:745:
>> +                                             (fcport->flags & FCF_CONF_COMP_SUPPORTED));
>>
>> WARNING: line over 80 characters
>> #443: FILE: drivers/scsi/qla2xxx/qla_target.c:871:
>> +             ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, fcport->loop_id,
>>
>> WARNING: line over 80 characters
>> #444: FILE: drivers/scsi/qla2xxx/qla_target.c:872:
>> +                                     (fcport->flags & FCF_CONF_COMP_SUPPORTED));
>>
>> WARNING: line over 80 characters
>> #488: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1491:
>> +                     sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa,
>>
>> WARNING: line over 80 characters
>> #514: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1517:
>> +                     WARN(btree_remove32(&lport->lport_fcport_map, key) != se_nacl,
>>
>> WARNING: line over 80 characters
>> #516: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1519:
>> +                          sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
>>
>> WARNING: line over 80 characters
>> #519: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1522:
>> +                          sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);
>>
>> WARNING: line over 80 characters
>> #530: FILE: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1533:
>> +                     btree_insert32(&lport->lport_fcport_map, key, se_nacl, GFP_ATOMIC);
>>
>> total: 0 errors, 10 warnings, 1094 lines checked
>
> That's fine, take those up with the people who send them in for the
> upstream kernel, I take them no-changes for the stable releases.
I will do after all three stable -rc kernels test are completed.

>
> And really, the 80 characters is just a "hint", it's not a hard and fast
> rule for anything here.  Especially for the old, and horrible, floppy
> and scsi drivers :)
ok, thanks.

>
> thanks,
>
> greg k-h



-- 
Regards,

Zhi Yong Wu

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

* Re: [ 00/24] 3.6.6-stable review
  2012-11-05  7:46     ` Zhi Yong Wu
@ 2012-11-05  8:19       ` Willy Tarreau
  0 siblings, 0 replies; 29+ messages in thread
From: Willy Tarreau @ 2012-11-05  8:19 UTC (permalink / raw)
  To: Zhi Yong Wu
  Cc: Greg Kroah-Hartman, linux-kernel, stable, torvalds, akpm, alan,
	Nicholas A. Bellinger, bernhard.kohl, herton.krzesinski

On Mon, Nov 05, 2012 at 03:46:31PM +0800, Zhi Yong Wu wrote:
> > And really, the 80 characters is just a "hint", it's not a hard and fast
> > rule for anything here.  Especially for the old, and horrible, floppy
> > and scsi drivers :)
> ok, thanks.

And even worse, look at the staging/panel driver I wrote a long time ago,
someone found it smart to truncate it to 80 chars, resulting in some
expressions being written on 10 lines between the 75 and 80th column...
Now it's unreadable. Definitely not something to do.

Willy


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

end of thread, other threads:[~2012-11-05  8:19 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-02 17:06 [ 00/24] 3.6.6-stable review Greg Kroah-Hartman
2012-11-02 17:06 ` [ 01/24] ext4: fix unjournaled inode bitmap modification Greg Kroah-Hartman
2012-11-02 17:06 ` [ 02/24] blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg Greg Kroah-Hartman
2012-11-02 17:06 ` [ 03/24] gpio-timberdale: fix a potential wrapping issue Greg Kroah-Hartman
2012-11-02 17:06 ` [ 04/24] gpiolib: Dont return -EPROBE_DEFER to sysfs, or for invalid gpios Greg Kroah-Hartman
2012-11-02 17:06 ` [ 05/24] md/raid1: Fix assembling of arrays containing Replacements Greg Kroah-Hartman
2012-11-02 17:06 ` [ 06/24] floppy: dont call alloc_ordered_workqueue inside the alloc_disk loop Greg Kroah-Hartman
2012-11-02 17:06 ` [ 07/24] floppy: do put_disk on current dr if blk_init_queue fails Greg Kroah-Hartman
2012-11-02 17:06 ` [ 08/24] floppy: properly handle failure on add_disk loop Greg Kroah-Hartman
2012-11-02 17:06 ` [ 09/24] rbd: reset BACKOFF if unable to re-queue Greg Kroah-Hartman
2012-11-02 17:06 ` [ 10/24] libceph: avoid NULL kref_put when osd reset races with alloc_msg Greg Kroah-Hartman
2012-11-02 17:06 ` [ 11/24] ceph: fix dentry reference leak in encode_fh() Greg Kroah-Hartman
2012-11-02 17:07 ` [ 12/24] ceph: Fix oops when handling mdsmap that decreases max_mds Greg Kroah-Hartman
2012-11-02 17:07 ` [ 13/24] libceph: check for invalid mapping Greg Kroah-Hartman
2012-11-02 17:07 ` [ 14/24] ceph: avoid 32-bit page index overflow Greg Kroah-Hartman
2012-11-02 17:07 ` [ 15/24] USB: mos7840: fix port-data memory leak Greg Kroah-Hartman
2012-11-02 17:07 ` [ 16/24] USB: iuu_phoenix: fix backported patches Greg Kroah-Hartman
2012-11-02 17:07 ` [ 17/24] USB: io_edgeport: remove unused variable Greg Kroah-Hartman
2012-11-02 17:07 ` [ 18/24] qla2xxx: Update target lookup session tables when a target session changes Greg Kroah-Hartman
2012-11-02 17:07 ` [ 19/24] target: reintroduce some obsolete SCSI-2 commands Greg Kroah-Hartman
2012-11-02 17:07 ` [ 20/24] target: Fix double-free of se_cmd in target_complete_tmr_failure Greg Kroah-Hartman
2012-11-02 17:07 ` [ 21/24] HID: microsoft: fix invalid rdesc for 3k kbd Greg Kroah-Hartman
2012-11-02 17:07 ` [ 22/24] drm/nouveau: silence modesetting spam on pre-gf8 chipsets Greg Kroah-Hartman
2012-11-02 17:07 ` [ 23/24] drm/nouveau: fix suspend/resume when in headless mode Greg Kroah-Hartman
2012-11-02 17:07 ` [ 24/24] drm/nouveau: headless mode by default if pci class != vga display Greg Kroah-Hartman
2012-11-05  7:37 ` [ 00/24] 3.6.6-stable review Zhi Yong Wu
2012-11-05  7:41   ` Greg Kroah-Hartman
2012-11-05  7:46     ` Zhi Yong Wu
2012-11-05  8:19       ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).