4 # Test out ENOSPC flushing on small filesystems.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2009 Dave Chinner
8 #-----------------------------------------------------------------------
11 owner=david@fromorbit.com
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
20 # get standard environment, filters and checks
24 # real QA test starts here
30 _scratch_mkfs_xfs -d size=16m -b size=512 >/dev/null
33 # on a 16MB filesystem, there's 32768x512byte blocks. used is:
35 # - 32+1 for the root inode cluster
36 # - 4 for the AG header
37 # - 2 for free space btrees
39 # - min(%5, 1024) = 1024 blocks for the reserve pool
40 # - about 15 blocks I can't account for right now.
41 # That leaves ~26,745 blocks free to use.
43 # Writing the following three files fill the fs almost exactly.
45 # $ df -k /mnt/scratch
46 # Filesystem 1K-blocks Used Available Use% Mounted on
47 # /dev/ubdc 13912 13908 4 100% /mnt/scratch
49 dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=25000 2>&1 | _filter_dd
50 dd if=/dev/zero of=$SCRATCH_MNT/fred2 bs=512 count=500 2>&1 | _filter_dd
51 dd if=/dev/zero of=$SCRATCH_MNT/fred3 bs=512 count=245 2>&1 | _filter_dd
52 rm -f $SCRATCH_MNT/fred*
55 # now try a single file of that size
56 dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=26745 2>&1 | _filter_dd
57 #rm -f $SCRATCH_MNT/fred*
59 echo "*** one file, a few bytes at a time"
60 # now try a single file of that size
61 dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=$[26745/15*512] 2>&1 | _filter_dd