From patchwork Mon Nov 6 23:25:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Narron X-Patchwork-Id: 10044681 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 478F86032D for ; Mon, 6 Nov 2017 23:25:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A4141FFE6 for ; Mon, 6 Nov 2017 23:25:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EF812A072; Mon, 6 Nov 2017 23:25:44 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 0C40F1FFE6 for ; Mon, 6 Nov 2017 23:25:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbdKFXZl (ORCPT ); Mon, 6 Nov 2017 18:25:41 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:56719 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752AbdKFXZi (ORCPT ); Mon, 6 Nov 2017 18:25:38 -0500 Received: by mail-pf0-f195.google.com with SMTP id b85so8873531pfj.13 for ; Mon, 06 Nov 2017 15:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=R8zxM1H7jvrtFmiB8WbYfEOc0us3QXR1xXyix2pSH6k=; b=gfQ9JqMa7n9gEFfcWlh4KdTp4nG9fpApf0YDD7kMzEUA3UT+GWKAN1y/iQjguPew4h ru3a/QCGkMZj7GYh3MuSaD/TqbbdcPlo0eaKR4XV7OxJMda4uao0FDCLt/EJxGOjeNwW 5bQdTZzGN0qaELTi1mTKNjSP9oUBcNCX3/ayVDWb0BDoAtM4aMvMX0qRZagx99rH7Nqo BrPMWFkz0rov/tJfIL3PB9gOr6Ijy9JqPWE5mYaeDvKXdAIcN+lSiuCT32LAtDiU3VvM cmiLJmvEY5rIoSrf/jTNIS+2zSvI1Z1bk8VUZMO2ySjBkFQGV3BoInaEFncNrI+uzLE1 7cPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=R8zxM1H7jvrtFmiB8WbYfEOc0us3QXR1xXyix2pSH6k=; b=Bl5fLhPivliNmE6Io/hZ+HhGwLwZ5H2vZ4+1Ofsey7CGcdozJnaxfvrOBzEmTGboAs Eb1mBfvBV0YeT/BWytHW1vXfs+CBmjVVoDGgUyahOtgUAIyrT6TMI++MUQCHRi0z+B95 Yx2I6EuDimd9KWyKKo5L2G/4laP/DWyTTwGwAKT6FHGRokljVYqFOicg2BEujZB0LHlV JFVxb7BaByx+l5eLGALA5B4etr/oeQaRidtVs2Q9PdV6sNlF/zI17F9AWgjXrNyPYbJH tLsykvRhuXgIxSawtSjy0mzcKiSZh3or1NKONUp/aDYgZyVAYajusViHsSNZwlvPcQPL Fz/w== X-Gm-Message-State: AMCzsaW0Su85+RBCPF1N+114nvoE7B/l3ryen0sAQ9bUMn9s1wRmcG5+ /ZOCUumcPIeVHqY9OEtXy+I= X-Google-Smtp-Source: ABhQp+SZQfLg2YYgPDIWx9B0c4nvB7GqeBPifbzeM3chWq+yZ4VrLbpb8eyyWBieBnNV2cQSZPul6g== X-Received: by 10.99.97.147 with SMTP id v141mr16104368pgb.92.1510010737939; Mon, 06 Nov 2017 15:25:37 -0800 (PST) Received: from joy.test (107-204-215-49.lightspeed.sntcca.sbcglobal.net. [107.204.215.49]) by smtp.gmail.com with ESMTPSA id d15sm25219721pfj.163.2017.11.06.15.25.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 15:25:37 -0800 (PST) Date: Mon, 6 Nov 2017 15:25:32 -0800 (PST) From: Richard Narron X-X-Sender: comet.berkeley@joy.test To: Jens Axboe cc: linux-block@vger.kernel.org Subject: [Patch 1/1] partitions/msdos: Unable to mount UFS 44bsd partitions Message-ID: User-Agent: Alpine 2.21 (LNX 202 2017-01-01) 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 UFS partitions from newer versions of FreeBSD 10 and 11 use relative addressing for their subpartitions. But older versions of FreeBSD still use absolute addressing just like OpenBSD and NetBSD. Instead of simply testing for a FreeBSD partition, the code needs to also test if the starting offset of the C subpartition is zero. https://bugzilla.kernel.org/show_bug.cgi?id=197733 Signed-off-by: Richard Narron --- a/block/partitions/msdos.c.orig 2017-11-05 13:05:14.000000000 -0800 +++ b/block/partitions/msdos.c 2017-11-06 09:46:00.148228242 -0800 @@ -301,7 +301,9 @@ 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) + /* FreeBSD has relative offset if C partition offset is zero */ + if (memcmp(flavour, "bsd\0", 4) == 0 && + le32_to_cpu(l->d_partitions[2].p_offset) == 0) bsd_start += offset; if (offset == bsd_start && size == bsd_size) /* full parent partition, we have it already */