From patchwork Sun May 21 19:27:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard X-Patchwork-Id: 9739233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A71E660326 for ; Sun, 21 May 2017 19:27:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8578928508 for ; Sun, 21 May 2017 19:27:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6769228511; Sun, 21 May 2017 19:27:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 046BE28508 for ; Sun, 21 May 2017 19:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbdEUT1B (ORCPT ); Sun, 21 May 2017 15:27:01 -0400 Received: from 107-204-215-49.lightspeed.sntcca.sbcglobal.net ([107.204.215.49]:50634 "EHLO mail.aaazen.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbdEUT1B (ORCPT ); Sun, 21 May 2017 15:27:01 -0400 Received: from localhost (localhost [127.0.0.1]) by thursday.test (OpenSMTPD) with ESMTP id 806b5fe5; Sun, 21 May 2017 19:27:00 +0000 (UTC) Date: Sun, 21 May 2017 12:27:00 -0700 (PDT) From: Richard X-X-Sender: richard@thursday.test To: Christoph Hellwig , linux-block cc: Jens Axboe , Andries Brouwer Subject: [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The code in block/partitions/msdos.c recognizes FreeBSD, OpenBSD and NetBSD partitions and does a reasonable job picking out OpenBSD and NetBSD UFS subpartitions. But for FreeBSD the subpartitions are always "bad". Kernel: --- Changelog v1->v2: - Improve style, use += --- block/partitions/msdos.c | 2 ++ 1 file changed, 2 insertions(+) --- a/block/partitions/msdos.c 2015-12-27 18:17:37.000000000 -0800 +++ b/block/partitions/msdos.c 2015-12-29 10:44:25.813773357 -0800 @@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_part continue; bsd_start = le32_to_cpu(p->p_offset); bsd_size = le32_to_cpu(p->p_size); + if (memcmp(flavour, "bsd\0", 4) == 0) + bsd_start += offset; if (offset == bsd_start && size == bsd_size) /* full parent partition, we have it already */ continue;