stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.13 00/10] 3.13.1-stable review
@ 2014-01-27 20:17 Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 01/10] GFS2: Increase i_writecount during gfs2_setattr_chown Greg Kroah-Hartman
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, torvalds, akpm, stable

This is the start of the stable review cycle for the 3.13.1 release.
There are 10 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 Wed Jan 29 20:15:25 UTC 2014.
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.13.1-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.13.1-rc1

NeilBrown <neilb@suse.de>
    md/raid5: close recently introduced race in stripe_head management.

NeilBrown <neilb@suse.de>
    md/raid5: fix long-standing problem with bitmap handling on write failure.

David Henningsson <david.henningsson@canonical.com>
    ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense

Guenter Roeck <linux@roeck-us.net>
    extcon: gpio: Request gpio pin before modifying its state

Jon Medhurst <tixy@linaro.org>
    serial: amba-pl011: use port lock to guard control register access

Geert Uytterhoeven <geert@linux-m68k.org>
    mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL

H Hartley Sweeten <hsweeten@visionengravers.com>
    staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()

H Hartley Sweeten <hsweeten@visionengravers.com>
    staging: comedi: addi_apci_1032: fix subdevice type/flags bug

Bernd Porr <mail@berndporr.me.uk>
    staging: comedi: fix result of memdup_user for user chanlist

Bob Peterson <rpeterso@redhat.com>
    GFS2: Increase i_writecount during gfs2_setattr_chown


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

Diffstat:

 Makefile                                        |  4 ++--
 drivers/extcon/extcon-gpio.c                    | 11 ++++++-----
 drivers/md/raid5.c                              |  9 +++++----
 drivers/staging/comedi/comedi_fops.c            |  2 ++
 drivers/staging/comedi/drivers/addi_apci_1032.c |  4 ++--
 drivers/staging/comedi/drivers/adl_pci9111.c    |  2 +-
 drivers/tty/serial/amba-pl011.c                 |  6 ++++++
 fs/gfs2/inode.c                                 | 16 +++++++++++++++-
 include/linux/mm.h                              | 13 ++++++++-----
 sound/pci/hda/patch_hdmi.c                      |  6 +++++-
 10 files changed, 52 insertions(+), 21 deletions(-)



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

* [PATCH 3.13 01/10] GFS2: Increase i_writecount during gfs2_setattr_chown
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 02/10] staging: comedi: fix result of memdup_user for user chanlist Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Bob Peterson, Steven Whitehouse

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

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

From: Bob Peterson <rpeterso@redhat.com>

commit 62e96cf81988101fe9e086b2877307b6adda5197 upstream.

This patch calls get_write_access in function gfs2_setattr_chown,
which merely increases inode->i_writecount for the duration of the
function. That will ensure that any file closes won't delete the
inode's multi-block reservation while the function is running.
It also ensures that a multi-block reservation exists when needed
for quota change operations during the chown.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/gfs2/inode.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1607,10 +1607,22 @@ static int setattr_chown(struct inode *i
 	if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid))
 		ogid = ngid = NO_GID_QUOTA_CHANGE;
 
-	error = gfs2_quota_lock(ip, nuid, ngid);
+	error = get_write_access(inode);
 	if (error)
 		return error;
 
+	error = gfs2_rs_alloc(ip);
+	if (error)
+		goto out;
+
+	error = gfs2_rindex_update(sdp);
+	if (error)
+		goto out;
+
+	error = gfs2_quota_lock(ip, nuid, ngid);
+	if (error)
+		goto out;
+
 	if (!uid_eq(ouid, NO_UID_QUOTA_CHANGE) ||
 	    !gid_eq(ogid, NO_GID_QUOTA_CHANGE)) {
 		error = gfs2_quota_check(ip, nuid, ngid);
@@ -1637,6 +1649,8 @@ out_end_trans:
 	gfs2_trans_end(sdp);
 out_gunlock_q:
 	gfs2_quota_unlock(ip);
+out:
+	put_write_access(inode);
 	return error;
 }
 



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

* [PATCH 3.13 02/10] staging: comedi: fix result of memdup_user for user chanlist
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 01/10] GFS2: Increase i_writecount during gfs2_setattr_chown Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 03/10] staging: comedi: addi_apci_1032: fix subdevice type/flags bug Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Bernd Porr, Ian Abbott

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

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

From: Bernd Porr <mail@berndporr.me.uk>

commit e56b1401056288a725d50942ef300dcbed5e519a upstream.

If the channel list is not set in userspace we get an error at
PTR_ERR(async->cmd.chanlist). However, do_become_nonbusy(dev, s) cleans
up this pointer which causes a kernel ooops. Setting the channel list in
async to NULL and checking this in do_become_nonbusy prevents the oops.

[Ian Abbott] Also do the same for the chanlist allocated in
do_cmdtest_ioctl().

Signed-off-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/comedi_fops.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1425,6 +1425,7 @@ static int do_cmd_ioctl(struct comedi_de
 					  async->cmd.chanlist_len * sizeof(int));
 	if (IS_ERR(async->cmd.chanlist)) {
 		ret = PTR_ERR(async->cmd.chanlist);
+		async->cmd.chanlist = NULL;
 		DPRINTK("memdup_user failed with code %d\n", ret);
 		goto cleanup;
 	}
@@ -1547,6 +1548,7 @@ static int do_cmdtest_ioctl(struct comed
 				       cmd.chanlist_len * sizeof(int));
 		if (IS_ERR(chanlist)) {
 			ret = PTR_ERR(chanlist);
+			chanlist = NULL;
 			DPRINTK("memdup_user exited with code %d", ret);
 			goto cleanup;
 		}



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

* [PATCH 3.13 03/10] staging: comedi: addi_apci_1032: fix subdevice type/flags bug
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 01/10] GFS2: Increase i_writecount during gfs2_setattr_chown Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 02/10] staging: comedi: fix result of memdup_user for user chanlist Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 04/10] staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq() Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, H Hartley Sweeten, Ian Abbott

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

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

From: H Hartley Sweeten <hsweeten@visionengravers.com>

commit 90daf69a7a3f1d1a41018c799968a0bb896d65e0 upstream.

The SDF_CMD_READ should be one of the s->subdev_flags not part of
the s->type.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/drivers/addi_apci_1032.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -325,8 +325,8 @@ static int apci1032_auto_attach(struct c
 	s = &dev->subdevices[1];
 	if (dev->irq) {
 		dev->read_subdev = s;
-		s->type		= COMEDI_SUBD_DI | SDF_CMD_READ;
-		s->subdev_flags	= SDF_READABLE;
+		s->type		= COMEDI_SUBD_DI;
+		s->subdev_flags	= SDF_READABLE | SDF_CMD_READ;
 		s->n_chan	= 1;
 		s->maxdata	= 1;
 		s->range_table	= &range_digital;



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

* [PATCH 3.13 04/10] staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 03/10] staging: comedi: addi_apci_1032: fix subdevice type/flags bug Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 05/10] mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, H Hartley Sweeten, Ian Abbott

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

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

From: H Hartley Sweeten <hsweeten@visionengravers.com>

commit 48108fe3daa0d142f9b97178fdb23704ea3a407b upstream.

The dev->irq passed to request_irq() will always be 0 when the auto_attach
function is called. The pcidev->irq should be used instead to get the correct
irq number.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/drivers/adl_pci9111.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -859,7 +859,7 @@ static int pci9111_auto_attach(struct co
 	pci9111_reset(dev);
 
 	if (pcidev->irq > 0) {
-		ret = request_irq(dev->irq, pci9111_interrupt,
+		ret = request_irq(pcidev->irq, pci9111_interrupt,
 				  IRQF_SHARED, dev->board_name, dev);
 		if (ret)
 			return ret;



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

* [PATCH 3.13 05/10] mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 04/10] staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq() Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 06/10] serial: amba-pl011: use port lock to guard control register access Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Geert Uytterhoeven,
	Michael S. Tsirkin, Guenter Roeck, David Rientjes, Andrew Morton,
	Linus Torvalds

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

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

From: Geert Uytterhoeven <geert@linux-m68k.org>

commit f92f455f67fef27929e6043499414605b0c94872 upstream.

{,set}page_address() are macros if WANT_PAGE_VIRTUAL.  If
!WANT_PAGE_VIRTUAL, they're plain C functions.

If someone calls them with a void *, this pointer is auto-converted to
struct page * if !WANT_PAGE_VIRTUAL, but causes a build failure on
architectures using WANT_PAGE_VIRTUAL (arc, m68k and sparc64):

  drivers/md/bcache/bset.c: In function `__btree_sort':
  drivers/md/bcache/bset.c:1190: warning: dereferencing `void *' pointer
  drivers/md/bcache/bset.c:1190: error: request for member `virtual' in something not a structure or union

Convert them to static inline functions to fix this.  There are already
plenty of users of struct page members inside <linux/mm.h>, so there's
no reason to keep them as macros.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/mm.h |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -846,11 +846,14 @@ static __always_inline void *lowmem_page
 #endif
 
 #if defined(WANT_PAGE_VIRTUAL)
-#define page_address(page) ((page)->virtual)
-#define set_page_address(page, address)			\
-	do {						\
-		(page)->virtual = (address);		\
-	} while(0)
+static inline void *page_address(const struct page *page)
+{
+	return page->virtual;
+}
+static inline void set_page_address(struct page *page, void *address)
+{
+	page->virtual = address;
+}
 #define page_address_init()  do { } while(0)
 #endif
 



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

* [PATCH 3.13 06/10] serial: amba-pl011: use port lock to guard control register access
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 05/10] mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 07/10] extcon: gpio: Request gpio pin before modifying its state Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jon Medhurst

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

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

From: Jon Medhurst <tixy@linaro.org>

commit fe43390702a1b5741fdf217063b05c7612b38303 upstream.

When the pl011 is being used for a console, pl011_console_write forces
the control register (CR) to enable the UART for transmission and then
restores this to the original value afterwards. It does this while
holding the port lock.

Unfortunately, when the uart is started or shutdown - say in response to
userland using the serial device for a terminal - then this updates the
control register without any locking.

This means we can have

  pl011_console_write   Save CR
  pl011_startup         Initialise CR, e.g. enable receive
  pl011_console_write   Restore old CR with receive not enabled

this result is a serial port which doesn't respond to any input.

A similar race in reverse could happen when the device is shutdown.

We can fix these problems by taking the port lock when updating CR.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/tty/serial/amba-pl011.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1537,6 +1537,8 @@ static int pl011_startup(struct uart_por
 	/*
 	 * Provoke TX FIFO interrupt into asserting.
 	 */
+	spin_lock_irq(&uap->port.lock);
+
 	cr = UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_LBE;
 	writew(cr, uap->port.membase + UART011_CR);
 	writew(0, uap->port.membase + UART011_FBRD);
@@ -1561,6 +1563,8 @@ static int pl011_startup(struct uart_por
 	cr |= UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE;
 	writew(cr, uap->port.membase + UART011_CR);
 
+	spin_unlock_irq(&uap->port.lock);
+
 	/*
 	 * initialise the old status of the modem signals
 	 */
@@ -1629,11 +1633,13 @@ static void pl011_shutdown(struct uart_p
 	 * it during startup().
 	 */
 	uap->autorts = false;
+	spin_lock_irq(&uap->port.lock);
 	cr = readw(uap->port.membase + UART011_CR);
 	uap->old_cr = cr;
 	cr &= UART011_CR_RTS | UART011_CR_DTR;
 	cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
 	writew(cr, uap->port.membase + UART011_CR);
+	spin_unlock_irq(&uap->port.lock);
 
 	/*
 	 * disable break condition and fifos



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

* [PATCH 3.13 07/10] extcon: gpio: Request gpio pin before modifying its state
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 06/10] serial: amba-pl011: use port lock to guard control register access Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 08/10] ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Guenter Roeck, MyungJoo Ham,
	Chanwoo Choi

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

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

From: Guenter Roeck <linux@roeck-us.net>

commit 4288d9b8edcec7289e00eecdad44f14c9ea1ba0e upstream.

Commit 338de0ca (extcon: gpio: Use gpio driver/chip debounce if supported)
introduced a call to gpio_set_debounce() before actually requesting the
respective gpio pin from the gpio subsystem.

The gpio subsystem expects that a gpio pin was requested before modifying its
state. Not doing so results in a warning from gpiolib, and the gpio pin is
auto-requested. This in turn causes the subsequent devm_gpio_request_one()
to fail. So devm_gpio_request_one() must be called prior to calling
gpio_set_debounce().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/extcon/extcon-gpio.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -105,6 +105,12 @@ static int gpio_extcon_probe(struct plat
 	extcon_data->state_off = pdata->state_off;
 	if (pdata->state_on && pdata->state_off)
 		extcon_data->edev.print_state = extcon_gpio_print_state;
+
+	ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN,
+				    pdev->name);
+	if (ret < 0)
+		return ret;
+
 	if (pdata->debounce) {
 		ret = gpio_set_debounce(extcon_data->gpio,
 					pdata->debounce * 1000);
@@ -117,11 +123,6 @@ static int gpio_extcon_probe(struct plat
 	if (ret < 0)
 		return ret;
 
-	ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN,
-				    pdev->name);
-	if (ret < 0)
-		goto err;
-
 	INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work);
 
 	extcon_data->irq = gpio_to_irq(extcon_data->gpio);



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

* [PATCH 3.13 08/10] ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 07/10] extcon: gpio: Request gpio pin before modifying its state Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 09/10] md/raid5: fix long-standing problem with bitmap handling on write failure Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, David Henningsson, Takashi Iwai

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

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

From: David Henningsson <david.henningsson@canonical.com>

commit da4a7a3926d09c13ae052ede67feb7285e01e3f5 upstream.

This should help us avoid the following mutex deadlock:

[] mutex_lock+0x2a/0x50
[] hdmi_present_sense+0x53/0x3a0 [snd_hda_codec_hdmi]
[] generic_hdmi_resume+0x5a/0x70 [snd_hda_codec_hdmi]
[] hda_call_codec_resume+0xec/0x1d0 [snd_hda_codec]
[] snd_hda_power_save+0x1e4/0x280 [snd_hda_codec]
[] codec_exec_verb+0x5f/0x290 [snd_hda_codec]
[] snd_hda_codec_read+0x5b/0x90 [snd_hda_codec]
[] snd_hdmi_get_eld_size+0x1e/0x20 [snd_hda_codec_hdmi]
[] snd_hdmi_get_eld+0x2c/0xd0 [snd_hda_codec_hdmi]
[] hdmi_present_sense+0x9a/0x3a0 [snd_hda_codec_hdmi]
[] hdmi_repoll_eld+0x34/0x50 [snd_hda_codec_hdmi]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Fixes: cbbaa603a03c ('ALSA: hda - Fix possible races in HDMI driver')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/patch_hdmi.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1496,11 +1496,14 @@ static bool hdmi_present_sense(struct hd
 	 * specification worked this way. Hence, we just ignore the data in
 	 * the unsolicited response to avoid custom WARs.
 	 */
-	int present = snd_hda_pin_sense(codec, pin_nid);
+	int present;
 	bool update_eld = false;
 	bool eld_changed = false;
 	bool ret;
 
+	snd_hda_power_up(codec);
+	present = snd_hda_pin_sense(codec, pin_nid);
+
 	mutex_lock(&per_pin->lock);
 	pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
 	if (pin_eld->monitor_present)
@@ -1573,6 +1576,7 @@ static bool hdmi_present_sense(struct hd
 		jack->block_report = !ret;
 
 	mutex_unlock(&per_pin->lock);
+	snd_hda_power_down(codec);
 	return ret;
 }
 



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

* [PATCH 3.13 09/10] md/raid5: fix long-standing problem with bitmap handling on write failure.
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 08/10] ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-27 20:17 ` [PATCH 3.13 10/10] md/raid5: close recently introduced race in stripe_head management Greg Kroah-Hartman
  2014-01-28 17:41 ` [PATCH 3.13 00/10] 3.13.1-stable review Shuah Khan
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ethan Wilson, NeilBrown

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

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

From: NeilBrown <neilb@suse.de>

commit 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 upstream.

Before a write starts we set a bit in the write-intent bitmap.
When the write completes we clear that bit if the write was successful
to all devices.  However if the write wasn't fully successful we
should not clear the bit.  If the faulty drive is subsequently
re-added, the fact that the bit is still set ensure that we will
re-write the data that is missing.

This logic is mediated by the STRIPE_DEGRADED flag - we only clear the
bitmap bit when this flag is not set.
Currently we correctly set the flag if a write starts when some
devices are failed or missing.  But we do *not* set the flag if some
device failed during the write attempt.
This is wrong and can result in clearing the bit inappropriately.

So: set the flag when a write fails.

This bug has been present since bitmaps were introduces, so the fix is
suitable for any -stable kernel.

Reported-by: Ethan Wilson <ethan.wilson@shiftmail.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/raid5.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2111,6 +2111,7 @@ static void raid5_end_write_request(stru
 			set_bit(R5_MadeGoodRepl, &sh->dev[i].flags);
 	} else {
 		if (!uptodate) {
+			set_bit(STRIPE_DEGRADED, &sh->state);
 			set_bit(WriteErrorSeen, &rdev->flags);
 			set_bit(R5_WriteError, &sh->dev[i].flags);
 			if (!test_and_set_bit(WantReplacement, &rdev->flags))



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

* [PATCH 3.13 10/10] md/raid5: close recently introduced race in stripe_head management.
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 09/10] md/raid5: fix long-standing problem with bitmap handling on write failure Greg Kroah-Hartman
@ 2014-01-27 20:17 ` Greg Kroah-Hartman
  2014-01-28 17:41 ` [PATCH 3.13 00/10] 3.13.1-stable review Shuah Khan
  10 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-27 20:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, NeilBrown

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

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

From: NeilBrown <neilb@suse.de>

commit 7da9d450ab2843bf1db378c156acc6304dbc1c2b upstream.

As release_stripe and __release_stripe decrement ->count and then
manipulate ->lru both under ->device_lock, it is important that
get_active_stripe() increments ->count and clears ->lru also under
->device_lock.

However we currently list_del_init ->lru under the lock, but increment
the ->count outside the lock.  This can lead to races and list
corruption.

So move the atomic_inc(&sh->count) up inside the ->device_lock
protected region.

Note that we still increment ->count without device lock in the case
where get_free_stripe() was called, and in fact don't take
->device_lock at all in that path.
This is safe because if the stripe_head can be found by
get_free_stripe, then the hash lock assures us the no-one else could
possibly be calling release_stripe() at the same time.

Fixes: 566c09c53455d7c4f1130928ef8071da1a24ea65
Reported-and-tested-by: Ian Kumlien <ian.kumlien@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/raid5.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -675,8 +675,10 @@ get_active_stripe(struct r5conf *conf, s
 					 || !conf->inactive_blocked),
 					*(conf->hash_locks + hash));
 				conf->inactive_blocked = 0;
-			} else
+			} else {
 				init_stripe(sh, sector, previous);
+				atomic_inc(&sh->count);
+			}
 		} else {
 			spin_lock(&conf->device_lock);
 			if (atomic_read(&sh->count)) {
@@ -695,13 +697,11 @@ get_active_stripe(struct r5conf *conf, s
 					sh->group = NULL;
 				}
 			}
+			atomic_inc(&sh->count);
 			spin_unlock(&conf->device_lock);
 		}
 	} while (sh == NULL);
 
-	if (sh)
-		atomic_inc(&sh->count);
-
 	spin_unlock_irq(conf->hash_locks + hash);
 	return sh;
 }



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

* Re: [PATCH 3.13 00/10] 3.13.1-stable review
  2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2014-01-27 20:17 ` [PATCH 3.13 10/10] md/raid5: close recently introduced race in stripe_head management Greg Kroah-Hartman
@ 2014-01-28 17:41 ` Shuah Khan
  2014-01-29 13:05   ` Greg Kroah-Hartman
  10 siblings, 1 reply; 13+ messages in thread
From: Shuah Khan @ 2014-01-28 17:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, stable, Shuah Khan, shuahkhan@gmail.com

On 01/27/2014 01:17 PM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.13.1 release.
> There are 10 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 Wed Jan 29 20:15:25 UTC 2014.
> 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.13.1-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Patch testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passed - no regressions in emerg, crit, 
alert, err are clean. No regressions in warn.

-- Shuah


-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

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

* Re: [PATCH 3.13 00/10] 3.13.1-stable review
  2014-01-28 17:41 ` [PATCH 3.13 00/10] 3.13.1-stable review Shuah Khan
@ 2014-01-29 13:05   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-29 13:05 UTC (permalink / raw)
  To: Shuah Khan; +Cc: linux-kernel, torvalds, akpm, stable, shuahkhan@gmail.com

On Tue, Jan 28, 2014 at 10:41:35AM -0700, Shuah Khan wrote:
> On 01/27/2014 01:17 PM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 3.13.1 release.
> > There are 10 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 Wed Jan 29 20:15:25 UTC 2014.
> > 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.13.1-rc1.gz
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
> >
> 
> Patch testing - passed
> Compile testing - passed
> Boot testing - passed
> dmesg regression testing - passed - no regressions in emerg, crit, 
> alert, err are clean. No regressions in warn.

Wonderful, thanks for testing.

greg k-h

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

end of thread, other threads:[~2014-01-29 13:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 20:17 [PATCH 3.13 00/10] 3.13.1-stable review Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 01/10] GFS2: Increase i_writecount during gfs2_setattr_chown Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 02/10] staging: comedi: fix result of memdup_user for user chanlist Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 03/10] staging: comedi: addi_apci_1032: fix subdevice type/flags bug Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 04/10] staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq() Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 05/10] mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 06/10] serial: amba-pl011: use port lock to guard control register access Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 07/10] extcon: gpio: Request gpio pin before modifying its state Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 08/10] ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 09/10] md/raid5: fix long-standing problem with bitmap handling on write failure Greg Kroah-Hartman
2014-01-27 20:17 ` [PATCH 3.13 10/10] md/raid5: close recently introduced race in stripe_head management Greg Kroah-Hartman
2014-01-28 17:41 ` [PATCH 3.13 00/10] 3.13.1-stable review Shuah Khan
2014-01-29 13:05   ` Greg Kroah-Hartman

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).