On Sun, 2006-06-04 at 22:36 +0200, Nico -telmich- Schottelius wrote:

> (gdb) set args /dev/mapper/nirvana
> (gdb) run
> Starting program: /root/jfs_segfault/jfsutils-1.1.10/fsck/jfs_fsck 
> /dev/mapper/nirva
> na
> /root/jfs_segfault/jfsutils-1.1.10/fsck/jfs_fsck version 1.1.10, 19-Oct-2005
> processing started: 6/4/2006 22.34.14
> Using default parameter: -p
> The current device is:  /dev/mapper/nirvana
> Block size in bytes:  4096
> Filesystem size in blocks:  29305206
> **Phase 0 - Replay Journal Log
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0807ff5e in markImap (fsimap=
>       {fileset = 16, imap_page_count = 689, fsimapctrl = 0xb7dec000, imap_wsp 
> = 0xb7
> def000, iag_pbuf = 0xb7ded000, imap_pagenum = 593, iag_pbuf2 = 0xb7dee000, 
> imap_page
> num2 = 0, next = 0x0}, inum=2826141353, inopxd=
>       {len = 4804934, addr1 = 17, addr2 = 2082961255}, val=1, vol=0)
>     at log_work.c:2024
> 2024            imp = fsimap.imap_wsp[(iag_num + 1)].imap_data;

My bad!  This looks familiar:
http://sourceforge.net/mailarchive/message.php?msg_id=15464453
I knew how to fix it then, but I never did fix it.

> 
> Hope that helps (you and after that me and my data, too :)

Please try this patch:
Index: libfs/log_work.c
===================================================================
RCS file: /cvsroot/jfs/jfsutils/libfs/log_work.c,v
retrieving revision 1.25
diff -u -p -r1.25 log_work.c
--- libfs/log_work.c    22 Nov 2005 20:43:55 -0000      1.25
+++ libfs/log_work.c    4 Jun 2006 21:06:59 -0000
@@ -362,7 +362,7 @@ int findCommit(int32_t);
 int findPageRedo(int32_t, pxd_t, struct doblk **);
 int logredoInit(void);
 int markBmap(struct dmap *, pxd_t, int, int);
-int markImap(struct fsimap_lst, uint32_t, pxd_t, int, int);
+int markImap(struct fsimap_lst *, uint32_t, pxd_t, int, int);
 int updatePage(struct lrd *, int32_t);
 int saveExtDtPg(int32_t, int64_t);
 
@@ -2009,7 +2009,7 @@ int markBmap(struct dmap *dmappg, /* the
  *              track of which IAG pmap bits have already been updated
  *              by this routine.
  */
-int markImap(struct fsimap_lst fsimap, /* data for the inode table */
+int markImap(struct fsimap_lst *fsimap,        /* data for the inode table */
             uint32_t inum,     /* inode number */
             pxd_t inopxd,      /* inode extent descriptor this inode */
             int val,           /* 1 to allocate, 0 to free      */
@@ -2021,13 +2021,16 @@ int markImap(struct fsimap_lst fsimap,  /
 
        iag_num = INOTOIAG(inum);
 
-       imp = fsimap.imap_wsp[(iag_num + 1)].imap_data;
+       if (iag_num > fsimap->imap_page_count)
+               return -1;
+
+       imp = fsimap->imap_wsp[(iag_num + 1)].imap_data;
        if (imp == NULL) {      /* first touch to this IAG */
                rc = iagGet(vol, iag_num);
                if (rc != 0) {
                        return (rc);
                }
-               imp = fsimap.imap_wsp[(iag_num + 1)].imap_data;
+               imp = fsimap->imap_wsp[(iag_num + 1)].imap_data;
        }
        /* end first touch to this IAG */
        ino = inum & (INOSPERIAG - 1);
@@ -2803,7 +2806,7 @@ int updatePage(struct lrd *ld, int32_t l
                                 * FILESYSTEM_I
                                 */
                                if (ld->log.redopage.inode == FILESYSTEM_I) {
-                                       rc = markImap(vopen[vol].fsimap_lst,
+                                       rc = markImap(&vopen[vol].fsimap_lst,
                                                      
__le32_to_cpu(dip->di_number),
                                                      dip->di_ixpxd, allocate, 
vol);
                                        if (rc) {

> 
> Nico
> 
> P.S.: as always, please CC
> 
-- 
David Kleikamp
IBM Linux Technology Center



_______________________________________________
Jfs-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jfs-discussion

Reply via email to