From patchwork Tue Oct 8 07:57:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 11179095 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 CFAA7112B for ; Tue, 8 Oct 2019 07:57:40 +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 9A7EC20673 for ; Tue, 8 Oct 2019 07:57:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A7EC20673 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-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78FBB300C727; Tue, 8 Oct 2019 07:57:38 +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 E34BE600CE; Tue, 8 Oct 2019 07:57:36 +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 239434EE68; Tue, 8 Oct 2019 07:57:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x987vWDe009932 for ; Tue, 8 Oct 2019 03:57:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B53F60127; Tue, 8 Oct 2019 07:57:32 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 766CE600CE for ; Tue, 8 Oct 2019 07:57:30 +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 45125970F6 for ; Tue, 8 Oct 2019 07:57:29 +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 EF4B0B1C9; Tue, 8 Oct 2019 07:57:27 +0000 (UTC) From: Petr Vorel To: dm-devel@redhat.com Date: Tue, 8 Oct 2019 09:57:19 +0200 Message-Id: <20191008075719.30926-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.39]); Tue, 08 Oct 2019 07:57:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 08 Oct 2019 07:57:29 +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.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: Christoph Hellwig , Petr Vorel , Baruch Even Subject: [dm-devel] [RFC PATCH 1/1] kpartx: Use solaris_x86_slice definition from kernel 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 08 Oct 2019 07:57:40 +0000 (UTC) solaris_x86_slice defined in kernel uses byte order fixed types. As we already use kernel headers in kpart sources and we're not able to find original 32-bit x86 Solaris sources, it's better to stick with struct definition from kernel. 129e6fe6 used __kernel_daddr_t instead of one of these: long / int / daddr_t, which is IMHO wrong and tried to address only s_start struct member. Fixes: 129e6fe6 ("kpartx: Use __kernel_daddr_t for solaris_x86_slice.s_start") Cc: Christoph Hellwig Cc: Baruch Even Signed-off-by: Petr Vorel --- kpartx/solaris.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kpartx/solaris.c b/kpartx/solaris.c index e7826c62..7e3db9c6 100644 --- a/kpartx/solaris.c +++ b/kpartx/solaris.c @@ -7,10 +7,10 @@ #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) struct solaris_x86_slice { - unsigned short s_tag; /* ID tag of partition */ - unsigned short s_flag; /* permission flags */ - __kernel_daddr_t s_start; /* start sector no of partition */ - long s_size; /* # of blocks in partition */ + __le16 s_tag; /* ID tag of partition */ + __le16 s_flag; /* permission flags */ + __le32 s_start; /* start sector no of partition */ + __le32 s_size; /* # of blocks in partition */ }; struct solaris_x86_vtoc {