summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-08-02 09:20:05 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-02 09:20:05 -0700
commitfbb9d8a662b78aa1e2fb16a94736fe82f4ffaef9 (patch)
tree9b6e3f8aff9e4891e06eb6fa1366384a0c0f5722
parente2cab6c9f6c3a46e171dc6a70b89d45698a42987 (diff)
downloadstable-queue-fbb9d8a662b78aa1e2fb16a94736fe82f4ffaef9.tar.gz
another .39 patch
-rw-r--r--review-2.6.39/fs-cache-fix-__fscache_uncache_all_inode_pages-s-outer.patch70
-rw-r--r--review-2.6.39/series1
2 files changed, 71 insertions, 0 deletions
diff --git a/review-2.6.39/fs-cache-fix-__fscache_uncache_all_inode_pages-s-outer.patch b/review-2.6.39/fs-cache-fix-__fscache_uncache_all_inode_pages-s-outer.patch
new file mode 100644
index 0000000000..2521b58a2b
--- /dev/null
+++ b/review-2.6.39/fs-cache-fix-__fscache_uncache_all_inode_pages-s-outer.patch
@@ -0,0 +1,70 @@
+From b307d4655a71749ac3f91c6dbe33d28cc026ceeb Mon Sep 17 00:00:00 2001
+From: Jan Beulich <JBeulich@novell.com>
+Date: Thu, 21 Jul 2011 15:02:43 +0100
+Subject: FS-Cache: Fix __fscache_uncache_all_inode_pages()'s outer loop
+
+From: Jan Beulich <JBeulich@novell.com>
+
+commit b307d4655a71749ac3f91c6dbe33d28cc026ceeb upstream.
+
+The compiler, at least for ix86 and m68k, validly warns that the
+comparison:
+
+ next <= (loff_t)-1
+
+is always true (and it's always true also for x86-64 and probably all
+other arches - as long as pgoff_t isn't wider than loff_t). The
+intention appears to be to avoid wrapping of "next", so rather than
+eliminating the pointless comparison, fix the loop to indeed get exited
+when "next" would otherwise wrap.
+
+On m68k the following warning is observed:
+
+ fs/fscache/page.c: In function '__fscache_uncache_all_inode_pages':
+ fs/fscache/page.c:979: warning: comparison is always false due to limited range of data type
+
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Reported-by: Jan Beulich <jbeulich@novell.com>
+Signed-off-by: Jan Beulich <jbeulich@novell.com>
+Signed-off-by: David Howells <dhowells@redhat.com>
+Cc: Suresh Jayaraman <sjayaraman@suse.de>
+Cc: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/fscache/page.c | 14 +++++---------
+ 1 file changed, 5 insertions(+), 9 deletions(-)
+
+--- a/fs/fscache/page.c
++++ b/fs/fscache/page.c
+@@ -989,16 +989,12 @@ void __fscache_uncache_all_inode_pages(s
+
+ pagevec_init(&pvec, 0);
+ next = 0;
+- while (next <= (loff_t)-1 &&
+- pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)
+- ) {
++ do {
++ if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE))
++ break;
+ for (i = 0; i < pagevec_count(&pvec); i++) {
+ struct page *page = pvec.pages[i];
+- pgoff_t page_index = page->index;
+-
+- ASSERTCMP(page_index, >=, next);
+- next = page_index + 1;
+-
++ next = page->index;
+ if (PageFsCache(page)) {
+ __fscache_wait_on_page_write(cookie, page);
+ __fscache_uncache_page(cookie, page);
+@@ -1006,7 +1002,7 @@ void __fscache_uncache_all_inode_pages(s
+ }
+ pagevec_release(&pvec);
+ cond_resched();
+- }
++ } while (++next);
+
+ _leave("");
+ }
diff --git a/review-2.6.39/series b/review-2.6.39/series
index fc479c23d1..6bb4232b19 100644
--- a/review-2.6.39/series
+++ b/review-2.6.39/series
@@ -68,3 +68,4 @@ cifs-fix-wsize-negotiation-to-respect-max-buffer-size-and.patch
cifs-lower-default-and-max-wsize-to-what-2.6.39-can-handle.patch
bridge-send-proper-message_age-in-config-bpdu.patch
gro-only-reset-frag0-when-skb-can-be-pulled.patch
+fs-cache-fix-__fscache_uncache_all_inode_pages-s-outer.patch