Received: by 10.213.65.68 with SMTP id h4csp761060imn; Fri, 6 Apr 2018 08:27:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Tte/C1rh9JfGJHAFuugjRr8iBv6Dlj7Iu50pVnotQvp3F/49vuF4nY5l11cVO8xWDzkAD X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr28347897plb.338.1523028434208; Fri, 06 Apr 2018 08:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523028434; cv=none; d=google.com; s=arc-20160816; b=hiWJMhGttKTagyjhscP1lNasyZk9z3juyCgmUmMTA8oedEbdorFeNrpa+QxoVOXLR4 9/F3ZqLHtXHMk18+PVTyJITAIohCXAWScIB3bXYjWGcZq8jQ5QWE4EeNKuiqfYKgXH6V YzerPST27wB67+YncS+tSTySp6GCnM/jlFMORN/DnyQzRcvNZzk+yCRgRmY2UcnRBlHr VIvQiRbh9PSDvTFdQnk73THrv/ZU9GLeKMRj27Sy0NQ1OprAgwG6wF9If+HKjcgoSVoy /w85w3Hvm/UGVuCmvlxLCaAGhw39kglW7SxiBMY/hXxuR4ZYl2pobOds1qeIviSrL+aO mgQQ== 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=D6Zo0T5xxe1lDb7sXw1MsVfY7YGxzbaEKx+DEY7HtPo=; b=dGRIvNiBHCrRT9Xhb6dRTR4Q2apVWiBg8zoIo+K+9w3ybJb3GVL01e0oJwMOBoTRyC OyhWzysVZRmXPrW/23T6utIvMANzu+lMU/YSyONXzI++DtEPn4pUt8JFGqYZlNHeB3rZ Y8YgeyL+UtQ7GxQlAoINJfb3qxDoNVKl5+cDkbNxMdyFvupnPMiWI7Gj5lPXPM2QzO6K iTpBDpf7csSqgen7jplXs4ZjzrKaGqWKp1du0J1TvG56ijY/7PXLjozgHcZjmP/vz9CN Ccr5++mDUnvquH5Wp1i7OxbSN2jpwrvC3XUd0VaLwgDifNE2F8EymZtogwEyXFCmlFbJ +Cpg== 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 66-v6si9159725pld.315.2018.04.06.08.27.00; Fri, 06 Apr 2018 08:27:14 -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 S1754032AbeDFN0h (ORCPT + 99 others); Fri, 6 Apr 2018 09:26:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54476 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbeDFN0e (ORCPT ); Fri, 6 Apr 2018 09:26:34 -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 E0841DF3; Fri, 6 Apr 2018 13:26:33 +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 3.18 41/93] partitions/msdos: Unable to mount UFS 44bsd partitions Date: Fri, 6 Apr 2018 15:23:10 +0200 Message-Id: <20180406084226.735573501@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084224.918716300@linuxfoundation.org> References: <20180406084224.918716300@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 3.18-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 */