]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
2 .25 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 Aug 2008 00:12:10 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 Aug 2008 00:12:10 +0000 (17:12 -0700)
queue-2.6.25/linux-2.6-x86-mm-ioremap-64-bit-resource-on-32-bit-kernel.patch [new file with mode: 0644]
queue-2.6.25/romfs_readpage-don-t-report-errors-for-pages-beyond-i_size.patch [new file with mode: 0644]
queue-2.6.25/series [new file with mode: 0644]

diff --git a/queue-2.6.25/linux-2.6-x86-mm-ioremap-64-bit-resource-on-32-bit-kernel.patch b/queue-2.6.25/linux-2.6-x86-mm-ioremap-64-bit-resource-on-32-bit-kernel.patch
new file mode 100644 (file)
index 0000000..c23e019
--- /dev/null
@@ -0,0 +1,37 @@
+From: Ingo Molnar <mingo@elte.hu>
+Date: Tue, 25 Mar 2008 07:31:17 +0000 (+0100)
+Subject: x86: ioremap of 64-bit resource on 32-bit kernel fix
+
+commit 756a6c68556600aec9460346332884d891d5beb4 upstream
+
+x86: ioremap of 64-bit resource on 32-bit kernel fix
+
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/mm/ioremap.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/mm/ioremap.c
++++ b/arch/x86/mm/ioremap.c
+@@ -39,7 +39,7 @@ EXPORT_SYMBOL(__phys_addr);
+ int page_is_ram(unsigned long pagenr)
+ {
+-      unsigned long addr, end;
++      resource_size_t addr, end;
+       int i;
+       /*
+@@ -109,7 +109,8 @@ static int ioremap_change_attr(unsigned 
+ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
+                              enum ioremap_mode mode)
+ {
+-      unsigned long pfn, offset, last_addr, vaddr;
++      unsigned long pfn, offset, vaddr;
++      resource_size_t last_addr;
+       struct vm_struct *area;
+       pgprot_t prot;
diff --git a/queue-2.6.25/romfs_readpage-don-t-report-errors-for-pages-beyond-i_size.patch b/queue-2.6.25/romfs_readpage-don-t-report-errors-for-pages-beyond-i_size.patch
new file mode 100644 (file)
index 0000000..341a1fa
--- /dev/null
@@ -0,0 +1,83 @@
+From 0056e65f9e28d83ee1a3fb4f7d0041e838f03c34 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Wed, 30 Jul 2008 14:26:25 -0700
+Subject: romfs_readpage: don't report errors for pages beyond i_size
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 0056e65f9e28d83ee1a3fb4f7d0041e838f03c34 upstream
+
+We zero-fill them like we are supposed to, and that's all fine.  It's
+only an error if the 'romfs_copyfrom()' routine isn't able to fill the
+data that is supposed to be there.
+
+Most of the patch is really just re-organizing the code a bit, and using
+separate variables for the error value and for how much of the page we
+actually filled from the filesystem.
+
+Reported-and-tested-by: Chris Fester <cfester@wms.com>
+Cc: Alexander Viro <viro@zeniv.linux.org.uk>
+Cc: Matt Waddel <matt.waddel@freescale.com>
+Cc: Greg Ungerer <gerg@snapgear.com>
+Signed-of-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/romfs/inode.c |   37 +++++++++++++++++++++++--------------
+ 1 file changed, 23 insertions(+), 14 deletions(-)
+
+--- a/fs/romfs/inode.c
++++ b/fs/romfs/inode.c
+@@ -418,7 +418,8 @@ static int
+ romfs_readpage(struct file *file, struct page * page)
+ {
+       struct inode *inode = page->mapping->host;
+-      loff_t offset, avail, readlen;
++      loff_t offset, size;
++      unsigned long filled;
+       void *buf;
+       int result = -EIO;
+@@ -430,21 +431,29 @@ romfs_readpage(struct file *file, struct
+       /* 32 bit warning -- but not for us :) */
+       offset = page_offset(page);
+-      if (offset < i_size_read(inode)) {
+-              avail = inode->i_size-offset;
+-              readlen = min_t(unsigned long, avail, PAGE_SIZE);
+-              if (romfs_copyfrom(inode, buf, ROMFS_I(inode)->i_dataoffset+offset, readlen) == readlen) {
+-                      if (readlen < PAGE_SIZE) {
+-                              memset(buf + readlen,0,PAGE_SIZE-readlen);
+-                      }
+-                      SetPageUptodate(page);
+-                      result = 0;
++      size = i_size_read(inode);
++      filled = 0;
++      result = 0;
++      if (offset < size) {
++              unsigned long readlen;
++
++              size -= offset;
++              readlen = size > PAGE_SIZE ? PAGE_SIZE : size;
++
++              filled = romfs_copyfrom(inode, buf, ROMFS_I(inode)->i_dataoffset+offset, readlen);
++
++              if (filled != readlen) {
++                      SetPageError(page);
++                      filled = 0;
++                      result = -EIO;
+               }
+       }
+-      if (result) {
+-              memset(buf, 0, PAGE_SIZE);
+-              SetPageError(page);
+-      }
++
++      if (filled < PAGE_SIZE)
++              memset(buf + filled, 0, PAGE_SIZE-filled);
++
++      if (!result)
++              SetPageUptodate(page);
+       flush_dcache_page(page);
+       unlock_page(page);
diff --git a/queue-2.6.25/series b/queue-2.6.25/series
new file mode 100644 (file)
index 0000000..1bbd367
--- /dev/null
@@ -0,0 +1,2 @@
+romfs_readpage-don-t-report-errors-for-pages-beyond-i_size.patch
+linux-2.6-x86-mm-ioremap-64-bit-resource-on-32-bit-kernel.patch