xfs
[Top] [All Lists]

RE: XFS Preallocation

To: Dave Chinner <david@xxxxxxxxxxxxx>, Jef Fox <jef.fox@xxxxxxxxxx>
Subject: RE: XFS Preallocation
From: Peter Vajgel <pv@xxxxxx>
Date: Tue, 1 Feb 2011 04:45:09 +0000
Accept-language: en-US
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
In-reply-to: <20110129001700.GZ21311@dastard>
References: <155CAEA5D902E7429569DD197567724A01534D42@xxxxxxxxxxxxxxxxxxx> <20110128045205.GR21311@dastard> <155CAEA5D902E7429569DD197567724A01534D60@xxxxxxxxxxxxxxxxxxx> <20110129001700.GZ21311@dastard>
Thread-index: Acu+pyslMT8bBaoITbmmG6aQZJGIGgAadf3QAB748QAAHBqRwA==
Thread-topic: XFS Preallocation
> Preallocation is the only option. Allowing preallocation without marking 
> extents as unwritten opens a massive security hole (i.e.
> exposes stale data) so I say no to any request for addition of such 
> functionality (and have for years).

How about opening this option to at least root (root can already read the 
device anyway)?. There are cases when creating large files without writing to 
them is important. A good example is testing xfs overhead when doing a specific 
workload (like random reads) to large files. In this case we want to hit the 
disk on every request. Currently we have a workaround (below) but official 
support would be preferable.

--pv


# create_xfs_files

dev=$1
mntpt=$2
dircount=$3
filecount=$4
size=$5

# Umount.
umount $2

# Create the fs.
mkfs -t xfs -f -d unwritten=0,su=256k,sw=10 -l su=256k -L "/hay" $dev

# Clear unwritten flag - current xfs ignores this flag
typeset -i agcount=$(xfs_db -c "sb" -c "print" $dev | grep agcount)
typeset -i i=0
while [[ $i != $agcount ]]
do
  xfs_db -x -c "sb $i" -c "write versionnum 0xa4a4" $dev
  i=i+1
done

# Mount the filesystem.
mount -t xfs -o nobarrier,noatime,nodiratime,inode64,allocsize=1g $dev $mntpt

i=0
while [[ $i != $dircount ]]
do
  mkdir $mntpt/dir$i
  typeset -i j=0
  while [[ $j != $filecount ]]
  do
    file=$mntpt/dir$i/file$j
    xfs_io -f -c "resvsp 0 $size" $file
    inum=$(ls -i $file | awk '{print $1}')
    umount $mntpt
    xfs_db -x -c "inode $inum" -c "write core.size $size" $dev
    mount -t xfs -o nobarrier,noatime,nodiratime,inode64,allocsize=1g $dev 
$mntpt
    j=j+1
  done
  i=i+1
done

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