lkml.org 
[lkml]   [1999]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.3.1-pre3 breaks hfs filesystem

Uhhh...I thought I knew C, but evidently I am mistaken, because much of
that patch makes no sense to me. Many of the changes seemed to consist
of replacing things of the form

if ( ... || some_lvalue || ... )

with

if ( ... || &some_lvalue || ... )

Won't &some_lvale *always* evaluate to something that is true when used
with ||, and so the patch is effectively changing those if statements
to

if ( 1 )

--Tim Smith

On Wed, 12 May 1999 androsyn@i95.com wrote:

> Date: Wed, 12 May 1999 21:18:04 -0400 (EDT)
> From: androsyn@i95.com
> To: linux-kernel@vger.rutgers.edu
> Subject: 2.3.1-pre3 breaks hfs filesystem
>
> With the wait_queue changes in 2.3.1-pre3 hfs filesystem support got
> broke. The attached patch *should* fix it. (But then again it may not ;)
> Regardless it compiled okay here, I haven't tested it however. No mac
> floppies with me today.
>
> Aaron
>
>
--- linux/fs/hfs/bnode.c.old Wed May 12 16:51:11 1999
+++ linux/fs/hfs/bnode.c Wed May 12 16:52:24 1999
@@ -228,7 +228,7 @@
break;

case HFS_LOCK_NONE:
- while (bn->lock || bn->wqueue) {
+ while (bn->lock || &bn->wqueue) {
hfs_sleep_on(&bn->rqueue);
}
++bn->count;
@@ -382,7 +382,7 @@
/* We update the lock state of the node if it is still in use
or if it is "sticky" (such as the B-tree head and root).
Otherwise we just delete it. */
- if ((bn->count > 1) || (bn->rqueue) || (bn->sticky != HFS_NOT_STICKY)) {
+ if ((bn->count > 1) || (&bn->rqueue) || (bn->sticky != HFS_NOT_STICKY)) {
hfs_bnode_lock(bnr, HFS_LOCK_NONE);
} else {
/* dirty buffer if we (might) have modified it */
--- linux/fs/hfs/btree.c.old Wed May 12 16:54:42 1999
+++ linux/fs/hfs/btree.c Wed May 12 17:01:25 1999
@@ -173,7 +173,7 @@
bt->sys_mdb = mdb->sys_mdb;
bt->reserved = 0;
bt->lock = 0;
- bt->wait = NULL;
+ init_waitqueue_head(&bt->wait);
bt->dirt = 0;
memset(bt->cache, 0, sizeof(bt->cache));

--- linux/fs/hfs/catalog.c.old Wed May 12 17:02:43 1999
+++ linux/fs/hfs/catalog.c Wed May 12 17:03:10 1999
@@ -647,7 +647,7 @@
*/
static inline void start_write(struct hfs_cat_entry *dir)
{
- if (dir->u.dir.readers || dir->u.dir.read_wait) {
+ if (dir->u.dir.readers || &dir->u.dir.read_wait) {
hfs_sleep_on(&dir->u.dir.write_wait);
}
++dir->u.dir.writers;
@@ -658,7 +658,7 @@
*/
static inline void start_read(struct hfs_cat_entry *dir)
{
- if (dir->u.dir.writers || dir->u.dir.write_wait) {
+ if (dir->u.dir.writers || &dir->u.dir.write_wait) {
hfs_sleep_on(&dir->u.dir.read_wait);
}
++dir->u.dir.readers;
\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.039 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site