patch for 2.1.79 filemap.c

Bill Hawes (whawes@star.net)
Thu, 15 Jan 1998 13:27:02 -0500


This is a multi-part message in MIME format.
--------------74293C19EEEF3A28680B9DC7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The attached patch fixes a problem in get_cached_page that was causing
an oops in smbfs. The page_address() routine was being called with a
NULL page; the routine now just returns 0 as it should.

Regards,
Bill
--------------74293C19EEEF3A28680B9DC7
Content-Type: text/plain; charset=us-ascii; name="filemap_79-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="filemap_79-patch"

--- mm/filemap.c.old Tue Jan 13 10:38:36 1998
+++ mm/filemap.c Thu Jan 15 13:41:27 1998
@@ -1429,7 +1429,7 @@
{
struct page * page;
struct page ** hash;
- unsigned long page_cache;
+ unsigned long page_cache = 0;

hash = page_hash(inode, offset);
page = __find_page(inode, offset, *hash);
@@ -1443,14 +1443,15 @@
add_to_page_cache(page, inode, offset, hash);
}
if (atomic_read(&page->count) != 2)
- printk("get_cached_page: page count=%d\n",
+ printk(KERN_ERR "get_cached_page: page count=%d\n",
atomic_read(&page->count));
if (test_bit(PG_locked, &page->flags))
- printk("get_cached_page: page already locked!\n");
+ printk(KERN_ERR "get_cached_page: page already locked!\n");
set_bit(PG_locked, &page->flags);
+ page_cache = page_address(page);

out:
- return page_address(page);
+ return page_cache;
}

/*

--------------74293C19EEEF3A28680B9DC7--