From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpBmd-0004lW-UR for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:03:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpBmc-0000ZQ-Tn for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:03:39 -0400 Date: Thu, 22 Oct 2015 11:03:30 +0200 From: Kevin Wolf Message-ID: <20151022090330.GB3941@noname.redhat.com> References: <1445501858-18790-1-git-send-email-famz@redhat.com> <5628A212.5040607@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5628A212.5040607@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/2] Fix werror=enospc for qcow2 on iscsi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Lieven , qemu-block@nongnu.org, Fam Zheng , qemu-devel@nongnu.org, Ronnie Sahlberg Am 22.10.2015 um 10:45 hat Paolo Bonzini geschrieben: > On 22/10/2015 10:17, Fam Zheng wrote: > > When qcow2 is created on iscsi target with a virtual size greater than physical > > capacity of the LUN, over time it's possible that guest fills too much data and > > at that point, new clusters in qcow2 will be allocated beyond the end of disk. > > > > werror=enospc is useful for that purpose to allocate more data for the guest, > > except in this case, unlike a host file system, iscsi returns -EIO instead of > > -ENOSPC, which makes it hard to detect and report proper error. > > > > Fix this by improving iscsi error handling code to return meaningful error > > codes (-ERANGE here), then further translate it to -ENOSPC in qcow2. > > FWIW, Linux uses ENOSPC if it detects out of range LBAs: > > if (iocb->ki_pos >= size) > return -ENOSPC; > > so I think it's okay to convert LBA_OUT_OF_RANGE to ENOSPC directly and > avoid patch 2. Yes, definitely. Fixing this up in qcow2 would be wrong, all other image formats are affected as well. The iscsi block driver already needs to return the correct errno value, which is ENOSPC. Kevin