3 # Problem Report kern/92272 : [ffs] [hang] Filling a filesystem while creating
4 # a snapshot on it locks the system
6 # John Kozubik <john@kozubik.com>
8 # If a filesystem is completely full (approaching 110% in `df` output on
9 # most systems), mksnap_ffs will refuse to begin a snapshot for that reason.
10 # There seem to be no negative consequences.
12 # However, if the filesystem is not quite completely full, mksnap_ffs will
13 # (correctly) begin creating the snapshot as expected. If, during the course
14 # of snapshot creation, the filesystem being snapshotted becomes full,
15 # mksnap_ffs will exit with an error exactly as it does if it is started on
16 # an already full filesystem.
18 # However, several hours later, the system will lock up completely. It still
19 # responds to pings, and open connections to and from it remain in that
20 # state, but they cannot be used and new connections cannot be established.
22 # *** This script does not provoke the problem. ***
24 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
28 rm -f $root/.snap/pho $root/big $root/big2
29 trap "rm -f $root/.snap/pho $root/big $root/big2" 0
30 free=`df $root | tail -1 | awk '{print $4}'`
31 dd if=/dev/zero of=$root/big bs=1m count=$(( free / 1024 - 90)) > /dev/null 2>&1
34 for i in `jot 1024`; do
36 nice -20 mksnap_ffs $root $root/.snap/pho &
37 dd if=/dev/zero of=$root/big2 bs=1m > /dev/null 2>&1
39 [ -f $root/.snap/pho ] && exit 0
40 rm -f $root/.snap/pho $root/big2
44 rm -f $root/.snap/pho $root/big $root/big2