linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Weird resize2fs failures when mounting ext3 as ext4
@ 2013-02-18 21:41 Eric Sandeen
  2013-02-21  6:07 ` Theodore Ts'o
  2013-04-21 23:30 ` Theodore Ts'o
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2013-02-18 21:41 UTC (permalink / raw)
  To: ext4 development

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-22  1:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).