Re: HPFS filesystem problems

Bill Hawes (whawes@star.net)
Tue, 29 Jul 1997 13:31:51 -0400


This is a multi-part message in MIME format.
--------------E087DF486EA34C9CBF4D335C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Glenn C. Hofmann wrote:
> Now, I can compile with hpfs, it mounts, but it gives an oops when
> trying to get a directory listing. I don't know who specifically is
> working on this part, but here is what info I can get about what is
> happening.

Hi Glenn,

I took a look at the hpfs code, and the attached patch should help fix
your problem. I don't have an HPFS partition to test this with, but it
compiles very nicely :-)

Regards,
Bill
--------------E087DF486EA34C9CBF4D335C
Content-Type: text/plain; charset=us-ascii; name="hpfs_47-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="hpfs_47-patch"

--- fs/hpfs/hpfs_fs.c.old Thu Jul 24 17:36:07 1997
+++ fs/hpfs/hpfs_fs.c Tue Jul 29 13:23:16 1997
@@ -1127,13 +1127,14 @@
ino_t ino;
const char *name = dentry->d_name.name;
int len = dentry->d_name.len;
+ int retval;

/* In case of madness */

if (dir == 0)
return -ENOENT;
if (!S_ISDIR(dir->i_mode))
- goto bail;
+ return -ENOENT;

/*
* Read in the directory entry. "." is there under the name ^A^A .
@@ -1153,8 +1154,9 @@
* This is not really a bailout, just means file not found.
*/

+ inode = NULL;
if (!de)
- goto bail;
+ goto add_dentry;

/*
* Get inode number, what we're after.
@@ -1169,8 +1171,9 @@
* Go find or make an inode.
*/

+ retval = -EACCES;
if (!(inode = iget(dir->i_sb, ino)))
- goto bail1;
+ goto free4;

/*
* Fill in the info from the directory if this is a newly created
@@ -1195,24 +1198,16 @@
}
}

- brelse4(&qbh);
-
/*
- * Made it.
+ * Add the dentry, negative or otherwise.
*/
+add_dentry:
+ d_add(dentry, inode);
+ retval = 0;

- d_instantiate(dentry, inode);
- iput(dir);
- return 0;
-
- /*
- * Didn't.
- */
- bail1:
+free4:
brelse4(&qbh);
- bail:
- iput(dir);
- return -ENOENT;
+ return retval;
}

/*

--------------E087DF486EA34C9CBF4D335C--