From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1hpUH3-0004ty-TK for mharc-qemu-trivial@gnu.org; Mon, 22 Jul 2019 05:06:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35439) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpUH1-0004il-6Y for qemu-trivial@nongnu.org; Mon, 22 Jul 2019 05:06:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpUGx-0002H1-47 for qemu-trivial@nongnu.org; Mon, 22 Jul 2019 05:06:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hpUGo-00027E-47; Mon, 22 Jul 2019 05:06:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4DC23086262; Mon, 22 Jul 2019 09:06:00 +0000 (UTC) Received: from redhat.com (unknown [10.42.16.132]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1287060C05; Mon, 22 Jul 2019 09:05:58 +0000 (UTC) Date: Mon, 22 Jul 2019 10:05:56 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Maxim Levitsky Cc: qemu-devel@nongnu.org, Kevin Wolf , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Max Reitz Message-ID: <20190722090556.GC23775@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20190721181508.28608-1-mlevitsk@redhat.com> <20190721181508.28608-2-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190721181508.28608-2-mlevitsk@redhat.com> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 22 Jul 2019 09:06:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2] LUKS: better error message when creating too large files X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2019 09:06:24 -0000 On Sun, Jul 21, 2019 at 09:15:07PM +0300, Maxim Levitsky wrote: > Currently if you attampt to create too large file with luks you > get the following error message: >=20 > Formatting 'test.luks', fmt=3Dluks size=3D17592186044416 key-secret=3Ds= ec0 > qemu-img: test.luks: Could not resize file: File too large >=20 > While for raw format the error message is > qemu-img: test.img: The image size is too large for file format 'raw' >=20 >=20 > The reason for this is that qemu-img checks for errono of the failure, > and presents the later error when it is -EFBIG >=20 > However crypto generic code 'swallows' the errno and replaces it > with -EIO. >=20 > As an attempt to make it better, we can make luks driver, > detect -EFBIG and in this case present a better error message, > which is what this patch does >=20 > The new error message is: >=20 > qemu-img: error creating test.luks: The requested file size is too larg= e >=20 > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1534898 > Signed-off-by: Maxim Levitsky > --- > block/crypto.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) Reviewed-by: Daniel P. Berrang=C3=A9 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|