linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: Weird resize2fs failures when mounting ext3 as ext4
Date: Mon, 18 Feb 2013 15:41:11 -0600	[thread overview]
Message-ID: <51229FF7.7090003@redhat.com> (raw)

Can't remember how I stumbled on this testcase, but mounting
an ext3 filesystem with "-t ext4" and then resizing leads to trouble.

With -o nodelalloc, the newly added space isn't seen by the allocator
and we get ENOSPC for the extending writes in the script below.

Without -o nodelalloc, the writes worked but I got an umount hang.

Without -t ext4 (but letting ext4.ko handle the ext3 mount) it seems
to work fine.

Haven't looked into it much at all yet but wanted to put it out
there for posterity.

(script requires xfs_io, sorry, could be changed to dd I suppose)

-Eric

#!/bin/bash

# Initial setup to create block devices prior to test:
# /root/fallocate -l 100g fsfile
# losetup /dev/loop0 fsfile
# pvcreate /dev/loop0
# vgcreate VG /dev/loop0

COUNT=20

mkdir -p mnt
umount mnt &>/dev/null
lvremove -f /dev/VG/LV 
lvcreate -L 75G -n LV /dev/VG
mkfs.ext3 -K /dev/VG/LV 
mount -t ext4 -o nodelalloc /dev/VG/LV 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=4096; done
echo "before growing:"
df mnt/

umount mnt
mount -t ext4 -o nodelalloc /dev/VG/LV mnt/

lvextend -L +5g /dev/VG/LV 

echo "growing:"
resize2fs /dev/VG/LV

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 60m 4g 120m" mnt/dir$I/file$I; done 
df mnt/

umount mnt


             reply	other threads:[~2013-02-18 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 21:41 Eric Sandeen [this message]
2013-02-21  6:07 ` Weird resize2fs failures when mounting ext3 as ext4 Theodore Ts'o
2013-02-21 16:22   ` Eric Sandeen
2013-04-21 23:30 ` Theodore Ts'o
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=51229FF7.7090003@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@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 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).