Skip to contentSkip to conversation

3.13.1-stable review

PATCH In review Greg Kroah-Hartman 2 participants 13 messages Jan 27, 2014 – Jan 29, 2014 Stable branch

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 3.13.1-stable review

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 <[email protected]>

    Linux 3.13.1-rc1

NeilBrown <[email protected]>
md/raid5: close recently introduced race in stripe_head management.

NeilBrown <[email protected]>
md/raid5: fix long-standing problem with bitmap handling on write failure.

David Henningsson <[email protected]>
ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense

Guenter Roeck <[email protected]>
extcon: gpio: Request gpio pin before modifying its state

Jon Medhurst <[email protected]>
serial: amba-pl011: use port lock to guard control register access

Geert Uytterhoeven <[email protected]>
mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL

H Hartley Sweeten <[email protected]>
staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()

H Hartley Sweeten <[email protected]>
staging: comedi: addi_apci_1032: fix subdevice type/flags bug

Bernd Porr <[email protected]>
staging: comedi: fix result of memdup_user for user chanlist

Bob Peterson <[email protected]>
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(-)
author maintainer
#1 lore raw

PATCH 1/10 GFS2: Increase i_writecount during gfs2_setattr_chown

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

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

From: Bob Peterson <[email protected]>

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.

---
 fs/gfs2/inode.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
fs/gfs2/inode.c +15 -1
@@ -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;
 }
 
author maintainer
#2 lore raw

PATCH 2/10 staging: comedi: fix result of memdup_user for user chanlist

In reply to Greg Kroah-Hartman

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

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

From: Bernd Porr <[email protected]>

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

---
 drivers/staging/comedi/comedi_fops.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/staging/comedi/comedi_fops.c +2 -0
@@ -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;
 		}
author maintainer
#3 lore raw

PATCH 3/10 staging: comedi: addi_apci_1032: fix subdevice type/flags bug

In reply to Greg Kroah-Hartman

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

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

From: H Hartley Sweeten <[email protected]>

commit 90daf69a7a3f1d1a41018c799968a0bb896d65e0 upstream.

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

---
 drivers/staging/comedi/drivers/addi_apci_1032.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/addi_apci_1032.c +2 -2
@@ -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;
author maintainer
#4 lore raw

PATCH 4/10 staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()

In reply to Greg Kroah-Hartman

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

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

From: H Hartley Sweeten <[email protected]>

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.

---
 drivers/staging/comedi/drivers/adl_pci9111.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/adl_pci9111.c +1 -1
@@ -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;
author maintainer
#5 lore raw

PATCH 5/10 mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

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.

---
 include/linux/mm.h |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
include/linux/mm.h +8 -5
@@ -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
 
author maintainer
#6 lore raw

PATCH 6/10 serial: amba-pl011: use port lock to guard control register access

In reply to Greg Kroah-Hartman

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

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

From: Jon Medhurst <[email protected]>

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.

---
 drivers/tty/serial/amba-pl011.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/tty/serial/amba-pl011.c +6 -0
@@ -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
author maintainer
#7 lore raw

PATCH 7/10 extcon: gpio: Request gpio pin before modifying its state

In reply to Greg Kroah-Hartman

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

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

From: Guenter Roeck <[email protected]>

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

---
 drivers/extcon/extcon-gpio.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/extcon/extcon-gpio.c +6 -5
@@ -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);
author maintainer
#8 lore raw

PATCH 8/10 ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense

In reply to Greg Kroah-Hartman

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

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

From: David Henningsson <[email protected]>

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]

Fixes cbbaa603a03c ('ALSA: hda - Fix possible races in HDMI driver')
---
 sound/pci/hda/patch_hdmi.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
sound/pci/hda/patch_hdmi.c +5 -1
@@ -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;
 }
 
author maintainer
#9 lore raw

PATCH 9/10 md/raid5: fix long-standing problem with bitmap handling on write failure.

In reply to Greg Kroah-Hartman

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

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

From: NeilBrown <[email protected]>

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.

---
 drivers/md/raid5.c |    1 +
 1 file changed, 1 insertion(+)
drivers/md/raid5.c +1 -0
@@ -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))
author maintainer
#10 lore raw

PATCH 10/10 md/raid5: close recently introduced race in stripe_head management.

In reply to Greg Kroah-Hartman

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

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

From: NeilBrown <[email protected]>

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 <[email protected]>
---
 drivers/md/raid5.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/md/raid5.c +4 -4
@@ -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;
 }
#11 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

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.

Quoted 8 lines

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

Signature · 4 lines
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
[email protected] | (970) 672-0658
author maintainer
#12 lore raw
Quoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman

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,

Quoted 8 lines
Quoted 2 lines

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