From: Greg Kroah-Hartman Date: Wed, 22 Jan 2014 19:50:09 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.10.28~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e97f8f7ed259d831225e7c1ba41b449a1f10a9c8;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch mm-memory-failure.c-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch --- diff --git a/queue-3.10/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch b/queue-3.10/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch new file mode 100644 index 00000000000..f5183ab1c9e --- /dev/null +++ b/queue-3.10/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch @@ -0,0 +1,59 @@ +From 62e96cf81988101fe9e086b2877307b6adda5197 Mon Sep 17 00:00:00 2001 +From: Bob Peterson +Date: Mon, 6 Jan 2014 17:16:01 -0500 +Subject: GFS2: Increase i_writecount during gfs2_setattr_chown + +From: Bob Peterson + +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 +Signed-off-by: Steven Whitehouse +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/inode.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +--- a/fs/gfs2/inode.c ++++ b/fs/gfs2/inode.c +@@ -1536,10 +1536,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); +@@ -1566,6 +1578,8 @@ out_end_trans: + gfs2_trans_end(sdp); + out_gunlock_q: + gfs2_quota_unlock(ip); ++out: ++ put_write_access(inode); + return error; + } + diff --git a/queue-3.10/mm-memory-failure.c-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch b/queue-3.10/mm-memory-failure.c-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch new file mode 100644 index 00000000000..ef4af4324df --- /dev/null +++ b/queue-3.10/mm-memory-failure.c-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch @@ -0,0 +1,58 @@ +From a49ecbcd7b0d5a1cda7d60e03df402dd0ef76ac8 Mon Sep 17 00:00:00 2001 +From: Jianguo Wu +Date: Wed, 18 Dec 2013 17:08:54 -0800 +Subject: mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully + +From: Jianguo Wu + +commit a49ecbcd7b0d5a1cda7d60e03df402dd0ef76ac8 upstream. + +After a successful hugetlb page migration by soft offline, the source +page will either be freed into hugepage_freelists or buddy(over-commit +page). If page is in buddy, page_hstate(page) will be NULL. It will +hit a NULL pointer dereference in dequeue_hwpoisoned_huge_page(). + + BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 + IP: [] dequeue_hwpoisoned_huge_page+0x131/0x1d0 + PGD c23762067 PUD c24be2067 PMD 0 + Oops: 0000 [#1] SMP + +So check PageHuge(page) after call migrate_pages() successfully. + +[wujg: backport to 3.10: + - adjust context] + +Signed-off-by: Jianguo Wu +Tested-by: Naoya Horiguchi +Reviewed-by: Naoya Horiguchi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/memory-failure.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/mm/memory-failure.c ++++ b/mm/memory-failure.c +@@ -1499,10 +1499,16 @@ static int soft_offline_huge_page(struct + pr_info("soft offline: %#lx: migration failed %d, type %lx\n", + pfn, ret, page->flags); + } else { +- set_page_hwpoison_huge_page(hpage); +- dequeue_hwpoisoned_huge_page(hpage); +- atomic_long_add(1 << compound_trans_order(hpage), +- &num_poisoned_pages); ++ /* overcommit hugetlb page will be freed to buddy */ ++ if (PageHuge(page)) { ++ set_page_hwpoison_huge_page(hpage); ++ dequeue_hwpoisoned_huge_page(hpage); ++ atomic_long_add(1 << compound_order(hpage), ++ &num_poisoned_pages); ++ } else { ++ SetPageHWPoison(page); ++ atomic_long_inc(&num_poisoned_pages); ++ } + } + /* keep elevated page count for bad page */ + return ret; diff --git a/queue-3.10/series b/queue-3.10/series index 0fcff209c85..c8f6aed9600 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -1,3 +1,7 @@ arm-7815-1-kexec-offline-non-panic-cpus-on-kdump-panic.patch perf-scripting-perl-fix-build-error-on-fedora-12.patch perf-x86-amd-ibs-fix-waking-up-from-s3-for-amd-family-10h.patch +gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch +mm-memory-failure.c-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch +staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch +staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch diff --git a/queue-3.10/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch b/queue-3.10/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch new file mode 100644 index 00000000000..cf9a2b9fb38 --- /dev/null +++ b/queue-3.10/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch @@ -0,0 +1,33 @@ +From 90daf69a7a3f1d1a41018c799968a0bb896d65e0 Mon Sep 17 00:00:00 2001 +From: H Hartley Sweeten +Date: Mon, 9 Dec 2013 16:06:41 -0700 +Subject: staging: comedi: addi_apci_1032: fix subdevice type/flags bug + +From: H Hartley Sweeten + +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 +Reviewed-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -332,8 +332,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; diff --git a/queue-3.10/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch b/queue-3.10/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch new file mode 100644 index 00000000000..dfd8fb787cb --- /dev/null +++ b/queue-3.10/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch @@ -0,0 +1,32 @@ +From 48108fe3daa0d142f9b97178fdb23704ea3a407b Mon Sep 17 00:00:00 2001 +From: H Hartley Sweeten +Date: Thu, 5 Dec 2013 13:43:28 -0700 +Subject: staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq() + +From: H Hartley Sweeten + +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 +Reviewed-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -873,7 +873,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;