On Mon, Mar 10, 2008 at 11:21 PM, David Chinner <dgc@xxxxxxx> wrote:
> You've got a filesystem with stripe alignment set. In xfs_ialloc_ag_alloc()
> we attempt inode allocation by the following rules:
>
> 1. a) If we haven't previously allocated inodes, fall through to 2.
> b) If we have previously allocated inode, attempt to allocate next
> to the last inode chunk.
>
> 2. If we do not have an extent now:
> a) if we have stripe alignment, try with alignment
> b) if we don't have stripe alignment try cluster alignment
>
> 3. If we do not have an extent now:
> a) if we have stripe alignment, try with cluster alignment
> b) no stripe alignment, turn off alignment.
>
> 4. If we do not have an extent now: FAIL.
>
> Note the case missing from the stripe alignment fallback path - it does not
> try without alignment at all. That means if all those extents large enough
> that we found above are not correctly aligned, then we will still fail
> to allocate an inode chunk. if all the AGs are like this, then we'll
> fail to allocate at all and fall out of xfs_dialloc() through the last
> fragment I quoted above.
>
> As to the shutdown that this triggers - the attempt to allocate dirties
> the AGFL and the AGF by moving free blocks into the free list for btree
> splits and cancelling a dirty transaction results in a shutdown.
>
> Now, to test this theory. ;) Luckily, it's easy to test. mount the
> filesystem with the mount option "noalign" and rerun the mkdir test.
> If it is an alignment problem, then setting noalign will prevent
> this ENOSPC and shutdown as the filesystem will be able to allocate
> more inodes.
>
> Can you test this for me, Christian?
Thanks. Unfortunately noalign didn't solve my problem:
# mount | grep /data
/dev/sdb1 on /data type xfs (rw,noatime,noalign,logbufs=8,nobarrier)
# mkdir /data/test
results in:
Filesystem "sdb1": XFS internal error xfs_trans_cancel at line 1163 of
file fs/xfs/xfs_trans.c. Caller 0xc021a010
Pid: 17889, comm: mkdir Not tainted 2.6.24.3FC #7
[<c0212678>] xfs_trans_cancel+0x5d/0xe6
[<c021a010>] xfs_mkdir+0x45a/0x493
[<c021a010>] xfs_mkdir+0x45a/0x493
[<c01cbb8f>] xfs_acl_vhasacl_default+0x33/0x44
[<c0222d70>] xfs_vn_mknod+0x165/0x243
[<c0217b9e>] xfs_access+0x2f/0x35
[<c0222e6d>] xfs_vn_mkdir+0x12/0x14
[<c016057b>] vfs_mkdir+0xa3/0xe2
[<c0160644>] sys_mkdirat+0x8a/0xc3
[<c016069c>] sys_mkdir+0x1f/0x23
[<c01025ee>] syscall_call+0x7/0xb
[<c03b0000>] atm_reset_addr+0xd/0x83
=======================
xfs_force_shutdown(sdb1,0x8) called from line 1164 of file
fs/xfs/xfs_trans.c. Return address = 0xc0212690
Filesystem "sdb1": Corruption of in-memory data detected. Shutting
down filesystem: sdb1
Please umount the filesystem, and rectify the problem(s)
I'll try to add some printk statements to the codepaths you mentioned,
and see where it leads.
Christian
|