From patchwork Thu May 7 13:55:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 469698 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 755F21401AD for ; Thu, 7 May 2015 23:55:36 +1000 (AEST) Received: from localhost ([::1]:51192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqMH0-0002yL-Oy for incoming@patchwork.ozlabs.org; Thu, 07 May 2015 09:55:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqMGl-0002es-DP for qemu-devel@nongnu.org; Thu, 07 May 2015 09:55:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqMGk-0002jt-MG for qemu-devel@nongnu.org; Thu, 07 May 2015 09:55:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqMGe-0002hs-GH; Thu, 07 May 2015 09:55:12 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1593BAD003; Thu, 7 May 2015 13:55:12 +0000 (UTC) Received: from [10.36.112.76] (ovpn-112-76.ams2.redhat.com [10.36.112.76]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t47Dt7PN000391 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 May 2015 09:55:09 -0400 Message-ID: <554B6EBB.1010001@redhat.com> Date: Thu, 07 May 2015 15:55:07 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Kevin Wolf References: <554A1160.7020200@redhat.com> <554A3395.7050509@redhat.com> <554A3D7B.3040603@redhat.com> <554A3F37.9080704@redhat.com> <554A4349.10301@redhat.com> <554A459B.1060505@redhat.com> <554A4E2D.4050300@redhat.com> <554B58A8.6000203@redhat.com> <20150507122911.GB4571@noname.redhat.com> <554B5ED3.4030405@redhat.com> <20150507132056.GC4571@noname.redhat.com> In-Reply-To: <20150507132056.GC4571@noname.redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Stefan Hajnoczi , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 0/3] block: Warn about usage of growing formats over non-growable protocols X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 07/05/2015 15:20, Kevin Wolf wrote: > > Does ENOSPC over LVM (dm-linear) work at all, and who generates the > > ENOSPC there? > > The LVM use case is what oVirt uses, so I'm pretty sure that it works. > I'm now sure who generates the ENOSPC, but it's not qemu anyway. If I > had to guess, I'd say that the kernel block layer might just forbid > writing after EOF for any block device. Indeed, though it's VFS (blkdev_write_iter in fs/block_dev.c) and not the block layer. It looks like we need this: Paolo diff --git a/block/block-backend.c b/block/block-backend.c index 93e46f3..e54c433 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -461,7 +461,7 @@ static int blk_check_byte_request(BlockBackend *blk, int64_t offset, } if (offset > len || len - offset < size) { - return -EIO; + return -ENOSPC; } return 0;