-touch /mnt/lustre || exit 2
-cp /etc/hosts /mnt/lustre || exit 3
-diff -u /etc/hosts /mnt/lustre/hosts || exit 4
-
-# ok, that hopefully worked, so let's do a little more
-FILES=`find /etc -type f`
-echo "copying files from /etc to /mnt/lustre"
-tar cf - $FILES | tar xf - -C /mnt/lustre || exit 10
-
-echo "comparing newly copied files"
-for f in $FILES; do
- diff -q $f /mnt/lustre/$f || ERROR=11
-done
+START=`date +%s`
+log "touching $MOUNT at `date`"
+touch $MOUNT || error "can't touch $MOUNT" 2
+HOSTS=$MOUNT/hosts.$$
+TRUNCSIZE=123
+
+if [ $COUNT -gt 10 -o $COUNT -eq 0 ]; then
+ # this will cause the following cp to trigger bug #620096
+ log "create an empty file $HOSTS"
+ mcreate $HOSTS
+ log "copying /etc/hosts to $HOSTS"
+ cp /etc/hosts $HOSTS || error "can't cp /etc/hosts to $HOSTS" 3
+ log "comparing /etc/hosts and $HOSTS"
+ diff -u /etc/hosts $HOSTS || error "$HOSTS different" 4
+ log "renaming $HOSTS to $HOSTS.ren"
+ mv $HOSTS $HOSTS.ren || error "can't rename $HOSTS to $HOSTS.ren" 5
+ log "copying /etc/hosts to $HOSTS again"
+ cp /etc/hosts $HOSTS || error "can't cp /etc/hosts to $HOSTS again" 6
+ log "truncating $HOSTS"
+ > $HOSTS || error "can't truncate $HOSTS" 8
+ log "removing $HOSTS"
+ rm $HOSTS || error "can't remove $HOSTS" 9
+ cp /etc/hosts $HOSTS.2 || error "can't cp /etc/hosts to $HOSTS.2" 7
+ log "truncating $HOSTS.2 to $TRUNCSIZE bytes"
+ $TRUNCATE $HOSTS.2 $TRUNCSIZE
+fi
+
+DST=$MOUNT/runtest.$$
+# let's start slowly here...
+log "creating $DST"
+mkdir $DST || error "can't mkdir $DST" 10