summaryrefslogtreecommitdiff
path: root/inode.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2014-12-09 16:27:24 +0800
committerDavid Sterba <dsterba@suse.cz>2014-12-10 11:55:17 +0100
commited3a206c8f4d71469db5899a5a4d6659b315489e (patch)
treee951f435cb2c4cf2f1cb108a4c05ecbedc9ac0bc /inode.c
parent378eacf815893cad989463b0917dcd2dd6553438 (diff)
btrfs-progs: Record highest inode number before repair.
Record highest inode number before inode repair. This is especially important for corrupted leaf case. Under that case, if use btrfs_find_free_objectid, it may find a ino existing in corrupted leaf but dropped by btree_recover. If that happens, created dir will be referenced incorrectly since there may be inode_ref or dir_index/item refers to it. So we must record the highest inode number according to the inode_cache. Inode_cache is OK since when a inode_ref or dir_index/item is found even the referenced source is not found, it will be created. If we record the highest inode number of inode_cache, and use highest_inode + 1 as 'lost+found' dir, it will ensure the newly created dir not conflicting with any possible inode. This provides the basis for nlink or inode rebuild for repairing btrfs with leaf/node corruption. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'inode.c')
0 files changed, 0 insertions, 0 deletions