From: Greg Kroah-Hartman Date: Thu, 19 Jul 2012 20:55:57 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.4.7~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bda5cbc7b9d35533ca682391f1f5b3a70be0b40;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: cifs-always-update-the-inode-cache-with-the-results-from-a-find_.patch mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch ntp-fix-sta_ins-del-clearing-bug.patch --- diff --git a/queue-3.0/cifs-always-update-the-inode-cache-with-the-results-from-a-find_.patch b/queue-3.0/cifs-always-update-the-inode-cache-with-the-results-from-a-find_.patch new file mode 100644 index 00000000000..45bbe231144 --- /dev/null +++ b/queue-3.0/cifs-always-update-the-inode-cache-with-the-results-from-a-find_.patch @@ -0,0 +1,44 @@ +From cd60042cc1392e79410dc8de9e9c1abb38a29e57 Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Fri, 6 Jul 2012 07:09:42 -0400 +Subject: cifs: always update the inode cache with the results from a FIND_* + +From: Jeff Layton + +commit cd60042cc1392e79410dc8de9e9c1abb38a29e57 upstream. + +When we get back a FIND_FIRST/NEXT result, we have some info about the +dentry that we use to instantiate a new inode. We were ignoring and +discarding that info when we had an existing dentry in the cache. + +Fix this by updating the inode in place when we find an existing dentry +and the uniqueid is the same. + +Reported-and-Tested-by: Andrew Bartlett +Reported-by: Bill Robertson +Reported-by: Dion Edwards +Signed-off-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/readdir.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/fs/cifs/readdir.c ++++ b/fs/cifs/readdir.c +@@ -85,9 +85,12 @@ cifs_readdir_lookup(struct dentry *paren + + dentry = d_lookup(parent, name); + if (dentry) { +- /* FIXME: check for inode number changes? */ +- if (dentry->d_inode != NULL) ++ inode = dentry->d_inode; ++ /* update inode in place if i_ino didn't change */ ++ if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { ++ cifs_fattr_to_inode(inode, fattr); + return dentry; ++ } + d_drop(dentry); + dput(dentry); + } diff --git a/queue-3.0/mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch b/queue-3.0/mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch new file mode 100644 index 00000000000..867fcc5253e --- /dev/null +++ b/queue-3.0/mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch @@ -0,0 +1,82 @@ +From 1c7e7f6c0703d03af6bcd5ccc11fc15d23e5ecbe Mon Sep 17 00:00:00 2001 +From: Aaditya Kumar +Date: Tue, 17 Jul 2012 15:48:07 -0700 +Subject: mm: fix lost kswapd wakeup in kswapd_stop() + +From: Aaditya Kumar + +commit 1c7e7f6c0703d03af6bcd5ccc11fc15d23e5ecbe upstream. + +Offlining memory may block forever, waiting for kswapd() to wake up +because kswapd() does not check the event kthread->should_stop before +sleeping. + +The proper pattern, from Documentation/memory-barriers.txt, is: + + --- waker --- + event_indicated = 1; + wake_up_process(event_daemon); + + --- sleeper --- + for (;;) { + set_current_state(TASK_UNINTERRUPTIBLE); + if (event_indicated) + break; + schedule(); + } + + set_current_state() may be wrapped by: + prepare_to_wait(); + +In the kswapd() case, event_indicated is kthread->should_stop. + + === offlining memory (waker) === + kswapd_stop() + kthread_stop() + kthread->should_stop = 1 + wake_up_process() + wait_for_completion() + + === kswapd_try_to_sleep (sleeper) === + kswapd_try_to_sleep() + prepare_to_wait() + . + . + schedule() + . + . + finish_wait() + +The schedule() needs to be protected by a test of kthread->should_stop, +which is wrapped by kthread_should_stop(). + +Reproducer: + Do heavy file I/O in background. + Do a memory offline/online in a tight loop + +Signed-off-by: Aaditya Kumar +Acked-by: KOSAKI Motohiro +Reviewed-by: Minchan Kim +Acked-by: Mel Gorman +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/vmscan.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -2695,7 +2695,10 @@ static void kswapd_try_to_sleep(pg_data_ + * them before going back to sleep. + */ + set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); +- schedule(); ++ ++ if (!kthread_should_stop()) ++ schedule(); ++ + set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold); + } else { + if (remaining) diff --git a/queue-3.0/ntp-fix-sta_ins-del-clearing-bug.patch b/queue-3.0/ntp-fix-sta_ins-del-clearing-bug.patch new file mode 100644 index 00000000000..ad20b02908b --- /dev/null +++ b/queue-3.0/ntp-fix-sta_ins-del-clearing-bug.patch @@ -0,0 +1,57 @@ +From 6b1859dba01c7d512b72d77e3fd7da8354235189 Mon Sep 17 00:00:00 2001 +From: John Stultz +Date: Fri, 13 Jul 2012 01:21:50 -0400 +Subject: ntp: Fix STA_INS/DEL clearing bug + +From: John Stultz + +commit 6b1859dba01c7d512b72d77e3fd7da8354235189 upstream. + +In commit 6b43ae8a619d17c4935c3320d2ef9e92bdeed05d, I +introduced a bug that kept the STA_INS or STA_DEL bit +from being cleared from time_status via adjtimex() +without forcing STA_PLL first. + +Usually once the STA_INS is set, it isn't cleared +until the leap second is applied, so its unlikely this +affected anyone. However during testing I noticed it +took some effort to cancel a leap second once STA_INS +was set. + +Signed-off-by: John Stultz +Cc: Ingo Molnar +Cc: Peter Zijlstra +Cc: Richard Cochran +Cc: Prarit Bhargava +Link: http://lkml.kernel.org/r/1342156917-25092-2-git-send-email-john.stultz@linaro.org +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/ntp.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/kernel/time/ntp.c ++++ b/kernel/time/ntp.c +@@ -375,7 +375,9 @@ int second_overflow(unsigned long secs) + time_state = TIME_DEL; + break; + case TIME_INS: +- if (secs % 86400 == 0) { ++ if (!(time_status & STA_INS)) ++ time_state = TIME_OK; ++ else if (secs % 86400 == 0) { + leap = -1; + time_state = TIME_OOP; + time_tai++; +@@ -384,7 +386,9 @@ int second_overflow(unsigned long secs) + } + break; + case TIME_DEL: +- if ((secs + 1) % 86400 == 0) { ++ if (!(time_status & STA_DEL)) ++ time_state = TIME_OK; ++ else if ((secs + 1) % 86400 == 0) { + leap = 1; + time_tai--; + time_state = TIME_WAIT; diff --git a/queue-3.0/series b/queue-3.0/series new file mode 100644 index 00000000000..bf76a2ef4ef --- /dev/null +++ b/queue-3.0/series @@ -0,0 +1,3 @@ +cifs-always-update-the-inode-cache-with-the-results-from-a-find_.patch +ntp-fix-sta_ins-del-clearing-bug.patch +mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch