From owner-freebsd-bugs@FreeBSD.ORG Thu May 28 19:00:07 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 197BC1065691 for ; Thu, 28 May 2009 19:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E509F8FC08 for ; Thu, 28 May 2009 19:00:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4SJ06Wt025448 for ; Thu, 28 May 2009 19:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4SJ06Lo025447; Thu, 28 May 2009 19:00:06 GMT (envelope-from gnats) Resent-Date: Thu, 28 May 2009 19:00:06 GMT Resent-Message-Id: <200905281900.n4SJ06Lo025447@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mike Andrews Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 985A710656C9 for ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/135039: mkstemp() fails over NFS when server uses ZFS (7-stable only) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mike Andrews List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 19:00:07 -0000 >Number: 135039 >Category: kern >Synopsis: mkstemp() fails over NFS when server uses ZFS (7-stable only) >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 28 19:00:06 UTC 2009 >Closed-Date: >Last-Modified: >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: >Unformatted: