Btrfs: avoid potential super block corruption
authorYan Zheng <zheng.yan@oracle.com>
Mon, 5 Jan 2009 20:43:42 +0000 (15:43 -0500)
committerChris Mason <chris.mason@oracle.com>
Mon, 5 Jan 2009 20:43:42 +0000 (15:43 -0500)
commit2d69a0f88459fae35df3ddef4934a2dad67e2765
tree20901742766992c0b1a00e56c5c5535daa8be35b
parentdd3fd8bdf7238f99561ee236060b04d5b9a84953
Btrfs: avoid potential super block corruption

The data in fs_info->super_for_commit are zeros before the
first transaction commit. If tree log sync and system crash
both occur before the first transaction commit, super block
will get corrupted.

This fixes it by properly filling in the super_for_commit field at
open time.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
fs/btrfs/disk-io.c