Bug 135039 - [zfs] mkstemp() fails over NFS when server uses ZFS (7-stable only) [regression]
Summary: [zfs] mkstemp() fails over NFS when server uses ZFS (7-stable only) [regression]
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gavin Atkinson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-28 20:00 UTC by Mike Andrews
Modified: 2009-06-22 14:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Andrews 2009-05-28 20:00:06 UTC
	After the recent import of ZFS v13 into 7-STABLE, an mkstemp() call from an NFS client
	to a ZFS-backed NFS server will fail: the syscall returns EIO and the server will have
	created a 0-byte file with 000 permissions.  This breaks not just mktemp but also
	mv, tar, rsync...

Fix: 

Kip Macy said there's a flags check that is too strict, in email message
	 <3c1674c90905280025i17039257l573838d33d8493fd@mail.gmail.com>

	Otherwise, use cp and rm instead of mv, or use scp instead of NFS, or use UFS2 on the server
How-To-Repeat: 
	With both client/server running today's 7-STABLE:

	# dd if=/dev/random of=testfile bs=10000 count=1 >/dev/null 2>&1
	# mount another-72-stable-system:/zfs /mnt
	# cp testfile /mnt
	# mv testfile /mnt
	mv: /mnt/testfile: Input/output error
	# mktemp /mnt/testfile2
	mktemp: mkstemp failed on /mnt/testfile2: Input/output error
	# tar cf - testfile | (cd /mnt ; tar xpvf -)
	x testfile: Can't create 'testfile': Input/output error
	tar: Error exit delayed from previous errors.
	# rsync testfile /mnt
	rsync: mkstemp "/mnt/.testfile.0ycr51" failed: Input/output error (5)
	rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
	# ls -l /mnt/testfile /mnt/.testfile*
	----------  1 root  wheel  0 May 28 14:16 /mnt/.testfile.0ycr51
	----------  1 root  wheel  0 May 28 14:16 /mnt/testfile

	ZFS on-disk format was upgraded to v13, unknown yet whether leaving it at
	v6 would have made a difference, but I suspect not :)

	Everything works as expected if the remote filesystem is UFS2.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-28 23:34:07 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Gavin Atkinson freebsd_committer freebsd_triage 2009-06-22 14:18:35 UTC
State Changed
From-To: open->closed

Close this PR, kern/135412 is a duplicate of this, but contains a simple 
test case 


Comment 3 Gavin Atkinson freebsd_committer freebsd_triage 2009-06-22 14:18:35 UTC
Responsible Changed
From-To: freebsd-fs->gavin

Track