All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] ext4: Fix crash during online resizing
Date: Mon, 11 Feb 2019 13:43:35 -0500	[thread overview]
Message-ID: <20190211184335.GN23000@mit.edu> (raw)
In-Reply-To: <20190124162606.9686-1-jack@suse.cz>

On Thu, Jan 24, 2019 at 05:26:06PM +0100, Jan Kara wrote:
> When computing maximum size of filesystem possible with given number of
> group descriptor blocks, we forget to include s_first_data_block into
> the number of blocks. Thus for filesystems with non-zero
> s_first_data_block it can happen that computed maximum filesystem size
> is actually lower than current filesystem size which confuses the code
> and eventually leads to a BUG_ON in ext4_alloc_group_tables() hitting on
> flex_gd->count == 0. The problem can be reproduced like:
> 
> truncate -s 100g /tmp/image
> mkfs.ext4 -b 1024 -E resize=262144 /tmp/image 32768
> mount -t ext4 -o loop /tmp/image /mnt
> resize2fs /dev/loop0 262145
> resize2fs /dev/loop0 300000
> 
> Fix the problem by properly including s_first_data_block into the
> computed number of filesystem blocks.
> 
> CC: stable@vger.kernel.org
> Fixes: 1c6bd7173d66 "ext4: convert file system to meta_bg if needed..."
> Signed-off-by: Jan Kara <jack@suse.cz>

Thanks, applied.

					- Ted

      reply	other threads:[~2019-02-11 18:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 16:26 [PATCH] ext4: Fix crash during online resizing Jan Kara
2019-02-11 18:43 ` Theodore Y. Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190211184335.GN23000@mit.edu \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.