Received: by 10.213.65.68 with SMTP id h4csp693797imn; Fri, 6 Apr 2018 07:24:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx49G2kjbGh6KV3fO6MScU3hMVaOFb7nUZZSo1ryfyxalSoDMYIyeul+FAr/taJsmxp1r5OH2 X-Received: by 10.99.188.9 with SMTP id q9mr17405649pge.381.1523024646309; Fri, 06 Apr 2018 07:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024646; cv=none; d=google.com; s=arc-20160816; b=JsayA+69at8PM8AUiNgXZKaiB2o7cMgn8SfVKrsFAEjFyLdYjiutRzqPkdNQXNwPay i1rhO1TvxYRdm+0+9PMaZEmKMOvENaPmO7awuRXAMSRdfyTYO7ShVLy7MghWvGFCVAw9 n9L+0zyWATEwXDQN0cg6fUhjaYL1jWoec0lFzJzFtc1kFtL++ZeDZERkHiTcN9sGm3i+ U+TbcUqjpSPBKkLYOcFTREg6mZZzIltcGMl5jkjwgNZI2yLTWNMTKHlrwaIo8fCTlYmf NxNFa3glI9JeItedMRxOMJEgHh4j9rJsS8R+/0wbsbqk8kDPHw3upeuCBa88FMrDHQ67 cJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=D2lHHchk3LmwELJf3DYBpTe5SdBfwOJ63GTdsRGDC5M=; b=qaql5QQllWvZj/A3WlniMJV8nLtZVfmboGC79lf8z4KAZFFo1ZMW52Zsh3vKeg2gPQ v2zC2U2VCaGAPzWmerpQgtrMFHHXV+fo1OnT3y9IIV3d7HbV8+/xo0B065AZ5dIJwF/m jjLhUrIKTH2NIhmdzyM53CnPOhgfjJPJnkRHhvo+Qc+tHbKA5ECkuGwXJOzHfLIxIF6F Ll47reWo+rQcsmHeUqyi8r5U/JLDqA/MyT0XoP/MTmEHMzvEV0iRBR7nTDBP1bMuxZh0 vpwDAJ/VrSYZkzcsCFWFEvcb3KFVv9RDJzIKBBKw9GYyYizKyWI3dlXkOgGbkArVrw5+ aWDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si5414024pgn.48.2018.04.06.07.23.52; Fri, 06 Apr 2018 07:24:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756498AbeDFOWv (ORCPT + 99 others); Fri, 6 Apr 2018 10:22:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33158 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932325AbeDFNhs (ORCPT ); Fri, 6 Apr 2018 09:37:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A2843CC8; Fri, 6 Apr 2018 13:37:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Narron , Jens Axboe Subject: [PATCH 4.14 17/67] partitions/msdos: Unable to mount UFS 44bsd partitions Date: Fri, 6 Apr 2018 15:23:47 +0200 Message-Id: <20180406084343.621695172@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084341.225558262@linuxfoundation.org> References: <20180406084341.225558262@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Richard Narron commit 5f15684bd5e5ef39d4337988864fec8012471dda upstream. 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 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/partitions/msdos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/block/partitions/msdos.c +++ b/block/partitions/msdos.c @@ -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 */