[Bug 223015] [tmpfs] tmpfs does not support sparse files

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Oct 14 21:28:07 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223015

            Bug ID: 223015
           Summary: [tmpfs] tmpfs does not support sparse files
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: kwhite at site.uottawa.ca

When attempting to create a large sparse file on a tmpfs file system, I get
this message: "truncate: ... No space left on device"

It appears to work on a similarly sized mfs file system.

...keith

Sample test script output:

# sh t_tmpfs
=== tmpfs ===
truncate: /tmp/_trunc_/sparse: No space left on device
0 -rw-r--r--  1 root  wheel  0 Oct 14 17:24 /tmp/_trunc_/sparse
=== mfs ===
96 -rw-r--r--  1 root  wheel  2147483648 Oct 14 17:24 /tmp/_trunc_/sparse



Test script follows:

#!/bin/sh
#

DIR=/tmp/_trunc_
TUNIT=101
TFILE=sparse
SSIZE=16m
TSIZE=2g

exec 2>&1
mkdir $DIR || exit 1

echo "=== tmpfs ==="
mount -t tmpfs -osize=$SSIZE /tmp $DIR
truncate -s$TSIZE $DIR/$TFILE
ls -ls $DIR/$TFILE
umount $DIR

echo "=== mfs ==="
mount -t mfs -o-s=$SSIZE md$TUNIT $DIR
truncate -s$TSIZE $DIR/$TFILE
ls -ls $DIR/$TFILE
umount $DIR
mdconfig -du $TUNIT

rmdir $DIR

exit 0

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list