From mandrews@fark.com  Thu May 28 18:56:21 2009
Return-Path: <mandrews@fark.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 985A710656C9
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 May 2009 18:56:21 +0000 (UTC)
	(envelope-from mandrews@fark.com)
Received: from bourbon.fark.com (bourbon.fark.com [207.246.126.22])
	by mx1.freebsd.org (Postfix) with ESMTP id 75FCF8FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 May 2009 18:56:21 +0000 (UTC)
	(envelope-from mandrews@fark.com)
Received: by bourbon.fark.com (Postfix, from userid 1001)
	id 3AD78B5E5; Thu, 28 May 2009 14:31:57 -0400 (EDT)
Message-Id: <20090528183157.3AD78B5E5@bourbon.fark.com>
Date: Thu, 28 May 2009 14:31:57 -0400 (EDT)
From: Mike Andrews <mandrews@fark.com>
Reply-To: Mike Andrews <mandrews@bit0.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mkstemp() fails over NFS when server uses ZFS (7-stable only)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         135039
>Category:       kern
>Synopsis:       [zfs] mkstemp() fails over NFS when server uses ZFS (7-stable only) [regression]
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 28 19:00:06 UTC 2009
>Closed-Date:    Mon Jun 22 13:21:23 UTC 2009
>Last-Modified:  Mon Jun 22 13:21:23 UTC 2009
>Originator:     Mike Andrews
>Release:        FreeBSD 7.2-STABLE amd64
>Organization:
Fark, Inc
>Environment:
System: FreeBSD bourbon.fark.com 7.2-STABLE FreeBSD 7.2-STABLE #11: Mon May 25 19:10:00 EDT 2009 mandrews@vodka.int.fark.com:/usr/obj/usr/src/sys/FARK64 amd64


>Description:

	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...

>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.

>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


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu May 28 22:34:07 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135039 
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Mon Jun 22 13:18:35 UTC 2009 
State-Changed-Why:  
Close this PR, kern/135412 is a duplicate of this, but contains a simple 
test case 


Responsible-Changed-From-To: freebsd-fs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Mon Jun 22 13:18:35 UTC 2009 
Responsible-Changed-Why:  
Track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135039 
>Unformatted:
