From patchwork Sat Jul 26 07:45:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Azat Khuzhin X-Patchwork-Id: 373932 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8A4BB1400E6 for ; Sat, 26 Jul 2014 17:46:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751009AbaGZHqF (ORCPT ); Sat, 26 Jul 2014 03:46:05 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:64781 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbaGZHqC (ORCPT ); Sat, 26 Jul 2014 03:46:02 -0400 Received: by mail-lb0-f181.google.com with SMTP id 10so4006539lbg.40 for ; Sat, 26 Jul 2014 00:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=E6/4B9iNefwEItUaFmDhDytT/O0M3Z9KHNMcj4wedDk=; b=bmcYUPmyltruG0/8qjuzNFqcSQ3DBIOYqt1PHM8tpeiOFsLyQ0Pki+J8Fys0f8PwH/ iN7Kc0jFNIQ1M7us4XOcqw3EB3MeoA5QIg+koG2IPuLq9DNoyoik43IEZ4C6Qk7PUGf1 07CLiR6V4KD1O30wzz3gnw/gk6fAZ5hiYbjNTahqp3Grg8+Pz7Ws7Mo3DLKbEk70vB9z PhkUXoO0MlB+GpfAuwgXQKRTA4i2MSHgUPUcyGpW2rgTlW+Jq4xaki5tFRdaM8m5P+lu eVbVF7RD/INcqcvexHG+5fR2qnXeh2BG0u0VQuD5jjG+M4+fcQB1y8dvd0NIZQ8VlPri BCPg== X-Received: by 10.152.20.165 with SMTP id o5mr1098389lae.78.1406360760717; Sat, 26 Jul 2014 00:46:00 -0700 (PDT) Received: from localhost ([188.134.22.24]) by mx.google.com with ESMTPSA id b2sm8318514lab.20.2014.07.26.00.45.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jul 2014 00:45:59 -0700 (PDT) Date: Sat, 26 Jul 2014 11:45:58 +0400 From: Azat Khuzhin To: Brad Campbell Cc: Theodore Ts'o , linux-ext4@vger.kernel.org Subject: Re: Online resize issue with 3.13.5 & 3.15.6 Message-ID: <20140726074558.GC24045@azat> References: <53CBA75B.2030102@fnarfbargle.com> <53CC66DA.2080804@fnarfbargle.com> <20140725081312.GO6397@azat> <53D24307.6050903@fnarfbargle.com> <20140725140715.GR1865@thunk.org> <53D320F6.40809@fnarfbargle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <53D320F6.40809@fnarfbargle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Jul 26, 2014 at 11:31:02AM +0800, Brad Campbell wrote: > On 25/07/14 22:07, Theodore Ts'o wrote: > >On Fri, Jul 25, 2014 at 07:44:07PM +0800, Brad Campbell wrote: > >> > >>Appreciate you taking a look at this and I see where you are going with it. > > > >This patch looks good to me. If you could give it a try, I would > >appreciate it. > > > >This looks like the same bug which was reported in Ubuntu: > > > >https://bugs.launchpad.net/ubuntu/+source/e2fsprogs/+bug/1321958 > > > The patch would not apply automatically to 1.42.11 but was easy enough to > apply by hand. > > root@srv:~/src/e2fsprogs/e2fsprogs-1.42.11/resize# ./resize2fs -d 255 > /dev/md0 > resize2fs 1.42.11 (09-Jul-2014) > fs has 4007207 inodes, 1957 groups required. > fs requires 4374122900 data blocks. > With 1957 group(s), we have 63820826 blocks available. > Added 131540 extra group(s), blks_needed 4374122900, data_blocks 4356990326, > last_start 4356599580 > Added 523 extra group(s), blks_needed 4374122900, data_blocks 4374059350, > last_start 4373440788 > Added 2 extra group(s), blks_needed 4374122900, data_blocks 4374124886, > last_start 4373473426 > Last group's overhead is 1430 > Need 649474 data blocks in last group > Final size of last group is 650904 > Estimated blocks needed: 4391437088 > Extents safety margin: 2826959 > Filesystem at /dev/md0 is mounted on /server; on-line resizing required > old_desc_blocks = 2768, new_desc_blocks = 2795 > ./resize2fs: Invalid argument While checking for on-line resizing support > > [489412.650430] EXT4-fs (md0): resizing filesystem from 5804916736 to > 5860149888 blocks > [489412.700282] EXT4-fs warning (device md0): verify_reserved_gdb:713: > reserved GDT 2769 missing grp 177147 (5804755665) > [489412.739676] EXT4-fs (md0): resized filesystem to 5860149888 > [489413.215230] EXT4-fs warning (device md0): ext4_group_extend:1720: can't > shrink FS - resize aborted And I guess that attached patch can fix the online resizing issue. Ted, could you take a look? Thanks. Azat. --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index bb0e80f..38f7ced 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -1928,7 +1928,8 @@ retry: n_desc_blocks = o_desc_blocks + le16_to_cpu(es->s_reserved_gdt_blocks); n_group = n_desc_blocks * EXT4_DESC_PER_BLOCK(sb); - n_blocks_count = n_group * EXT4_BLOCKS_PER_GROUP(sb); + n_blocks_count = (ext4_fsblk_t)n_group * + EXT4_BLOCKS_PER_GROUP(sb); n_group--; /* set to last group number */ }