[Top] [All Lists]

Re: file preallocation without unwritten flag being set

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: file preallocation without unwritten flag being set
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 14 May 2009 10:34:22 +1000
Cc: p v <pvlogin@xxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <4A0B6325.8000706@xxxxxxxxxxx>
References: <283244.29270.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <4A0A0E76.6000701@xxxxxxxxxxx> <618437.93111.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <4A0A55E0.4010202@xxxxxxxxxxx> <705795.15734.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20090513222823.GL16929@xxxxxxxxxxxxxxxx> <502709.63746.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <4A0B6325.8000706@xxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Wed, May 13, 2009 at 07:17:41PM -0500, Eric Sandeen wrote:
> p v wrote:
> > with the default mkfs and mount options. I created the fs, cleared
> > extflg from the superblocks and run xfs_io to resvsp the space. Then
> > I run truncate and truncate decided to initialize the extents to zero
> > and since it's 10TB it's going to take a while (can't reset as it's a
> > remote machine and xfs_io is looping in the kernel ...). It didn't do
> try truncate then resvsp; TBH not sure why it should matter though :)

Uninitialised extents beyond EOF get zeroed when EOF is moved.
if you set the set before preallocation, then there are no extents
to zero. FWIW, if they have the unwritten flag, this zeroing does not occur.

> > I am a little bit lost about the comment regarding the page caches. I
> > unmounted the filesystem before running xfs_db. Shouldn't that flush
> > pages, buffers, ...? I assume that xfs_db goes directly to the device
> > so if the fs was unmounted then the device should be up to date?
> The device is uptodate but the bdev address space may not be.
> Unmounting will flush the filesytem address space, but not the block
> device address space.

Not exactly the problem, though. XFS opens it's own device address space
when mounting - not the address space you get by opening /dev/sdX.
xfs_db uses the address space associated with /dev/sdX. hence
if you do:

# xfs_db /dev/sdc
# mount /dev/sdc
<do some changes>
# unmount /dev/sdc
# xfs_db /dev/sdc

The second invocation of xfs_db will not see any of the changes that
occured to the filesystem because it will read from the buffers
cached on /dev/sdc during the first invocation.

This is the same problem Grub has....


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>