From fc3d6fe8ce70c1ee440bad32eeed0503566afd7f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 22 Jan 2014 11:50:20 -0800 Subject: [PATCH] 3.13-stable patches added patches: gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch --- ...writecount-during-gfs2_setattr_chown.patch | 59 +++++++++++++++++++ queue-3.13/series | 4 ++ ...ci_1032-fix-subdevice-type-flags-bug.patch | 33 +++++++++++ ...-incorrect-irq-passed-to-request_irq.patch | 32 ++++++++++ ...ult-of-memdup_user-for-user-chanlist.patch | 43 ++++++++++++++ 5 files changed, 171 insertions(+) create mode 100644 queue-3.13/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch create mode 100644 queue-3.13/series create mode 100644 queue-3.13/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch create mode 100644 queue-3.13/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch create mode 100644 queue-3.13/staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch diff --git a/queue-3.13/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch b/queue-3.13/gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch new file mode 100644 index 00000000000..df1f89d34ec --- /dev/null +++ b/queue-3.13/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 +@@ -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; + } + diff --git a/queue-3.13/series b/queue-3.13/series new file mode 100644 index 00000000000..184837a750c --- /dev/null +++ b/queue-3.13/series @@ -0,0 +1,4 @@ +gfs2-increase-i_writecount-during-gfs2_setattr_chown.patch +staging-comedi-fix-result-of-memdup_user-for-user-chanlist.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.13/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch b/queue-3.13/staging-comedi-addi_apci_1032-fix-subdevice-type-flags-bug.patch new file mode 100644 index 00000000000..d44ee4ddde3 --- /dev/null +++ b/queue-3.13/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 +@@ -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; diff --git a/queue-3.13/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch b/queue-3.13/staging-comedi-adl_pci9111-fix-incorrect-irq-passed-to-request_irq.patch new file mode 100644 index 00000000000..500a5971dda --- /dev/null +++ b/queue-3.13/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 +@@ -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; diff --git a/queue-3.13/staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch b/queue-3.13/staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch new file mode 100644 index 00000000000..517a73314bf --- /dev/null +++ b/queue-3.13/staging-comedi-fix-result-of-memdup_user-for-user-chanlist.patch @@ -0,0 +1,43 @@ +From e56b1401056288a725d50942ef300dcbed5e519a Mon Sep 17 00:00:00 2001 +From: Bernd Porr +Date: Wed, 11 Dec 2013 16:06:15 +0000 +Subject: staging: comedi: fix result of memdup_user for user chanlist + +From: Bernd Porr + +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 +Signed-off-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + } -- 2.47.2