Messages in this thread Patch in this message | | | Date | Thu, 28 Oct 1999 09:01:44 -0400 (EDT) | From | Alexander Viro <> | Subject | Re: [2.3.24, smbfs] Kernel panic: put_cached_page: page count=1 |
| |
On Thu, 28 Oct 1999 craig@qualica.com wrote:
> Hi > > My apologies if someone has already reported this. I had my x86 single > procesor box lock solid with 2.3.24 when trying to ls a smbfs mounted > directory just now: > > I found this in the logs: > > Oct 28 11:05:55 flat kernel: Kernel panic: put_cached_page: page count=1 > > I hope it helps someone track down the problem. More details on request > through direct email to me please.
Stack trace would be useful, but in that case methink I know WTF had happened. Patch attached. --- cache.c Thu Oct 28 02:53:05 1999 +++ cache.c.new Thu Oct 28 08:53:06 1999 @@ -48,30 +48,35 @@ { struct page * page; struct page ** hash; - unsigned long new_page; + struct page *cached_page; again: hash = page_hash(mapping, offset); page = __find_lock_page(mapping, offset, hash); if(!page && new) { - /* not in cache, alloc a new page */ - new_page = page_cache_alloc(); - if (!new_page) - return 0; - clear_page(new_page); /* smb code assumes pages are zeroed */ - page = page_cache_entry(new_page); - if (add_to_page_cache_unique(page, mapping, offset, hash)) { + /* not in cache, alloc a new page if we didn't do it yet */ + if (!cached_page) { + cached_page = page_cache_alloc(); + if (!cached_page) + return 0; + /* smb code assumes pages are zeroed */ + clear_page(page_address(cached_page)); + goto again; + } + page = cached_page; + if (add_to_page_cache_unique(page, mapping, offset, hash)) /* Hmm, a page has materialized in the cache. Fine. Go back and get that page - instead ... throwing away this one first. */ - put_cached_page((unsigned long) page); + instead... */ goto again; - } + cached_page = NULL; } + if (cached_page) + page_cache_free(cached_page); if(!page) return 0; if(!PageLocked(page)) - printk(KERN_ERR "smbfs/cache.c: page isn't locked! This could be fun ...\n"); + BUG(); return page_address(page); }
| |