From: Theodore Ts'o Subject: Re: [PATCH] mke2fs: Fix block bitmaps initalization with -O ^resize_inode Date: Wed, 4 Dec 2013 21:09:40 -0500 Message-ID: <20131205020939.GB8404@thunk.org> References: <52662BBA.70503@rs.jp.nec.com> <20131123013336.GD10269@birch.djwong.org> <20131126012706.GF10269@birch.djwong.org> <003101ceea7f$08d3fda0$1a7bf8e0$@rs.jp.nec.com> <20131127005505.GG10269@birch.djwong.org> <00d301ceec16$de11fec0$9a35fc40$@rs.jp.nec.com> <20131130200624.GA9541@birch.djwong.org> <20131204234435.GF19914@thunk.org> <20131205012210.GC10150@birch.djwong.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Akira Fujita , 'ext4 development' To: "Darrick J. Wong" Return-path: Received: from imap.thunk.org ([74.207.234.97]:36659 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756261Ab3LECJm (ORCPT ); Wed, 4 Dec 2013 21:09:42 -0500 Content-Disposition: inline In-Reply-To: <20131205012210.GC10150@birch.djwong.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Wed, Dec 04, 2013 at 05:22:10PM -0800, Darrick J. Wong wrote: > Right now, e2fsck and resize2fs take care of (B) on their own. > > One of my patches fixes everything else (debugfs, dumpe2fs, fuse2fs, tune2fs) > to take care of (B) by doing it in the library. I can't think of a scenario > where it'd be useful to run around with something like this: > > # mke2fs -t ext4 /dev/vda -O ^resize_inode,meta_bg > # dumpe2fs /dev/vda > > Group 1: (Blocks 32768-65535) [INODE_UNINIT, BLOCK_UNINIT] > Checksum 0xa85c, unused inodes 8192 > Backup superblock at 32768, Group descriptor at 32769 > ^^^^^ ^^^^^ > Block bitmap at 3 (bg #0 + 3), Inode bitmap at 19 (bg #0 + 19) > Inode table at 546-1057 (bg #0 + 546) > 32766 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes > Free blocks: 32768-65535 > ^^^^^ <------------------ HEY! > Free inodes: 8193-16384 > > > # debugfs /dev/vda -R 'testb 32768' > Block 32768 not in use I'm not that concerned about dumpe2fs and debugfs, since that's just a display issue. What's more important is that lib/ext2fs/alloc.c correctly handles allocations --- see check_block_uninit() and check_inode_uninit() in lib/ext2fs/alloc.c. We do take care of initializing the portion of the allocation bitmap. This is good, because it means that e2tools will do the right thing when it writes files to an ext4 file system that has BLOCK_UNINIT set in a block group. - Ted