Messages in this thread Patch in this message | | | Date | Mon, 17 Nov 1997 10:06:31 -0500 | From | Bill Hawes <> | Subject | Re: bad message on hpfs (2.1.64) |
| |
Chris Lo wrote: > > Get this on a pure 2.1.64, under a mounted hpfs directory > > # ls xxxxxxxxx > > VFS: brelse: Trying to free free buffer > VFS: brelse: Trying to free free buffer > VFS: brelse: Trying to free free buffer > VFS: brelse: Trying to free free buffer > kmem_free: Either bad obj addr or double free (objp=c0ff6000, name=size-2048) > > I didn't try this on the recent kernel, so didn't know when was it > started.
Hi Chris, I've attached a patch that should fix your hpfs problem. I don't have any hpfs disks here, so the patch is untested. Please let me know if you still have problems after applying the patch.
Regards, Bill--- fs/hpfs/hpfs_fs.c.old Sun Nov 16 17:30:00 1997 +++ fs/hpfs/hpfs_fs.c Mon Nov 17 10:51:19 1997 @@ -1122,20 +1122,21 @@ static int hpfs_lookup(struct inode *dir, struct dentry *dentry) { - struct quad_buffer_head qbh; + const char *name = dentry->d_name.name; + int len = dentry->d_name.len; struct hpfs_dirent *de; struct inode *inode; ino_t ino; - const char *name = dentry->d_name.name; - int len = dentry->d_name.len; int retval; + struct quad_buffer_head qbh; /* In case of madness */ + retval = -ENOTDIR; if (dir == 0) - return -ENOENT; + goto out; if (!S_ISDIR(dir->i_mode)) - return -ENOENT; + goto out; /* * Read in the directory entry. "." is there under the name ^A^A . @@ -1155,9 +1156,11 @@ * This is not really a bailout, just means file not found. */ - inode = NULL; - if (!de) - goto add_dentry; + if (!de) { + d_add(dentry, NULL); + retval = 0; + goto out; + } /* * Get inode number, what we're after. @@ -1199,15 +1202,13 @@ } } - /* - * Add the dentry, negative or otherwise. - */ - add_dentry: d_add(dentry, inode); retval = 0; free4: brelse4(&qbh); + + out: return retval; } | |