public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: "Christian Røsnes" <christian.rosnes@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: XFS internal error xfs_trans_cancel at line 1150 of file fs/xfs/xfs_trans.c
Date: Mon, 10 Mar 2008 11:08:09 +1100	[thread overview]
Message-ID: <20080310000809.GU155407@sgi.com> (raw)
In-Reply-To: <1a4a774c0803070319j1eb8790ek3daae4a16b3e6256@mail.gmail.com>

On Fri, Mar 07, 2008 at 12:19:28PM +0100, Christian Røsnes wrote:
> >  Actually, a single mkdir command is enough to trigger the filesystem
> >  shutdown when its 99% full (according to df -k):
> >
> >  /data# mkdir test
> >  mkdir: cannot create directory `test': No space left on device

Ok, that's helpful ;)

So, can you dump the directory inode with xfs_db? i.e.

# ls -ia /data

The directory inode is the inode at ".", and if this is the root of
the filesystem it will probably be 128.

Then run:

# xfs_db -r -c 'inode 128' -c p /dev/sdb1

> >  --------
> >  meta-data=/dev/sdb1              isize=512    agcount=16, agsize=4476752 blks
> >          =                       sectsz=512   attr=0
> >  data     =                       bsize=4096   blocks=71627792, imaxpct=25
> >          =                       sunit=16     swidth=32 blks, unwritten=1
> >  naming   =version 2              bsize=4096
> >  log      =internal               bsize=4096   blocks=32768, version=2
> >          =                       sectsz=512   sunit=16 blks, lazy-count=0
> >  realtime =none                   extsz=65536  blocks=0, rtextents=0
> >
> >  xfs_db -r -c 'sb 0' -c p /dev/sdb1
> >  ----------------------------------
.....
> >  fdblocks = 847484

Apparently there are still lots of free blocks. I wonder if you are out of
space in the metadata AGs.

Can you do this for me:

-------
#!/bin/bash

for i in `seq 0 1 15`; do
	echo freespace histogram for AG $i
	xfs_db -r -c "freesp -bs -a $i" /dev/sdb1
done
------

> Instrumenting the code, I found that this occurs on my system when I
> do a 'mkdir /data/test' on the partition in question:
> 
> in xfs_mkdir  (xfs_vnodeops.c):
> 
>   error = xfs_dir_ialloc(&tp, dp, mode, 2,
>                         0, credp, prid, resblks > 0,
>                 &cdp, NULL);
> 
>         if (error) {
>                 if (error == ENOSPC)
>                         goto error_return;   <=== this is hit and then
> execution jumps to error_return
>                 goto abort_return;
>         }

Ah - you can ignore my last email, then. You're already one step ahead
of me ;)

This does not appear to be the case I was expecting, though I can
see how we can get an ENOSPC here with plenty of blocks free - none
are large enough to allocate an inode chunk. What would be worth
knowing is the value of resblks when this error is reported.

This tends to imply we are returning an ENOSPC with a dirty
transaction. Right now I can't see how that would occur, though
the fragmented free space is something I can try to reproduce with.

> Is this the correct behavior for this type of situation: mkdir command
> fails due to no available space on filesystem,
> and xfs_mkdir goes to label error_return  ? (And after this the
> filesystem is shutdown)

The filesystem should not be shutdown here. We need to trace through
further to the source of the error....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2008-03-10  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13 10:51 XFS internal error xfs_trans_cancel at line 1150 of file fs/xfs/xfs_trans.c Christian Røsnes
2008-02-13 11:04 ` Justin Piszcz
2008-02-13 11:44   ` Christian Røsnes
2008-02-13 21:45 ` David Chinner
2008-02-14  8:41   ` Christian Røsnes
2008-03-05 13:53   ` Christian Røsnes
2008-03-06 11:10     ` Christian Røsnes
2008-03-07 11:19       ` Christian Røsnes
2008-03-10  0:08         ` David Chinner [this message]
2008-03-10  8:34           ` Christian Røsnes
2008-03-10 10:02             ` Christian Røsnes
2008-03-10 22:21             ` David Chinner
2008-03-11  8:08               ` Christian Røsnes
2008-03-11  9:34                 ` David Chinner
2008-03-11 11:19                   ` Christian Røsnes
2008-03-11 12:21                     ` David Chinner
2008-03-11 12:39                       ` Christian Røsnes
     [not found]                         ` <20080312232425.GR155407@sgi.com>
     [not found]                           ` <1a4a774c0803130114l3927051byd54cd96cdb0efbe7@mail.gmail.com>
     [not found]                             ` <20080313090830.GD95344431@sgi.com>
     [not found]                               ` <1a4a774c0803130214x406a4eb9wfb8738d1f503663f@mail.gmail.com>
     [not found]                                 ` <20080313092139.GF95344431@sgi.com>
     [not found]                                   ` <1a4a774c0803130227l2fdf4861v21183b9bd3e7ce8d@mail.gmail.com>
     [not found]                                     ` <20080313113634.GH95344431@sgi.com>
     [not found]                                       ` <1a4a774c0803130446x609b9cb2mf3da323183c35606@mail.gmail.com>
2008-03-13 14:53                                         ` David Chinner
2008-03-14  9:02                                           ` Christian Røsnes
2008-03-09 22:59     ` David Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080310000809.GU155407@sgi.com \
    --to=dgc@sgi.com \
    --cc=christian.rosnes@gmail.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox