From: David Chinner <dgc@sgi.com>
To: Jan Derfinak <ja@mail.upjs.sk>
Cc: David Chinner <dgc@sgi.com>, xfs@oss.sgi.com
Subject: Re: Differences in mkfs.xfs and xfs_info output.
Date: Mon, 18 Feb 2008 13:07:04 +1100 [thread overview]
Message-ID: <20080218020704.GD155407@sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0802180113560.4514@alienAngel.home.sk>
On Mon, Feb 18, 2008 at 01:17:21AM +0100, Jan Derfinak wrote:
> On Mon, 18 Feb 2008, David Chinner wrote:
>
> > Is this reproducable with simple tests? e.g. mkfs, mount, unmount
> > check? or doing some simple things like creating some files
>
> One more test (no FS activity, only mount, umount sequence):
> # /root/mkfs.xfs -f /dev/loop0
> meta-data=/dev/loop0 isize=256 agcount=4, agsize=64000 blks
> = sectsz=512 attr=2
> data = bsize=4096 blocks=256000, imaxpct=25
> = sunit=0 swidth=0 blks
> naming =version 2 bsize=4096
> log =internal log bsize=4096 blocks=1200, version=2
> = sectsz=512 sunit=0 blks, lazy-count=1
> realtime =none extsz=4096 blocks=0, rtextents=0
> # xfs_check /dev/loop0
> # mount /dev/loop0 /mnt/usb
> # umount /mnt/usb
> # xfs_check /dev/loop0
> sb_fdblocks 253756, counted 254780
> # mount /dev/loop0 /mnt/usb
> # umount /mnt/usb
> # xfs_check /dev/loop0
> sb_fdblocks 252732, counted 254780
It is clear that it is dropping by 1024 blocks per mount/unmount
sequence. That sounds like the reserved space for transactions at
ENOSPC not being put back in before the superblock is finally
written to disk on unmount. The reserved space defaults to 1024
blocks. Does your kernel tree have this code
in it in xfs_unmountfs():
1272 /*
1273 * Unreserve any blocks we have so that when we unmount we don't account
1274 * the reserved free space as used. This is really only necessary for
1275 * lazy superblock counting because it trusts the incore superblock
1276 * counters to be aboslutely correct on clean unmount.
1277 *
1278 * We don't bother correcting this elsewhere for lazy superblock
1279 * counting because on mount of an unclean filesystem we reconstruct the
1280 * correct counter value and this is irrelevant.
1281 *
1282 * For non-lazy counter filesystems, this doesn't matter at all because
1283 * we only every apply deltas to the superblock and hence the incore
1284 * value does not matter....
1285 */
1286 resblks = 0;
1287 xfs_reserve_blocks(mp, &resblks, NULL);
FWIW, i wonder if it has something to do with your /dev/loop0
setup. How have you set this up? Using a raw file and using
it for mkfs/mount/unmount/check does not show the problem:
$ sudo mkfs.xfs -d name=fs_file
meta-data=fs_file isize=256 agcount=4, agsize=655424 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=2621696, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
$ sudo xfs_check -f ./fs_file
$ sudo mount -o loop fs_file /mnt/fred
$ sudo umount /mnt/fred
$ sudo xfs_check -f ./fs_file
$ sudo mount -o loop fs_file /mnt/fred
$ sudo umount /mnt/fred
$ sudo xfs_check -f ./fs_file
$
If you run your test on a similar setup, do you see the problem
still?
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2008-02-18 2:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-16 1:34 Differences in mkfs.xfs and xfs_info output Jan Derfinak
2008-02-16 4:10 ` Eric Sandeen
2008-02-16 4:33 ` Eric Sandeen
2008-02-16 4:36 ` Eric Sandeen
2008-02-16 4:41 ` Eric Sandeen
2008-02-16 7:40 ` David Chinner
2008-02-16 21:49 ` Jan Derfinak
2008-02-16 22:41 ` Jan Derfinak
2008-02-17 13:41 ` Jan Derfinak
2008-02-17 23:06 ` David Chinner
2008-02-18 0:12 ` Jan Derfinak
2008-02-19 0:04 ` Jan Derfinak
2008-02-19 0:20 ` David Chinner
2008-02-19 1:20 ` Jan Derfinak
2008-02-19 1:46 ` David Chinner
2008-02-19 2:10 ` Jan Derfinak
2008-02-19 14:05 ` Jan Derfinak
2008-02-20 5:42 ` David Chinner
2008-03-16 22:44 ` Jan Derfinak
2008-02-18 0:17 ` Jan Derfinak
2008-02-18 2:07 ` David Chinner [this message]
2008-02-18 6:56 ` ja
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=20080218020704.GD155407@sgi.com \
--to=dgc@sgi.com \
--cc=ja@mail.upjs.sk \
--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