Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-3132

lfsck: failed to recreate /mnt/lustre/d0.lfsck/testfile.7 missing obj 0:12

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 1.8.9
    • Lustre 1.8.9
    • None
    • 3
    • 7605

    Description

      b1_8 lfsck test log shows

      lfsck 1.42.6.wc2 (10-Dec-2012)
      lfsck: ost_idx 0: pass1: check for duplicate objects
      lfsck: ost_idx 0: pass1 OK (20 files total)
      lfsck: ost_idx 0: pass2: check for missing inode objects
      [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.7 missing obj 0:12
      lfsck: ost_idx 0: pass2 ERROR: 1 dangling inodes found (21 files total)
      

      The maloo report is at https://maloo.whamcloud.com/test_sessions/61ecab6c-a051-11e2-898f-52540035b04c

      Attachments

        Issue Links

          Activity

            [LU-3132] lfsck: failed to recreate /mnt/lustre/d0.lfsck/testfile.7 missing obj 0:12
            emoly.liu Emoly Liu added a comment -

            patch landed.

            emoly.liu Emoly Liu added a comment - patch landed.
            emoly.liu Emoly Liu added a comment - http://review.whamcloud.com/#change,6181
            emoly.liu Emoly Liu added a comment -

            After looking into lfsck.c, I found something wrong in lfsck_recreate_obj().

            /* If an MDS file is missing an object recreate object using an ioctl call */
            static int lfsck_recreate_obj(int cmd, void *creat, struct ost_id *oi,
                                          __u32 ost_idx, char *path)
            {
            ......
                    rc = ioctl(fd, cmd, &creat); 
            

            Here, "creat" is already a pointer to struct ll_recreate_obj variable, so we should pass it into ioctl directly.

            I will push a patch later.

            emoly.liu Emoly Liu added a comment - After looking into lfsck.c, I found something wrong in lfsck_recreate_obj(). /* If an MDS file is missing an object recreate object using an ioctl call */ static int lfsck_recreate_obj( int cmd, void *creat, struct ost_id *oi, __u32 ost_idx, char *path) { ...... rc = ioctl(fd, cmd, &creat); Here, "creat" is already a pointer to struct ll_recreate_obj variable, so we should pass it into ioctl directly. I will push a patch later.
            emoly.liu Emoly Liu added a comment -

            I added some debugging info to ll_lov_recreate().

            @@ -2254,6 +2254,8 @@ static int ll_lov_recreate(struct inode *inode, obd_id id, obd_gr gr,
             out:
                     up(&lli->lli_size_sem);
                     OBDO_FREE(oa);
            +        printk("rc=%d: [%u] recreate missing obj "LPU64":"LPU64"\n",
            +                rc, (__u32)ost_idx, id, gr);
                     return rc;
             }
            

            lfsck output showed that there were 5 dangling inodes,

            lfsck: ost_idx 0: pass2: check for missing inode objects
            [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.1 missing obj 0:34
            [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.3 missing obj 0:35
            [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.5 missing obj 0:36
            [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.7 missing obj 0:37
            [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.9 missing obj 0:38
            lfsck: ost_idx 0: pass2 ERROR: 5 dangling inodes found (76 files total)
            

            but the debugging info showed ost_idx and id in struct ll_recreate_obj passed from lfsck_recreate_obj() by ioctl is wrong.

            rc=-22: [0] recreate missing obj 47571424239216:0
            rc=-22: [0] recreate missing obj 47571424239216:0
            rc=-22: [0] recreate missing obj 47571424239216:0
            rc=-22: [0] recreate missing obj 47571424239216:0
            rc=-22: [0] recreate missing obj 47571424239216:0
            

            I will investigate it.

            emoly.liu Emoly Liu added a comment - I added some debugging info to ll_lov_recreate(). @@ -2254,6 +2254,8 @@ static int ll_lov_recreate(struct inode *inode, obd_id id, obd_gr gr, out: up(&lli->lli_size_sem); OBDO_FREE(oa); + printk( "rc=%d: [%u] recreate missing obj " LPU64 ":" LPU64 "\n" , + rc, (__u32)ost_idx, id, gr); return rc; } lfsck output showed that there were 5 dangling inodes, lfsck: ost_idx 0: pass2: check for missing inode objects [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.1 missing obj 0:34 [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.3 missing obj 0:35 [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.5 missing obj 0:36 [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.7 missing obj 0:37 [0]: failed to recreate /mnt/lustre/d0.lfsck/testfile.9 missing obj 0:38 lfsck: ost_idx 0: pass2 ERROR: 5 dangling inodes found (76 files total) but the debugging info showed ost_idx and id in struct ll_recreate_obj passed from lfsck_recreate_obj() by ioctl is wrong. rc=-22: [0] recreate missing obj 47571424239216:0 rc=-22: [0] recreate missing obj 47571424239216:0 rc=-22: [0] recreate missing obj 47571424239216:0 rc=-22: [0] recreate missing obj 47571424239216:0 rc=-22: [0] recreate missing obj 47571424239216:0 I will investigate it.

            People

              emoly.liu Emoly Liu
              emoly.liu Emoly Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: