Commit 60e8e519 authored by Dave Kleikamp's avatar Dave Kleikamp

Fix a corruption problem in the jfs dir table

parent edf3c7a4
......@@ -1910,6 +1910,22 @@ static int dtSplitRoot(tid_t tid,
rp->header.freecnt = sp->header.freecnt + rp->header.maxslot - n;
/*
* Update directory index table for entries now in right page
*/
if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
metapage_t *mp = 0;
ldtentry_t *ldtentry;
stbl = DT_GETSTBL(rp);
for (n = 0; n < rp->header.nextindex; n++) {
ldtentry = (ldtentry_t *) & rp->slot[stbl[n]];
modify_index(tid, ip, le32_to_cpu(ldtentry->index),
rbn, n, &mp);
}
if (mp)
release_metapage(mp);
}
/*
* Update directory index table for entries now in right page
*/
......@@ -2924,6 +2940,12 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
filp->f_pos = -1;
return 0;
}
if (p->header.flag & BT_INTERNAL) {
jERROR(1,("jfs_readdir: bad index table\n"));
DT_PUTPAGE(mp);
filp->f_pos = -1;
return 0;
}
} else {
if (dir_index == 0) {
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment