PATCH: HFS write support fixed

From: Bernd Kischnick (kisch@mindless.com)
Date: Sun May 14 2000 - 19:23:06 EST


Hi all,

this patch re-enables the write support for the
Macintosh-HFS-filesystem.
Apply to 2.3.99-pre8.

I've done some extensive testing, copying several thousand files to
HFS-partitions by several concurrent processes and reading them back.
I've seen no problems, at least on a single-processor machine.

The bug was introduced by the waitqueue-structures in the
B-Node-Handling of the driver. The waitqueues are not properly
initialised when a fresh node is allocated for writing. This condition
then sets off a sanity check in include/linux/wait.h, signalled by an
oops.

This fix should surely go into 2.4.

BTW, thanks to Adrian Sun and Paul Mackerass for the HFS driver. The
code is really well done, structured and documented.

Regards,
- Bernd

diff -ru linux/fs/hfs/balloc.c my/linux/fs/hfs/balloc.c
--- linux/fs/hfs/balloc.c Sun Jan 4 19:40:17 1998
+++ my/linux/fs/hfs/balloc.c Fri May 12 23:49:13 2000
@@ -86,6 +86,8 @@
         retval.bn->magic = HFS_BNODE_MAGIC;
         retval.bn->tree = tree;
         retval.bn->node = node;
+ hfs_init_waitqueue(&retval.bn->wqueue);
+ hfs_init_waitqueue(&retval.bn->rqueue);
         hfs_bnode_lock(&retval, HFS_LOCK_WRITE);
 
         retval.bn->buf = get_new_node(tree, node);

-
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/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:25 EST