From patchwork Sat Oct 12 19:29:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 11186951 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E340D14ED for ; Sat, 12 Oct 2019 19:29:54 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 9FEFD20679 for ; Sat, 12 Oct 2019 19:29:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FEFD20679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7585A10CC1E0; Sat, 12 Oct 2019 19:29:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3417D5D9CC; Sat, 12 Oct 2019 19:29:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7EB594A486; Sat, 12 Oct 2019 19:29:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CJTpsq031048 for ; Sat, 12 Oct 2019 15:29:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id A4DA060A97; Sat, 12 Oct 2019 19:29:51 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F5ED608A5 for ; Sat, 12 Oct 2019 19:29:49 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D055E301D671 for ; Sat, 12 Oct 2019 19:29:48 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9CDBDB23F; Sat, 12 Oct 2019 19:29:47 +0000 (UTC) From: Petr Vorel To: dm-devel@redhat.com Date: Sat, 12 Oct 2019 21:29:38 +0200 Message-Id: <20191012192938.17652-2-pvorel@suse.cz> In-Reply-To: <20191012192938.17652-1-pvorel@suse.cz> References: <20191012192938.17652-1-pvorel@suse.cz> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 19:29:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 19:29:49 +0000 (UTC) for IP:'195.135.220.15' DOMAIN:'mx2.suse.de' HELO:'mx1.suse.de' FROM:'pvorel@suse.cz' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED, SPF_HELO_NONE, SPF_PASS) 195.135.220.15 mx2.suse.de 195.135.220.15 mx2.suse.de X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: Christoph Hellwig , Petr Vorel , Baruch Even Subject: [dm-devel] [RFC PATCH v2 2/2] kpartx: Use fixed size types in struct solaris_x86_vtoc X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 19:29:53 +0000 (UTC) Some of the items in struct solaris_x86_vtoc defined in kernel uses fixed size types (with specified byte order). We're not able to find original 32-bit x86 Solaris sources, but expect struct definition in kernel is correct, therefore use it as a source of size of struct items. With one exception: keep timestamp[SOLARIS_X86_NUMSLICE] as time_t (kernel uses unsigned int). Cc: Christoph Hellwig Cc: Baruch Even Signed-off-by: Petr Vorel --- changes v1->v2: new commit. kpartx/solaris.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kpartx/solaris.c b/kpartx/solaris.c index 0fda10ad..6b1795d8 100644 --- a/kpartx/solaris.c +++ b/kpartx/solaris.c @@ -14,13 +14,13 @@ struct solaris_x86_slice { }; struct solaris_x86_vtoc { - unsigned long v_bootinfo[3]; /* info for mboot */ - unsigned long v_sanity; /* to verify vtoc sanity */ - unsigned long v_version; /* layout version */ + unsigned int v_bootinfo[3]; /* info for mboot */ + uint32_t v_sanity; /* to verify vtoc sanity */ + uint32_t v_version; /* layout version */ char v_volume[8]; /* volume name */ - unsigned short v_sectorsz; /* sector size in bytes */ - unsigned short v_nparts; /* number of partitions */ - unsigned long v_reserved[10]; /* free space */ + uint16_t v_sectorsz; /* sector size in bytes */ + uint16_t v_nparts; /* number of partitions */ + unsigned int v_reserved[10]; /* free space */ struct solaris_x86_slice v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */ time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp */ @@ -44,7 +44,7 @@ read_solaris_pt(int fd, struct slice all, struct slice *sp, int ns) { return -1; if(v->v_version != 1) { - fprintf(stderr, "Cannot handle solaris version %ld vtoc\n", + fprintf(stderr, "Cannot handle solaris version %d vtoc\n", v->v_version); return 0; }