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
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.
*/
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))
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);
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)