Re: [patch] 2.2.9_andrea-VM1.gz

Andrea Arcangeli (andrea@suse.de)
Tue, 8 Jun 1999 17:24:46 +0200 (CEST)


On Tue, 8 Jun 1999, Peter Steiner wrote:

>I've got a really strange problem with the patch.
>
>While the system is stable and responsive under load a really idle
>system leads to processes hanging on e.g. (strace output):
>
>open("/var/log/nw.routes", O_WRONLY|O_CREAT|O_TRUNC, 0666

I forgot that ext2/truncate is still buggy in 2.2.9. Here a patch against
2.2.9 to fix this bit. I'll include in the VM patch and I'll release a new
one soon. Let me know if it's enough to fix your problem. Thanks!

Index: fs/ext2/truncate.c
===================================================================
RCS file: /var/cvs/linux/fs/ext2/truncate.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.2.9
diff -u -r1.1.1.1 -r1.1.2.9
--- fs/ext2/truncate.c 1999/01/18 01:26:52 1.1.1.1
+++ linux/fs/ext2/truncate.c 1999/06/05 13:50:35 1.1.2.9
@@ -384,7 +382,7 @@

void ext2_truncate (struct inode * inode)
{
- int err, offset, retry;
+ int err, offset;

if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode)))
@@ -393,7 +391,7 @@
return;
ext2_discard_prealloc(inode);
while (1) {
- retry = trunc_direct(inode);
+ int retry = trunc_direct(inode);
retry |= trunc_indirect (inode,
EXT2_IND_BLOCK,
(u32 *) &inode->u.ext2_i.i_data[EXT2_IND_BLOCK],
@@ -407,8 +405,9 @@
break;
if (IS_SYNC(inode) && (inode->i_state & I_DIRTY))
ext2_sync_inode (inode);
- current->counter = 0;
- schedule ();
+ if (current->need_resched)
+ schedule();
+ run_task_queue(&tq_disk);
}
/*
* If the file is not being truncated to a block boundary, the

Andrea Arcangeli

PS. I had feedback about the new buffer hashfn to be slower than the stock
one because it takes more time to compute the mul... Did you profiled it?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/