* [PATCH] resize2fs: do not clear resize inode for 0 resvd blocks
@ 2010-12-21 21:32 Eric Sandeen
2010-12-22 18:55 ` Ted Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2010-12-21 21:32 UTC (permalink / raw)
To: ext4 development
I ran into odd behavior where mkfs.ext4 of a 16T filesystem would
create a resize inode with 0 reserved blocks, and mark the resize_inode
feature.
A subsequent slight downward resize of the filesystem would remove
the resize inode, making any further offline resizing impossible.
This is especially odd in light of the fact that a large downward
resize (say, to 8T) will actually add blocks to the resize inode -
so a small resize removes it, a large resize expands it ...
commit 8ade268cf2fde8629b51bfd1c044a83db88234cd had added this:
If the filesystem is grown to the point where the resize_inode is no
longer needed, clean it up properly so e2fsck doesn't have to.
but, it seems e2fsck does not care about this situation, either.
So, simply leave the resize_inode intact in this case, and everything
seems to be happy.
Note, this is for the 1.41.xx branch.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Index: e2fsprogs/resize/resize2fs.c
===================================================================
--- e2fsprogs.orig/resize/resize2fs.c
+++ e2fsprogs/resize/resize2fs.c
@@ -1711,7 +1711,6 @@ static errcode_t fix_resize_inode(ext2_f
struct ext2_inode inode;
errcode_t retval;
char * block_buf;
- blk_t blk;
if (!(fs->super->s_feature_compat &
EXT2_FEATURE_COMPAT_RESIZE_INODE))
@@ -1723,20 +1722,6 @@ static errcode_t fix_resize_inode(ext2_f
retval = ext2fs_read_inode(fs, EXT2_RESIZE_INO, &inode);
if (retval) goto errout;
- if (fs->super->s_reserved_gdt_blocks == 0) {
- fs->super->s_feature_compat &=
- ~EXT2_FEATURE_COMPAT_RESIZE_INODE;
- ext2fs_mark_super_dirty(fs);
-
- if ((blk = inode.i_block[EXT2_DIND_BLOCK]) != 0)
- ext2fs_block_alloc_stats(fs, blk, -1);
-
- memset(&inode, 0, sizeof(inode));
-
- retval = ext2fs_write_inode(fs, EXT2_RESIZE_INO, &inode);
- goto errout;
- }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] resize2fs: do not clear resize inode for 0 resvd blocks
2010-12-21 21:32 [PATCH] resize2fs: do not clear resize inode for 0 resvd blocks Eric Sandeen
@ 2010-12-22 18:55 ` Ted Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2010-12-22 18:55 UTC (permalink / raw)
To: Eric Sandeen; +Cc: ext4 development
On Tue, Dec 21, 2010 at 03:32:05PM -0600, Eric Sandeen wrote:
> I ran into odd behavior where mkfs.ext4 of a 16T filesystem would
> create a resize inode with 0 reserved blocks, and mark the resize_inode
> feature.
>
> A subsequent slight downward resize of the filesystem would remove
> the resize inode, making any further offline resizing impossible.
>
> This is especially odd in light of the fact that a large downward
> resize (say, to 8T) will actually add blocks to the resize inode -
> so a small resize removes it, a large resize expands it ...
>
> commit 8ade268cf2fde8629b51bfd1c044a83db88234cd had added this:
>
> If the filesystem is grown to the point where the resize_inode is no
> longer needed, clean it up properly so e2fsck doesn't have to.
>
> but, it seems e2fsck does not care about this situation, either.
>
> So, simply leave the resize_inode intact in this case, and everything
> seems to be happy.
>
> Note, this is for the 1.41.xx branch.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-22 18:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21 21:32 [PATCH] resize2fs: do not clear resize inode for 0 resvd blocks Eric Sandeen
2010-12-22 18:55 ` Ted Ts'o
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).