Whamcloud - gitweb
undo-io: be more flexible about setting block size
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 5 May 2015 14:38:49 +0000 (10:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 5 May 2015 14:39:13 +0000 (10:39 -0400)
commit344cd5325bdbe2f8875da077da23fbdc5503c576
tree034f2de4ac3db87b90582538ffc76dcbfad10915
parentc866515f023702bbc458cdcfdb904344c72ff6fd
undo-io: be more flexible about setting block size

Most of the e2fsprogs utilities set the IO block size multiple times
(once to 1k to read the superblock, then again to set the real block
size if we find a real superblock).  Unfortunately, the undo IO
manager only lets the block size be set once.  For the non-mke2fs
utilities we'd rather catch the real block size and use that.  mke2fs
of course wants to use a really large block size since it's probably
writing a lot of data.

Therefore, if we haven't written any blocks to the undo file, it's
perfectly fine to allow block size changes.  For mke2fs, we'll modify
the IO channel option that lets us set the huge size to lock that
in place.  This greatly reduces index overhead for undo files for
e2fsck/tune2fs/resize2fs while continuing the practice of reducing
it even more for mke2fs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/undo_io.c