On Sun, Mar 16, 2008 at 11:16:17PM +0800, Andreas Dilger wrote: > > I guess the third alternative, (c), is that we don't update *any* of > > the superblock or block group descriptors until the very end of the > > transaction, and don't update any of the blocks. So we just update > > the bitmap blocks first, and then in a second pass update all of the > > blockgroup descriptors and superblock. This would require assuring > > that the update of all of the block group descriptors, superblock, and > > removing the inode from the orphan linked list, can all fit in a > > single transaction. If not, this scheme wouldn't work at all. > > I'm not sure I understand this. Wouldn't this possibly lead to those > blocks being re-allocated after a crash? No, because the inode is on the orphan/truncate list, which would get processed as part of mounting the filesystem. So we might end up replaying some of the updates to the bitmaps, and clearing blocks that are already cleared; but that's OK, because clearing the bitmap allocations is an idempotent operation. Incrementing the free blocks count in the superblock and bitmap allocation blocks is *not* idempotent, which means they they (along with removing the inode from the orphaned inode list) all have to be done within a single atomic transaction. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html