lkml.org 
[lkml]   [1997]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject2.0.31-pre9 + p10-2 + other patches crash
Hi,
I was happily using 2.0.31-pre9 + p10-2 and some other patches (see later)
while reading some docs and suddenly I've got a screen full of
"IDE reset - IDE failed blah blah - can't get inode number ..." messages. 100 messages
later the
system crashed: the last message I've got was "can't load libc.so.5"
while trying to do sync,ls and finally CTRL-ALT-DEL.
So I had to hit "reset". On the next boot linux failed to mount the root fs,
saying something like "can't get block 4000000000. max block number is 400000"
(actually, the numbers were a bit different).
OK. "Let's go with Boot+Root disk", I said. Then e2fsck -v -y /dev/hda3.
The fs checker put all the files and dirs it could restore in lost+found.
Using all these files, a partial backup and some shell scripting black-magic
I could restore all my valuable data.
Now I'm going to reinstall everything...

>>>>> The Question I'm asking you is:
what's happened? and why?
let's say it's my fault: I was playing with kernel patches
OK. So which is the offending patch?

pre9? p10-2? or one of the following (I suspect the third is the bad one)?

any kind of suggestion, comment or help is well accepted

thank you very much for your attention

see you next time on the mailing list
Francesco Faenzi

***************************************************************************************

diff -urN linux-2.0.31-9/fs/buffer.c linux/fs/buffer.c
--- linux-2.0.31-9/fs/buffer.c Mon Sep 8 14:32:14 1997
+++ linux/fs/buffer.c Tue Sep 16 18:57:07 1997
@@ -559,7 +559,7 @@
static struct buffer_head *find_candidate(struct buffer_head *bh,
int *list_len, int size)
{
- int behind = 0;
+ int lookahead = 7;

if (!bh)
goto no_candidate;
@@ -572,11 +572,12 @@
try_to_free_buffer(bh,&bh,1);
if (!bh)
break;
+ lookahead = 7;
continue;
}
else if (buffer_locked(bh) &&
(bh->b_list == BUF_LOCKED || bh->b_list == BUF_LOCKED1)) {
- if (behind++ > 10) {
+ if (!--lookahead) {
(*list_len) = 0;
goto no_candidate;
}
@@ -595,9 +596,10 @@
{
struct buffer_head * bh;
struct buffer_head * candidate[BUF_DIRTY];
+ extern struct task_struct *bdflush_tsk;
unsigned int best_time, winner;
int buffers[BUF_DIRTY];
- int i;
+ int i, limit = ((min_free_pages + free_pages_low) >> 1);
int needed;

refilled = 1;
@@ -606,7 +608,7 @@
for user processes to use (and dirty) */

/* We are going to try to locate this much memory */
- needed =bdf_prm.b_un.nrefill * size;
+ needed = bdf_prm.b_un.nrefill * size;

while (nr_free_pages > min_free_pages*2 && needed > 0 &&
grow_buffers(GFP_BUFFER, size)) {
@@ -661,21 +663,38 @@

/* Dirty buffers should not overtake, wakeup_bdflush(1) calls
bdflush and sleeps, therefore kswapd does his important work. */
- if ((nr_buffers_type[BUF_DIRTY] > nr_buffers * bdf_prm.b_un.nfract/100) ||
- (nr_free_pages < min_free_pages))

+ if (nr_buffers_type[BUF_DIRTY] > nr_buffers * bdf_prm.b_un.nfract/100)
wakeup_bdflush(1);

/* Too bad, that was not enough. Try a little harder to grow some. */

- if (nr_free_pages > min_free_pages + 5) {
+ if (nr_free_pages > limit) {
if (grow_buffers(GFP_BUFFER, size)) {
needed -= PAGE_SIZE;
goto repeat;
};
}

+ /* If we are not bdflush we should wake up bdflush and try it again. */
+
+ if (current != bdflush_tsk) {
+ wakeup_bdflush(1);
+ needed -= PAGE_SIZE;
+ goto repeat;
+ }
+
+ /* We are bdflush: let's try our best */
+
+ /*
+ * In order to protect our reserved pages,
+ * return now if we got any buffers.
+ */
+ allow_interrupts();
+ if (free_list[BUFSIZE_INDEX(size)])
+ return;
+
/* and repeat until we find something good */
- wakeup_bdflush(1);
+ grow_buffers(GFP_BUFFER, size);

/* decrease needed even if there is no success */
needed -= PAGE_SIZE;
@@ -966,11 +985,15 @@
* This is critical. We can't swap out pages to get
* more buffer heads, because the swap-out may need
* more buffer-heads itself. Thus GFP_ATOMIC.
+ *
+ * This is no longer true, it is GFP_BUFFER again, the
+ * swapping code now knows not to perform I/O when that
+ * GFP level is specified... -DaveM
*/
/* we now use kmalloc() here instead of gfp as we want
to be able to easily release buffer heads - they
took up quite a bit of memory (tridge) */
- bh = (struct buffer_head *) kmalloc(sizeof(*bh),GFP_ATOMIC);
+ bh = (struct buffer_head *) kmalloc(sizeof(*bh),GFP_BUFFER);
if (bh) {
put_unused_buffer_head(bh);
nr_buffer_heads++;
diff -urN linux-2.0.31-9/mm/kmalloc.c linux/mm/kmalloc.c
--- linux-2.0.31-9/mm/kmalloc.c Sat Jun 8 17:12:33 1996
+++ linux/mm/kmalloc.c Tue Sep 16 19:04:35 1997
@@ -344,6 +344,7 @@
* Now we're going to muck with the "global" freelist
* for this size: this should be uninterruptible
*/
+ save_flags(flags);
cli();
page->next = *pg;
*pg = page;
@@ -447,6 +448,6 @@
return;

not_on_freelist:
- printk("Ooops. page %p doesn't show on freelist.\n", page);
restore_flags(flags);
+ printk("Ooops. page %p doesn't show on freelist.\n", page);
}
diff -urN linux-2.0.31-9/mm/vmscan.c linux/mm/vmscan.c
--- linux-2.0.31-9/mm/vmscan.c Mon Sep 8 14:32:21 1997
+++ linux/mm/vmscan.c Wed Sep 17 14:46:40 1997
@@ -406,11 +406,8 @@
can_do_io = 1;
if (wait)
stop = 0;
- if (priority == GFP_BUFFER) {
- /* bdflush() should do the rest if we fail */
- stop = 3;
+ if (priority == GFP_BUFFER)
can_do_io = 0;
- }
switch (state) {
do {
case 0:
@@ -492,10 +489,14 @@
interruptible_sleep_on(&kswapd_wait);
kswapd_awake = 1;
swapstats.wakeups++;
+ /* Protect our reserved pages: */
+ i = 0;
+ if (nr_free_pages <= min_free_pages)
+ i = (1+min_free_pages) - nr_free_pages;
/* Do the background pageout: */
- for (i=0; i < kswapd_ctl.maxpages; i++)
+ for (i += kswapd_ctl.maxpages; i > 0; i--)
try_to_free_page(GFP_KERNEL, 0,
- (nr_free_pages < min_free_pages));
+ (nr_free_pages <= min_free_pages));
}
}

*************************************************************************************
diff -u -r linux.orig/include/linux/swap.h linux/include/linux/swap.h
--- linux.orig/include/linux/swap.h Mon Jun 3 14:38:37 1996
+++ linux/include/linux/swap.h Fri Apr 18 17:11:22 1997
@@ -34,6 +34,7 @@

extern int nr_swap_pages;
extern int nr_free_pages;
+extern int nr_swap_cache_pages;
extern atomic_t nr_async_pages;
extern int min_free_pages;
extern int free_pages_low;
@@ -113,10 +114,12 @@
swap_cache_find_total++;
#endif
entry = xchg(swap_cache + index, 0);
+ if (entry) {
#ifdef SWAP_CACHE_INFO
- if (entry)
swap_cache_find_success++;
#endif
+ nr_swap_cache_pages--;
+ }
return entry;
}

@@ -133,6 +136,7 @@
swap_cache_del_success++;
#endif
swap_free(entry);
+ nr_swap_cache_pages--;
return 1;
}
return 0;
diff -u -r linux.orig/mm/mmap.c linux/mm/mmap.c
--- linux.orig/mm/mmap.c Fri Dec 6 22:09:24 1996
+++ linux/mm/mmap.c Fri Apr 18 17:12:08 1997
@@ -55,9 +55,10 @@
long freepages;
freepages = buffermem >> PAGE_SHIFT;
freepages += page_cache_size;
- freepages >>= 1;
+/* freepages >>= 1; 64 MB used as buffers and you can't run a 50 MB program */
freepages += nr_free_pages;
freepages += nr_swap_pages;
+ freepages += nr_swap_cache_pages;
freepages -= MAP_NR(high_memory) >> 4;
return freepages > pages;
}
diff -u -r linux.orig/mm/swap_state.c linux/mm/swap_state.c
--- linux.orig/mm/swap_state.c Wed Mar 13 14:17:23 1996
+++ linux/mm/swap_state.c Fri Apr 18 17:12:11 1997
@@ -32,6 +32,8 @@
*/
unsigned long *swap_cache;

+int nr_swap_cache_pages = 0;
+
#ifdef SWAP_CACHE_INFO
unsigned long swap_cache_add_total = 0;
unsigned long swap_cache_add_success = 0;
@@ -64,6 +66,7 @@
#ifdef SWAP_CACHE_INFO
swap_cache_add_success++;
#endif
+ nr_swap_cache_pages++;
return 1;
}
return 0;
diff -u -r linux.orig/mm/swapfile.c linux/mm/swapfile.c
--- linux.orig/mm/swapfile.c Thu Apr 10 23:47:14 1997
+++ linux/mm/swapfile.c Fri Apr 18 17:12:12 1997
@@ -570,6 +570,7 @@
++val->totalswap;
}
}
+ val->freeswap += nr_swap_cache_pages;
val->freeswap <<= PAGE_SHIFT;
val->totalswap <<= PAGE_SHIFT;
return;
****************************************************************************************
--- linux/drivers/block/ide.h Wed Sep 24 19:53:57 1997
+++ patch_BOB/ide.h Fri Sep 19 00:08:29 1997
@@ -22,14 +22,14 @@
*
* REALLY_SLOW_IO can be defined in ide.c and ide-cd.c, if necessary
*/
-#undef REALLY_FAST_IO /* define if ide ports are perfect */
+#define REALLY_FAST_IO /* define if ide ports are perfect */
#define INITIAL_MULT_COUNT 0 /* off=0; on=2,4,8,16,32, etc.. */

#ifndef SUPPORT_SLOW_DATA_PORTS /* 1 to support slow data ports */
-#define SUPPORT_SLOW_DATA_PORTS 1 /* 0 to reduce kernel size */
+#define SUPPORT_SLOW_DATA_PORTS 0 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_VLB_SYNC /* 1 to support weird 32-bit chips */
-#define SUPPORT_VLB_SYNC 1 /* 0 to reduce kernel size */
+#define SUPPORT_VLB_SYNC 0 /* 0 to reduce kernel size */
#endif
#ifndef DISK_RECOVERY_TIME /* off=0; on=access_delay_time */
#define DISK_RECOVERY_TIME 0 /* for hardware that needs it */
@@ -38,10 +38,10 @@
#define OK_TO_RESET_CONTROLLER 1 /* 0 for use with AH2372A/B interface */
#endif
#ifndef FAKE_FDISK_FOR_EZDRIVE /* 1 to help linux fdisk with EZDRIVE */
-#define FAKE_FDISK_FOR_EZDRIVE 1 /* 0 to reduce kernel size */
+#define FAKE_FDISK_FOR_EZDRIVE 0 /* 0 to reduce kernel size */
#endif
#ifndef FANCY_STATUS_DUMPS /* 1 for human-readable drive errors */
-#define FANCY_STATUS_DUMPS 1 /* 0 to reduce kernel size */
+#define FANCY_STATUS_DUMPS 0 /* 0 to reduce kernel size */
#endif

#ifdef CONFIG_BLK_DEV_CMD640

--- linux/drivers/block/ide-cd.c Wed Sep 24 19:53:56 1997
+++ patch_BOB/ide-cd.c Fri Sep 19 00:08:29 1997
@@ -184,7 +184,7 @@
this will give you a slightly smaller kernel. */

#ifndef STANDARD_ATAPI
-#define STANDARD_ATAPI 0
+#define STANDARD_ATAPI 1
#endif


--- linux/drivers/block/floppy.c Tue Apr 8 17:47:45 1997
+++ patch_BOB/floppy.c Fri Sep 19 00:08:29 1997
@@ -100,7 +100,7 @@
#define FLOPPY_SANITY_CHECK
#undef FLOPPY_SILENT_DCL_CLEAR

-#define REALLY_SLOW_IO
+#define REALLY_FAST_IO

#define DEBUGT 2
#define DCL_DEBUG /* debug disk change line */

--- linux/drivers/char/serial.c Wed Sep 24 19:53:59 1997
+++ patch_BOB/serial.c Fri Sep 19 00:08:40 1997
@@ -75,7 +75,7 @@
* ever possible.
*/

-#define SERIAL_PARANOIA_CHECK
+#undef SERIAL_PARANOIA_CHECK
#define CONFIG_SERIAL_NOPAUSE_IO
#define SERIAL_DO_RESTART

@@ -149,59 +149,7 @@
struct async_struct rs_table[] = {
/* UART CLK PORT IRQ FLAGS */
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */
- { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */
- { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */
- { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
-
- { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */
- { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */
- { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */
- { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */
-
- { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */
- { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */
- { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */
- { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */
-
- { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */
- { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */
- { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare; user configurable) */
- { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare; user configurable) */
-
- { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */
- { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */
- { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */
- { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */
- { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */
- { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */
- { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */
- { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */
- { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */
- { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */
- { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */
- { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */
- { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */
- { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */
- { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */
- { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
-
-/* You can have up to four HUB6's in the system, but I've only
- * included two cards here for a total of twelve ports.
- */
-#ifdef CONFIG_HUB6
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */
- { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
-#endif
+ { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */
};

#define NR_PORTS (sizeof(rs_table)/sizeof(struct async_struct))

--- linux/drivers/char/tty_io.c Wed Sep 24 19:56:10 1997
+++ patch_BOB/tty_io.c Wed Sep 24 22:44:23 1997
@@ -85,7 +85,7 @@

#undef TTY_DEBUG_HANGUP

-#define TTY_PARANOIA_CHECK
+#undef TTY_PARANOIA_CHECK
#define CHECK_TTY_COUNT

extern void do_blank_screen(int nopowersave);
\
 
 \ /
  Last update: 2005-03-22 13:40    [W:1.297 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site