Received: by 10.213.65.68 with SMTP id h4csp723210imn; Fri, 6 Apr 2018 07:52:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+pkG6KzXBqSMhY2x1DJZ4lzl3jk6zNqlh9mCJifWPGrmPFEOYGc9J/B+5qHh7PaBi8K0i0 X-Received: by 10.99.117.84 with SMTP id f20mr4661140pgn.188.1523026373113; Fri, 06 Apr 2018 07:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026373; cv=none; d=google.com; s=arc-20160816; b=zMZVpB+OEm7hybPljEjOSt6G1WuI7w9zYhMy79RyieL+V/NfBWxMQahNbge0yoPbkQ W98bgz4LsxGozNjilVbLIquhhbYMFX8MSdN9EmGJZO1LsgQTCuxVfbXabrFbyQmvYoGi NOvCLU5Vs0GMYXxpwTF83OU+30KnHJLe+buB1ihfE+16dABpim0ZlI4FVS9jJ9p52TDB HCzDtrE7Sooxo2DelXKZGro656yJ1inLi3Ypvq39QyzJ3GWL4JHuFXty3xtN+SJLtAPS LFl04v9HfYUfaa9SHdaT9xcMRzNi6DSaWHfm4JF41tHWwSUl+RZGSfZdPWxMZ+gp8U+5 B6ug== 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=mzmwjcVNX0IDV+98UrwpJ3ndoWyIYfF5nrwm24qvtqw=; b=G+O6WWVCb3MnE/v8VYHv3r/ktkGc/+OWbZlFe3HX/MXkQAXFG1PTrs9OIfDAMM8ZWz SM3XhY6nwdyC3nWgCkjWHh4byW6N6uXjTrA9gmws145bAlV4d/JtjNucbrXg+eaZH/cD lq8u/tfYzYcavcn3jUCG3TXglsQZ1DUVWwg6pu1L8S0o4yDDz8e8L1hgTkdYW4ViZS/7 zaezlP2GMAPuGBhbkTZBS+7De+WOwLo08xNxQNI7+xU/9hQ9S5AVBgZlxLkcdVeH1Cdx U/SVoj/NkWBngREOMvwi/BdUs1UnislPRiGaH8nSSk5dqHNVx47yLLjSNMIxYTiLcsBA EYLg== 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 a15-v6si11189545pll.21.2018.04.06.07.52.39; Fri, 06 Apr 2018 07:52:53 -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 S1755493AbeDFOvf (ORCPT + 99 others); Fri, 6 Apr 2018 10:51:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57652 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755423AbeDFNcr (ORCPT ); Fri, 6 Apr 2018 09:32:47 -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 24008C7C; Fri, 6 Apr 2018 13:32:46 +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.9 011/102] partitions/msdos: Unable to mount UFS 44bsd partitions Date: Fri, 6 Apr 2018 15:22:52 +0200 Message-Id: <20180406084333.178691709@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@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.9-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 @@ -300,7 +300,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 */