The point is that we must run run_task_queue() exactly before going to
check if some buffer is still locked (as my original fix did). It make no
sense to run_task_queue() and then go to sleep if our timeslice is not
expired yet, while we could just have all buffers unlocked. According to
me the right fix is:
Index: linux/fs/ext2/truncate.c
===================================================================
RCS file: /var/cvs/linux/fs/ext2/truncate.c,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 truncate.c
--- linux/fs/ext2/truncate.c 1999/05/19 10:08:51 1.1.2.7
+++ linux/fs/ext2/truncate.c 1999/05/19 16:11:29
@@ -407,9 +407,9 @@
break;
if (IS_SYNC(inode) && (inode->i_state & I_DIRTY))
ext2_sync_inode (inode);
+ if (current->need_resched)
+ schedule();
run_task_queue(&tq_disk);
- current->policy |= SCHED_YIELD;
- schedule();
}
/*
* If the file is not being truncated to a block boundary, the
Andrea Arcangeli
-
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/