linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: Weird resize2fs failures when mounting ext3 as ext4
Date: Sun, 21 Apr 2013 19:30:57 -0400	[thread overview]
Message-ID: <20130421233057.GA5625@thunk.org> (raw)
In-Reply-To: <51229FF7.7090003@redhat.com>

On Mon, Feb 18, 2013 at 03:41:11PM -0600, Eric Sandeen wrote:
> Can't remember how I stumbled on this testcase, but mounting
> an ext3 filesystem with "-t ext4" and then resizing leads to trouble.

Is there a bugzilla entry for this?  I found the problem and a fix;
patch follows in a moment.

Also, here's a simplified repro that doesn't require LVM.  The bug was
introduced in commit fb0a387dcdc, so it goes back to 2.6.32.  It only
affects block allocations for files that aren't extent mapped, and is
caused by the fact that the online resizer wasn't updating
s_blockfile_groups (which was introduced in commit fb0a387dcdc).

						- Ted

#!/bin/bash

COUNT=15
SIZE_1=15G
SIZE_2=16G
DEVICE=/dev/vdc
XFS_IO=/root/xfstests/bin/xfs_io

mkdir -p mnt
umount mnt &>/dev/null
mkfs.ext3  $DEVICE $SIZE_1
mount -t ext4 -o nodelalloc $DEVICE mnt/

for I in `seq 1 $COUNT`; do mkdir mnt/dir$I; dd if=/dev/zero of=mnt/dir$I/file$I bs=1M count=1024; done
echo "before growing:"
df mnt/

umount mnt
mount -t ext4 -o nodelalloc $DEVICE mnt/

echo "growing:"
#export RESIZE2FS_KERNEL_VERSION=3.2.0
strace -o /tmp/resize2fs.strace resize2fs $DEVICE $SIZE_2

echo "done growing:"
df mnt/

# This gets ENOSPC for all of them
echo "try extending files:"
for I in `seq 1 $COUNT`; do $XFS_IO -f -F -c "pwrite -b 4m 1G 50m" mnt/dir$I/file$I; done 
df mnt/

umount mnt


  parent reply	other threads:[~2013-04-21 23:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 21:41 Weird resize2fs failures when mounting ext3 as ext4 Eric Sandeen
2013-02-21  6:07 ` Theodore Ts'o
2013-02-21 16:22   ` Eric Sandeen
2013-04-21 23:30 ` Theodore Ts'o [this message]
2013-04-22  0:06   ` [PATCH] ext4: fix online resizing for ext3-compat file systems Theodore Ts'o
2013-04-22  1:38   ` Weird resize2fs failures when mounting ext3 as ext4 Eric Sandeen
2013-04-22  1:47     ` Theodore Ts'o
2013-04-22  1:56       ` Eric Sandeen

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=20130421233057.GA5625@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).