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 :| From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15410C76188 for ; Mon, 22 Jul 2019 09:06:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E24022229B for ; Mon, 22 Jul 2019 09:06:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E24022229B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59813 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpUH5-0004qq-3k for qemu-devel@archiver.kernel.org; Mon, 22 Jul 2019 05:06:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35407) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpUGu-0004OX-Q2 for qemu-devel@nongnu.org; Mon, 22 Jul 2019 05:06:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpUGt-0002F7-J8 for qemu-devel@nongnu.org; Mon, 22 Jul 2019 05:06:16 -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 Message-ID: <20190722090556.GC23775@redhat.com> 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-devel] [PATCH 1/2] LUKS: better error message when creating too large files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Michael Tokarev , qemu-devel@nongnu.org, Laurent Vivier , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 :|