Bug 200417

Summary: Contents of Makefiles disappear when running "make" on ZFS volume
Product: Base System Reporter: Jesse Smith <jsmith>
Component: armAssignee: freebsd-arm (Nobody) <freebsd-arm>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: arm   
OS: Any   

Description Jesse Smith 2015-05-23 15:50:25 UTC
FreeBSD version: 11-Current (armv6)
Hardware: Raspberry Pi 2

Problem: When running the "make" command on a Makefile in a source tree on a ZFS volume, the contents of the Makefile disappear (the file appears to be truncated).

Description: I have FreeBSD 11-Current running on a Raspberry Pi 2. When I go to compile a port or a kernel module on an attached ZFS volume, the contents of the Makefile seem to disappear until I unmount and re-mount the ZFS volume. As a quick example:

zfs mount tank
cd /tank/sys/modules/opensolaris
cat Makefile
(Contents of the Makefile is displayed)
make
(make command reports no target found)
cat Makefile
(No output is shown)
ls -l Makefile
(ls -l shows file "Makefile" exists and is of the proper size, over 1k)
cd /
zfs umount tank
zfs mount tank
cd /tank/sys/modules/opensolaris
cat Makefile
(full contents of Makefile is restored and displays properly)
make
(make command reports no target found and cat shows no data in the Makefile)


Work around: Compile all ports/modules on UFS volume instead.

Side note: Exporting the ZFS volume and attaching it to a machine running on x86 shows the data is available and a port/module can be compiled from the x86 machine. So this bug appears to be limited in scope to the ARM architecture.