Armin,
I finally have a fix for bug 2591.  There was a path where we missed updating the 
directory index table
that we use to keep track of our position during readdir calls.  This patch should fix 
the problem, but you
may have to remove and recreate the directory where the problem occurred.

Index: linux24/fs/jfs/jfs_dtree.c
===================================================================
RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_dtree.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- linux24/fs/jfs/jfs_dtree.c  2002/02/12 15:18:20     1.24
+++ linux24/fs/jfs/jfs_dtree.c  2002/02/19 21:26:15     1.25
@@ -1911,6 +1911,22 @@
        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);
+       }
+       /*
         * insert the new entry into the new right/child page
         * (skip index in the new right page will not change)
         */
@@ -2899,6 +2915,12 @@
                        index = dirtab_slot.slot;
                        DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
                        if (rc) {
+                               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;
                        }
_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion

Reply via email to