]> git.neil.brown.name Git - LaFS.git/commitdiff
Finished with Frankfurt.
authorNeil Brown <neilb@notabene.brown>
Fri, 12 Sep 2008 21:17:04 +0000 (07:17 +1000)
committerNeil Brown <neilb@notabene.brown>
Fri, 12 Sep 2008 21:17:04 +0000 (07:17 +1000)
README
block.c
dir-avl.c
index.c
modify.c
test/go

diff --git a/README b/README
index 284d37f35dc16596cda9ce75e0ac6b8fbd166833..a3daf004e4b0709f7645a0c2e4d08129620e8e45 100644 (file)
--- a/README
+++ b/README
@@ -1592,54 +1592,57 @@ FIXME when I "rm [b-z]*" it waits for writeback on something???
     Think that is fixed.
 
   Two problems.
-    1/ see above:  rm x/y; rmdir x -> BUG
-    2/ Spins on 'CURRENT=1'
+    1/ see above:  rm x/y; rmdir x -> BUG - FIXED
+    2/ Spins on 'CURRENT=1' ??
     3/ if alloc_space gives EAGAIN while deleting, we don't survive.
     4/ When I create/delete a file, ablocks_used increments by one.
-
-BUG: unable to handle kernel NULL pointer dereference at virtual address 0000005c
- printing eip:
-d0a1ec2e
-*pde = 00000000
-Oops: 0000 [#1]
+    5/ open_namei (for dd) got caught on a mutex_lock.
+
+CLEANABLE: 0/5 y=32777 u=7
+CLEANABLE: 0/6 y=32770 u=2
+CLEANABLE: 0/7 y=32769 u=1
+XX
+CLEANABLE: 0/8 y=0 u=0
+CLEANER: enough cleaning with 0 segments
+df: tot=4608 free=4538 avail=3071(3517-446) cb=10 pb=0 ab=60
+df: tot=4608 free=4538 avail=3071(3517-446) cb=10 pb=0 ab=60
+------------[ cut here ]------------
+kernel BUG at /home/neilb/work/nfsbrick/fs/module/index.c:1711!
+invalid opcode: 0000 [#1]
 Modules linked in: lafs
 CPU:    0
-EIP:    0060:[<d0a1ec2e>]    Not tainted VLI
-EFLAGS: 00000296   (2.6.23 #6)
-EIP is at lafs_allocated_block+0x35a/0x480 [lafs]
-eax: 00000000   ebx: ce8e1af0   ecx: cff680c4   edx: 00000000
-esi: 00000000   edi: 00000019   ebp: cf001cc8   esp: cf001c88
+EIP:    0060:[<d0a1ed3f>]    Not tainted VLI
+EFLAGS: 00000246   (2.6.23 #6)
+EIP is at lafs_allocated_block+0x46b/0x487 [lafs]
+eax: 00000000   ebx: cee7fd20   ecx: 000031b1   edx: 00000000
+esi: 00000000   edi: 00000005   ebp: ce927de8   esp: ce927da8
 ds: 007b   es: 007b   fs: 0000  gs: 0033  ss: 0068
-Process dd (pid: 1289, ti=cf000000 task=cf76ec90 task.ti=cf000000)
-Stack: 00000281 00000000 00000000 00000000 00000000 00000001 ce8914f0 00000000 
-       00000000 00000000 cff68000 cff680b4 00000001 ce8e1af0 00000281 cff68000 
-       cf001ce8 d0a20661 00000000 00000000 cf001cf8 ce8e1af0 00000000 00000000 
+Process rm (pid: 1338, ti=ce926000 task=cf7e2000 task.ti=ce926000)
+Stack: 00000a2e 00000000 00000000 00000000 00000000 00000000 ce8cd920 00000000 
+       00000000 00000000 cff68000 cff680b4 00000001 cee7fd20 cff68000 00000000 
+       ce927e00 d0a20607 00000000 00000000 cee7fd20 00000000 ce927e34 d0a20c6f 
 Call Trace:
  [<c0202bca>] show_trace_log_lvl+0x1a/0x2f
  [<c0202c7a>] show_stack_log_lvl+0x9b/0xa3
  [<c0202e36>] show_registers+0x1b4/0x286
  [<c0202ff0>] die+0xe8/0x1b5
- [<c020c31b>] do_page_fault+0x49f/0x56c
+ [<c0203146>] do_trap+0x89/0xa2
+ [<c020341e>] do_invalid_op+0x88/0x92
  [<c037ddea>] error_code+0x6a/0x70
- [<d0a20661>] lafs_erase_dblock+0x142/0x162 [lafs]
- [<d0a20ccb>] lafs_invalidate_page+0xa1/0x111 [lafs]
+ [<d0a20607>] lafs_erase_dblock+0xe0/0xfe [lafs]
+ [<d0a20c6f>] lafs_invalidate_page+0xa1/0x111 [lafs]
  [<c023ba4d>] do_invalidatepage+0x19/0x1c
  [<c023bdd2>] truncate_complete_page+0x27/0x40
  [<c023beb4>] truncate_inode_pages_range+0xc9/0x2c2
  [<c023c0c7>] truncate_inode_pages+0x1a/0x1f
- [<c0241482>] vmtruncate+0x90/0x136
- [<c0260a5c>] inode_setattr+0x2f/0xfe
- [<d0a1c7f8>] lafs_setattr+0x67/0x9f [lafs]
- [<c0260c22>] notify_change+0xf7/0x211
- [<c024f5e2>] do_truncate+0x60/0x79
- [<c02570cf>] may_open+0x180/0x197
- [<c0258f42>] open_namei+0x23e/0x517
- [<c024eea6>] do_filp_open+0x26/0x3b
- [<c024eefe>] do_sys_open+0x43/0xc7
- [<c024efba>] sys_open+0x1c/0x1e
+ [<d0a1d72c>] lafs_delete_inode+0x111/0x274 [lafs]
+ [<c0260216>] generic_delete_inode+0x61/0xcb
+ [<c0260292>] generic_drop_inode+0x12/0x12c
+ [<c025f965>] iput+0x63/0x66
+ [<c0258644>] do_unlinkat+0xbd/0x101
+ [<c0258698>] sys_unlink+0x10/0x12
  [<c02025c2>] syscall_call+0x7/0xb
  =======================
-Code: a3 d0 00 74 0c c7 04 24 9e f4 a2 d0 e8 c0 45 7f ef 8b 75 e8 81 c6 b4 00 00 00 89 75 ec 8b 45 ec e8 5f eb 95 ef 8b 45 dc 8b 55 dc <8b> 40 5c 89 45 f0 b8 01 00 00 00 2b 45 f0 6b c0 f0 8d 4c 02 60 
-EIP: [<d0a1ec2e>] lafs_allocated_block+0x35a/0x480 [lafs] SS:ESP 0068:cf001c88
-
+Code: c7 42 58 00 00 00 00 89 82 e0 00 00 00 e9 fa fe ff ff 8b 55 dc 8b 45 e8 e8 b8 53 00 00 8b 73 18 85 f6 89 75 dc 0f 85 e1 fe ff ff <0f> 0b eb fe 0f 0b eb fe 8b 45 dc 31 d2 e8 61 f4 ff ff 31 c0 83 
+EIP: [<d0a1ed3f>] lafs_allocated_block+0x46b/0x487 [lafs] SS:ESP 0068:ce927da8
 
diff --git a/block.c b/block.c
index f74a0f43af9eadbf15b707b3916de7d8f7fc7b77..e7921939b527434e81f3d55c29a5ea5f2cd29577 100644 (file)
--- a/block.c
+++ b/block.c
@@ -423,6 +423,7 @@ lafs_erase_dblock(struct datablock *b)
        if (b->b.physaddr == 0 &&
            b->b.fileaddr == 0 &&
            LAFSI(b->b.inode)->depth == 0) {
+#if 0
                /* This lives in the inode, so we cannot drop the
                 * block, we have to zero it.
                 */
@@ -430,7 +431,23 @@ lafs_erase_dblock(struct datablock *b)
                memset(buf, 0, (1<<b->b.inode->i_blkbits));
                unmap_dblock(b, buf);
                return;
+#else
+               /* We need to clear out the index block that this
+                * block lives in.
+                */
+               lafs_clear_index(LAFSI(b->b.inode)->iblock);
+               clear_bit(B_PhysValid, &b->b.flags);
+                       
+#endif
        }
+       /* We aren't dirtying the block, but we do need to write it,
+        * so moving ICredit to UnincCredit for consistency.
+        * It won't be needed, so maybe I shouldn't need to bother?
+        */
+       if (!test_and_set_bit(B_UnincCredit, &b->b.flags))
+               if (!test_and_clear_bit(B_ICredit, &b->b.flags))
+                       BUG(); // ICredit should be set before we dirty a block.
+
        lafs_iolock_block(&b->b);
        clear_bit(B_Valid, &b->b.flags);
        if (test_and_clear_bit(B_Dirty, &b->b.flags))
index 682526c82c562dc7364d3e46ff68eda3ccd8c967..888a5b135102ee97924553b9bef92ee71bf04d77 100644 (file)
--- a/dir-avl.c
+++ b/dir-avl.c
@@ -871,14 +871,15 @@ static void xprintk(char *block, int psz, char *s, int a, int b, int c, int d)
        BUG();
 }
        
-static int dir_check_depth(char *block, int psz, int p)
+static int dir_check_depth(char *block, int psz, int p, int depth)
 {
        struct dirpiece *dp = dpaddr(block,p);
        int b,f;
 
+       BUG_ON(depth>10);
        if (p == 0) return 0;
-       b = dir_check_depth(block, psz, dp->next[0]);
-       f = dir_check_depth(block, psz, dp->next[1]);
+       b = dir_check_depth(block, psz, dp->next[0], depth+1);
+       f = dir_check_depth(block, psz, dp->next[1], depth+1);
        if (b == f) {
                if (dp->longer != Neither)
                        xprintk(block,psz, "... %d - b=%d f=%d lgr=%d\n", p, b, f, dp->longer);
@@ -901,7 +902,7 @@ static int dir_check_depth(char *block, int psz, int p)
 static void dir_check_balance(char *block, int psz)
 {
        struct dirheader *dh = (struct dirheader*) block;
-       dir_check_depth(block, psz, dh->root);
+       dir_check_depth(block, psz, dh->root, 0);
 }
 
 static void dir_print_piece(char *block, int psz, int piece, int depth, int dir)
diff --git a/index.c b/index.c
index 1f837e4c365c936c8becda327d4179a43c347a9a..a48d55474fe5baaf4dba9e02473ce83d63d63515 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1534,6 +1534,8 @@ int lafs_allocated_block(struct fs *fs, struct block *blk, u64 phys)
        dprintk("Allocated %d/%d -> %llu\n",
               (int)blk->inode->i_ino, (int)blk->fileaddr, phys);
 
+       /* FIXME if phys is 0, I shouldn't need uninc credit.  Should
+        * I not demand it?  See comment in lafs_erase_dblock */
        if(!test_bit(B_UnincCredit, &blk->flags))
                printk("no uninc credit %s\n", strblk(blk));
        if(!test_bit(B_Dirty, &blk->flags) &&
index e3ad3e2785100bd8479625febc202d5694b6d950..cdfbe2822f2454a49daf1500ff25872d2c93b655 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -306,9 +306,9 @@ void lafs_clear_index(struct indexblock *ib)
        buf = map_iblock(ib);
        memset(buf+offset, 0, len - offset);
 
-       if (ib->depth <= 1)
+       if (ib->depth == 1)
                *(u16*)(buf+offset) = cpu_to_le16(IBLK_INDIRECT);
-       else
+       else if (ib->depth > 1)
                *(u16*)(buf+offset) = cpu_to_le16(IBLK_INDEX);
        unmap_iblock(ib, buf);
 }
diff --git a/test/go b/test/go
index ff896e9eafc03d51606f907887ce609f36e3036a..35bd46cc2ab58781a196e78d50b3c878337782ef 100644 (file)
--- a/test/go
+++ b/test/go
@@ -156,3 +156,11 @@ done
 sync
 ls -lau /mnt/1/adir
 rm /mnt/1/nbfile-1*
+
+rm /mnt/1/adir/* /mnt/1/*
+rmdir /mnt/1/adir
+sync
+for i in `seq 1 30`
+do
+  dd if=/dev/zero of=/mnt/1/a count=100 ; rm /mnt/1/a; df /mnt/1
+done