Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1776179imm; Thu, 27 Sep 2018 02:16:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JQq74j4+2FThHwiXqceyZ9t3jaisV01NpVRfpsCfJngM+qBj2Qg6nvqCrmnMO/3gK/k5b X-Received: by 2002:a63:141c:: with SMTP id u28-v6mr32636pgl.247.1538039762250; Thu, 27 Sep 2018 02:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039762; cv=none; d=google.com; s=arc-20160816; b=wt3HJFmr/DowSqn3wk7zW6uaiAJDd0V6y91dCiZACY9EAEOcfOASV0D4qRuRVFQ87t nfd3PpJrFGq5p/HPNX8n/8GaCQcv3WkJ8iHLWxdbNMAaNG428Fk4OpFfzV9iedoFOPFd IYP7QY+wmXoHW2iFx+pnZoKHC/AsriiIOHEibkSgyWv3gD/iGh1TDn/d7842PtOT20ZA S4BGUQf84wsvt0MByNNVlZRKWzbXXaUbT68lueiJVMoVUhEqwL4Wr5FP3IfEn6ix7rof 61S+BRy93VtBcAUKWgW+JOpaSOB+D6RIQC1qekPQFCPublrMRxIkBujIFNeHLaeSmmcj LQAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=k7ehsav+kbNPLPvDyn+9cK0qNVGsf5anHxuwyB/hkDc=; b=K3/Kx9fg2xaGcduoy0nnialbtIOwBLmYnpqR9wNsfl/5Jlgv5a9Tf9t5cGcwoiI3aQ J7CPp6N6Nok95K/T4L5hTA28eqJl+FFmEQ4Dikl1HYiISK8HHgeGeVB2ZElffChJB0RE gr1mo7pBLeYc+eTOa8c535lSNCuwEGZJt2uNt39WEKHo6UbzSPHmZ91xjH/e3mbLvttw k8KjmCevqzzws/JlZ/zQwV8sarE0kwMkaTTS2ri1eE1rsr65dl2Rgfb/GT3lCSGwVcgv jt/HR8A7n1zUSdqlldx4XKy4+IuRT8saTNqonYhhJ3Jgp28TYIX8n5pn7AFQ+/Sch7sX T8UQ== 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 y26-v6si1473266pfe.269.2018.09.27.02.15.46; Thu, 27 Sep 2018 02:16:02 -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 S1728583AbeI0PcI (ORCPT + 99 others); Thu, 27 Sep 2018 11:32:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55550 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727579AbeI0PcH (ORCPT ); Thu, 27 Sep 2018 11:32:07 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7D6301117; Thu, 27 Sep 2018 09:14:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso Subject: [PATCH 4.18 81/88] ext4: fix online resizing for bigalloc file systems with a 1k block size Date: Thu, 27 Sep 2018 11:04:02 +0200 Message-Id: <20180927090310.442076828@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit 5f8c10936fab2b69a487400f2872902e597dd320 upstream. An online resize of a file system with the bigalloc feature enabled and a 1k block size would be refused since ext4_resize_begin() did not understand s_first_data_block is 0 for all bigalloc file systems, even when the block size is 1k. Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/resize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -19,6 +19,7 @@ int ext4_resize_begin(struct super_block *sb) { + struct ext4_sb_info *sbi = EXT4_SB(sb); int ret = 0; if (!capable(CAP_SYS_RESOURCE)) @@ -29,7 +30,7 @@ int ext4_resize_begin(struct super_block * because the user tools have no way of handling this. Probably a * bad time to do it anyways. */ - if (EXT4_SB(sb)->s_sbh->b_blocknr != + if (EXT4_B2C(sbi, sbi->s_sbh->b_blocknr) != le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { ext4_warning(sb, "won't resize using backup superblock at %llu", (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);