There is some dubious error handling within the makefs(8) utility. If some file to be packaged cannot be read (most likely due to EPERM), it would issue a warning and proceed creating slighly inconsistent FS image. The correct behavior I think is to abort and return an error back to caller.
$ ./makefs_bug.sh + mktemp -d test.XXXXXXXXX + TDIR=test.tdVMsj79c + mkdir test.tdVMsj79c/somedir + truncate -s 1024k test.tdVMsj79c/somedir/somefile + chmod 000 test.tdVMsj79c/somedir/somefile + makefs test.tdVMsj79c.ufs test.tdVMsj79c Calculated size of `test.tdVMsj79c.ufs': 1212416 bytes, 4 inodes Extent size set to 32768 test.tdVMsj79c.ufs: 1.2MB (2368 sectors) block size 32768, fragment size 4096 using 1 cylinder groups of 1.16MB, 37 blks, 256 inodes. super-block backups (for fsck -b #) at: 64, Populating `test.tdVMsj79c.ufs' makefs: Can't open `test.tdVMsj79c/./somedir/somefile' for reading: Permission denied Image `test.tdVMsj79c.ufs' complete + rm -rf test.tdVMsj79c + sudo mdconfig -a -f test.tdVMsj79c.ufs + mdu=md0 + sudo mount -o ro /dev/md0 /mnt + ls /mnt/somedir/somefile ls: /mnt/somedir/somefile: Bad file descriptor