From patchwork Thu Nov 9 14:44:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Narron X-Patchwork-Id: 10051051 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 D945C601EB for ; Thu, 9 Nov 2017 14:44:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCC342ADC2 for ; Thu, 9 Nov 2017 14:44:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C145A2ADCA; Thu, 9 Nov 2017 14:44:09 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 783632ADC8 for ; Thu, 9 Nov 2017 14:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753529AbdKIOoI (ORCPT ); Thu, 9 Nov 2017 09:44:08 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:46969 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753100AbdKIOoH (ORCPT ); Thu, 9 Nov 2017 09:44:07 -0500 Received: by mail-pg0-f65.google.com with SMTP id t10so3824311pgo.3; Thu, 09 Nov 2017 06:44:07 -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=WoKxSqfV0bfXtQxxyop/5hc7WOuL5+9sSEVFNOB7EgI=; b=FJroo7KQ2/YdfoHhThJc0Va4IFfjN432Yyfj2x2KMDShGK8clqlvGQP494Otr3piPS UtG24aGXbMde0feTKy+uNIMrjTW/PaP8r0XoqbudTUbMj9NkVMykQt5MS2RydXS8L+uq y+U5Bkb3AITUWtLoDdrPYXSwyPTiCdBhycaYCOMrxbytgQWjcJxFABz0rr1HQpHMUhXr OYwyPHmtbXGYsTyAGG0mhM2PhmAB1X8VFhLQuNa9i3TlEu+18KPBca/tFQPVKT7JK5F6 79RAdqugy2IPafS/4Yy8KlTj32efsqPYYV7gCbg5qiaDx5jJNebXgEdeHQzflrXDlZgf vlog== 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=WoKxSqfV0bfXtQxxyop/5hc7WOuL5+9sSEVFNOB7EgI=; b=oZJYXRI1nfy8cuuEWUlX9NWJbIpfzngD6V+2+y2ev96fN1uYY/20aE5rXw1Sbg92ri P96OfWAwwqP0ntia6vrUFW4ku0ns0ItcuaW1p5CyXzK1b7suAwBR9Ng+nUorvjerHkDg Yk6SPNwafLqI9WHy3M8qMvkRAXdV0kj9nkfutEsmws7wA/VxHIHaf+PWeaVmd852Y+hq SdKbGATdwatkgoYDAqaH6gxPEWRdNZ26Ogx5w3Ay7VRye91BlZXBNQcQ5yzGIV0LKZOB bWDo0IUyz09RfOxjAE3mFAZJiv8UpWGE3cdiQeNil1YMZkhdyRDInIPW41M9Wl5p+IvM 6Ufg== X-Gm-Message-State: AJaThX4Mr51oGlJwlsmYi96dIlVGyNUcWGy8AQlv/d3FuBHSCl6zaHKR uXgm4uxO+jSou5N/URWabYOAZbBa X-Google-Smtp-Source: ABhQp+T8qByjEB1sIrkslZabLqLl1FOToXW5cujC9U7RnQ88ZZv3DVBypFtE0L4nHM4bXCnz543N6Q== X-Received: by 10.99.120.7 with SMTP id t7mr677372pgc.360.1510238647222; Thu, 09 Nov 2017 06:44:07 -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 a7sm12109998pgc.81.2017.11.09.06.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 06:44:06 -0800 (PST) Date: Thu, 9 Nov 2017 06:44:02 -0800 (PST) From: Richard Narron X-X-Sender: comet.berkeley@joy.test To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org cc: Christoph Hellwig , Jens Axboe , Al Viro , YLT 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 */