From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhHQP-0000cS-5s for qemu-devel@nongnu.org; Sun, 12 Apr 2015 08:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhHQL-0004hm-5j for qemu-devel@nongnu.org; Sun, 12 Apr 2015 08:55:45 -0400 Received: from indium.canonical.com ([91.189.90.7]:43124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhHQK-0004he-VY for qemu-devel@nongnu.org; Sun, 12 Apr 2015 08:55:41 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1YhHQK-0007t1-B1 for ; Sun, 12 Apr 2015 12:55:40 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 409FB2E80C4 for ; Sun, 12 Apr 2015 12:55:40 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sun, 12 Apr 2015 12:45:35 -0000 From: Eric Van Hensbergen Sender: bounces@canonical.com References: <20140702135258.23882.15100.malonedeb@soybean.canonical.com> Message-Id: <20150412124535.20378.84464.launchpad@loganberry.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1336794] Re: 9pfs does not honor open file handles on unlinked files Reply-To: Bug 1336794 <1336794@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Bug watch added: Red Hat Bugzilla #1114221 https://bugzilla.redhat.com/show_bug.cgi?id=3D1114221 -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1336794 Title: 9pfs does not honor open file handles on unlinked files Status in QEMU: New Bug description: This was originally filed over here: https://bugzilla.redhat.com/show_bug.cgi?id=3D1114221 The open-unlink-fstat idiom used in some places to create an anonymous private temporary file does not work in a QEMU guest over a virtio-9p filesystem. Version-Release number of selected component (if applicable): qemu-kvm-1.6.2-6.fc20.x86_64 qemu-system-x86-1.6.2-6.fc20.x86_64 (those are fedora RPMs) How reproducible: Always. See this example C program: https://bugzilla.redhat.com/attachment.cgi?id=3D913069 Steps to Reproduce: 1. Export a filesystem with virt-manager for the guest. (type: mount, driver: default, mode: passthrough) 2. Start guest and mount that filesystem (mount -t 9p -o trans=3Dvirtio,version=3D9p2000.L ...) 3. Run a program that uses open-unlink-fstat (in my case it was trying to compile Perl 5.20) Actual results: fstat fails: open("/home/tst/filename", O_RDWR|O_CREAT|O_EXCL, 0600) =3D 3 unlink("/home/tst/filename") =3D 0 fstat(3, 0x23aa1a8) =3D -1 ENOENT (No such file or di= rectory) close(3) Expected results: open("/home/tst/filename", O_RDWR|O_CREAT|O_EXCL, 0600) =3D 3 unlink("/home/tst/filename") =3D 0 fstat(3, {st_mode=3DS_IFREG|0600, st_size=3D0, ...}) =3D 0 fcntl(3, F_SETFD, FD_CLOEXEC) =3D 0 close(3) = Additional info: There was a patch put into the kernel back in '07 to handle this very problem for other filesystems; maybe its helpful: http://lwn.net/Articles/251228/ There is also a thread on LKML from last December specifically about this very problem: https://lkml.org/lkml/2013/12/31/163 There was a discussion on the QEMU list back in '11 that doesn't seem to have come to a conclusion, but did provide the test program that i've attached to this report: http://marc.info/?l=3Dqemu-devel&m=3D130443605720648&w=3D2 To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1336794/+subscriptions