From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi1Z0-0004Mj-1K for qemu-devel@nongnu.org; Fri, 02 Oct 2015 10:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi1Yv-0005dT-MV for qemu-devel@nongnu.org; Fri, 02 Oct 2015 10:43:57 -0400 Date: Fri, 2 Oct 2015 15:43:46 +0100 From: "Richard W.M. Jones" Message-ID: <20151002144346.GP29330@redhat.com> References: <1443542050-26720-1-git-send-email-rjones@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] block/raw-posix: Open file descriptor O_RDWR to work around glibc posix_fallocate emulation issue. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , codonell@redhat.com, "Dr. David Alan Gilbert" , Qemu-block , QEMU Developers On Fri, Oct 02, 2015 at 03:36:04PM +0100, Peter Maydell wrote: > On 29 September 2015 at 16:54, Richard W.M. Jones wrote: > > https://bugzilla.redhat.com/show_bug.cgi?id=1265196 > > > > The following command fails on an NFS mountpoint: > > > > $ qemu-img create -f qcow2 -o preallocation=falloc disk.img 262144 > > Formatting 'disk.img', fmt=qcow2 size=262144 encryption=off cluster_size=65536 preallocation='falloc' lazy_refcounts=off > > qemu-img: disk.img: Could not preallocate data for the new file: Bad file descriptor > > > > The reason turns out to be because NFS doesn't support the > > posix_fallocate call. glibc emulates it instead. However glibc's > > emulation involves using the pread(2) syscall. The pread syscall > > fails with EBADF if the file descriptor is opened without the read > > open-flag (ie. open (..., O_WRONLY)). > > > > I contacted glibc upstream about this, and their response is here: > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1265196#c9 > > "You are not authorized to access bug #1265196." > > Any chance of a working URL if we're going to immortalize it > in QEMU's git log? Sorry about that. I have now made the bug public -- there was absolutely no reason why it was private before. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org