diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-14 17:16:21 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-14 17:16:21 -0800 |
commit | 365cb646ec708cb5732aa690873ec054b2e2348b (patch) | |
tree | 4f76e9d0988d50b8f75c6cb0284766167fccc84c | |
parent | 9c46ffbf91fdc6f59d37de200d1fd11fd7e8f010 (diff) | |
download | longterm-queue-2.6.33-365cb646ec708cb5732aa690873ec054b2e2348b.tar.gz |
.33 patches
-rw-r--r-- | queue-2.6.33/nfs-fix-kernel-bug-at-fs-aio.c-554.patch | 103 | ||||
-rw-r--r-- | queue-2.6.33/rtc-cmos-fix-suspend-resume.patch | 97 | ||||
-rw-r--r-- | queue-2.6.33/series | 2 |
3 files changed, 202 insertions, 0 deletions
diff --git a/queue-2.6.33/nfs-fix-kernel-bug-at-fs-aio.c-554.patch b/queue-2.6.33/nfs-fix-kernel-bug-at-fs-aio.c-554.patch new file mode 100644 index 0000000..6b3e306 --- /dev/null +++ b/queue-2.6.33/nfs-fix-kernel-bug-at-fs-aio.c-554.patch @@ -0,0 +1,103 @@ +From 839f7ad6932d95f4d5ae7267b95c574714ff3d5b Mon Sep 17 00:00:00 2001 +From: Chuck Lever <chuck.lever@oracle.com> +Date: Fri, 21 Jan 2011 15:54:57 +0000 +Subject: NFS: Fix "kernel BUG at fs/aio.c:554!" + +From: Chuck Lever <chuck.lever@oracle.com> + +commit 839f7ad6932d95f4d5ae7267b95c574714ff3d5b upstream. + +Nick Piggin reports: + +> I'm getting use after frees in aio code in NFS +> +> [ 2703.396766] Call Trace: +> [ 2703.396858] [<ffffffff8100b057>] ? native_sched_clock+0x27/0x80 +> [ 2703.396959] [<ffffffff8108509e>] ? put_lock_stats+0xe/0x40 +> [ 2703.397058] [<ffffffff81088348>] ? lock_release_holdtime+0xa8/0x140 +> [ 2703.397159] [<ffffffff8108a2a5>] lock_acquire+0x95/0x1b0 +> [ 2703.397260] [<ffffffff811627db>] ? aio_put_req+0x2b/0x60 +> [ 2703.397361] [<ffffffff81039701>] ? get_parent_ip+0x11/0x50 +> [ 2703.397464] [<ffffffff81612a31>] _raw_spin_lock_irq+0x41/0x80 +> [ 2703.397564] [<ffffffff811627db>] ? aio_put_req+0x2b/0x60 +> [ 2703.397662] [<ffffffff811627db>] aio_put_req+0x2b/0x60 +> [ 2703.397761] [<ffffffff811647fe>] do_io_submit+0x2be/0x7c0 +> [ 2703.397895] [<ffffffff81164d0b>] sys_io_submit+0xb/0x10 +> [ 2703.397995] [<ffffffff8100307b>] system_call_fastpath+0x16/0x1b +> +> Adding some tracing, it is due to nfs completing the request then +> returning something other than -EIOCBQUEUED, so aio.c +> also completes the request. + +To address this, prevent the NFS direct I/O engine from completing +async iocbs when the forward path returns an error without starting +any I/O. + +This fix appears to survive ^C during both "xfstest no. 208" and "fsx +-Z." + +It's likely this bug has existed for a very long while, as we are seeing +very similar symptoms in OEL 5. Copying stable. + +Signed-off-by: Chuck Lever <chuck.lever@oracle.com> +Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + fs/nfs/direct.c | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +--- a/fs/nfs/direct.c ++++ b/fs/nfs/direct.c +@@ -401,15 +401,18 @@ static ssize_t nfs_direct_read_schedule_ + pos += vec->iov_len; + } + ++ /* ++ * If no bytes were started, return the error, and let the ++ * generic layer handle the completion. ++ */ ++ if (requested_bytes == 0) { ++ nfs_direct_req_release(dreq); ++ return result < 0 ? result : -EIO; ++ } ++ + if (put_dreq(dreq)) + nfs_direct_complete(dreq); +- +- if (requested_bytes != 0) +- return 0; +- +- if (result < 0) +- return result; +- return -EIO; ++ return 0; + } + + static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, +@@ -829,15 +832,18 @@ static ssize_t nfs_direct_write_schedule + pos += vec->iov_len; + } + ++ /* ++ * If no bytes were started, return the error, and let the ++ * generic layer handle the completion. ++ */ ++ if (requested_bytes == 0) { ++ nfs_direct_req_release(dreq); ++ return result < 0 ? result : -EIO; ++ } ++ + if (put_dreq(dreq)) + nfs_direct_write_complete(dreq, dreq->inode); +- +- if (requested_bytes != 0) +- return 0; +- +- if (result < 0) +- return result; +- return -EIO; ++ return 0; + } + + static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, diff --git a/queue-2.6.33/rtc-cmos-fix-suspend-resume.patch b/queue-2.6.33/rtc-cmos-fix-suspend-resume.patch new file mode 100644 index 0000000..f5d52c9 --- /dev/null +++ b/queue-2.6.33/rtc-cmos-fix-suspend-resume.patch @@ -0,0 +1,97 @@ +From 2fb08e6ca9f00d1aedb3964983e9c8f84b36b807 Mon Sep 17 00:00:00 2001 +From: Paul Fox <pgf@laptop.org> +Date: Wed, 12 Jan 2011 17:00:07 -0800 +Subject: rtc-cmos: fix suspend/resume + +From: Paul Fox <pgf@laptop.org> + +commit 2fb08e6ca9f00d1aedb3964983e9c8f84b36b807 upstream. + +rtc-cmos was setting suspend/resume hooks at the device_driver level. +However, the platform bus code (drivers/base/platform.c) only looks for +resume hooks at the dev_pm_ops level, or within the platform_driver. + +Switch rtc_cmos to use dev_pm_ops so that suspend/resume code is executed +again. + +Paul said: + +: The user visible symptom in our (XO laptop) case was that rtcwake would +: fail to wake the laptop. The RTC alarm would expire, but the wakeup +: wasn't unmasked. +: +: As for severity, the impact may have been reduced because if I recall +: correctly, the bug only affected platforms with CONFIG_PNP disabled. + +Signed-off-by: Paul Fox <pgf@laptop.org> +Signed-off-by: Daniel Drake <dsd@laptop.org> +Acked-by: Rafael J. Wysocki <rjw@sisk.pl> +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@suse.de> + +--- + drivers/rtc/rtc-cmos.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/rtc/rtc-cmos.c ++++ b/drivers/rtc/rtc-cmos.c +@@ -36,6 +36,7 @@ + #include <linux/platform_device.h> + #include <linux/mod_devicetable.h> + #include <linux/log2.h> ++#include <linux/pm.h> + + /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ + #include <asm-generic/rtc.h> +@@ -851,7 +852,7 @@ static void __exit cmos_do_remove(struct + + #ifdef CONFIG_PM + +-static int cmos_suspend(struct device *dev, pm_message_t mesg) ++static int cmos_suspend(struct device *dev) + { + struct cmos_rtc *cmos = dev_get_drvdata(dev); + unsigned char tmp; +@@ -899,7 +900,7 @@ static int cmos_suspend(struct device *d + */ + static inline int cmos_poweroff(struct device *dev) + { +- return cmos_suspend(dev, PMSG_HIBERNATE); ++ return cmos_suspend(dev); + } + + static int cmos_resume(struct device *dev) +@@ -946,9 +947,9 @@ static int cmos_resume(struct device *de + return 0; + } + ++static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume); ++ + #else +-#define cmos_suspend NULL +-#define cmos_resume NULL + + static inline int cmos_poweroff(struct device *dev) + { +@@ -1084,7 +1085,7 @@ static void __exit cmos_pnp_remove(struc + + static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg) + { +- return cmos_suspend(&pnp->dev, mesg); ++ return cmos_suspend(&pnp->dev); + } + + static int cmos_pnp_resume(struct pnp_dev *pnp) +@@ -1164,8 +1165,9 @@ static struct platform_driver cmos_platf + .shutdown = cmos_platform_shutdown, + .driver = { + .name = (char *) driver_name, +- .suspend = cmos_suspend, +- .resume = cmos_resume, ++#ifdef CONFIG_PM ++ .pm = &cmos_pm_ops, ++#endif + } + }; + diff --git a/queue-2.6.33/series b/queue-2.6.33/series index d0c3b5f..0d4bf00 100644 --- a/queue-2.6.33/series +++ b/queue-2.6.33/series @@ -291,3 +291,5 @@ input-bcm5974-add-support-for-macbookair3.patch alsa-hrtimer-handle-delayed-timer-interrupts.patch asoc-wm8990-msleep-takes-milliseconds-not-jiffies.patch asoc-blackfin-ac97-fix-build-error-after-multi-component-update.patch +nfs-fix-kernel-bug-at-fs-aio.c-554.patch +rtc-cmos-fix-suspend-resume.patch |