mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-22 05:23:17 +00:00
btrfs-progs: fix hole error output in fsck
If we don't find holes in our hole rb tree we'll just assume there's a gap from 0 to the length of the file and print that out. But this simply isn't correct, we could have a gap between the last extent and the isize, or 0 and the start of the first extent. Fix the error message to tell us exactly where the hole is. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f2832d534b
commit
1173a4ba26
18
check/main.c
18
check/main.c
@ -638,10 +638,20 @@ static void print_inode_error(struct btrfs_root *root, struct inode_record *rec)
|
||||
hole->start, hole->len);
|
||||
node = rb_next(node);
|
||||
}
|
||||
if (!found)
|
||||
fprintf(stderr, "\tstart: 0, len: %llu\n",
|
||||
round_up(rec->isize,
|
||||
root->fs_info->sectorsize));
|
||||
if (!found) {
|
||||
u64 start, len;
|
||||
if (rec->extent_end < rec->isize) {
|
||||
start = rec->extent_end;
|
||||
len = round_up(rec->isize,
|
||||
root->fs_info->sectorsize) -
|
||||
start;
|
||||
} else {
|
||||
start = 0;
|
||||
len = rec->extent_start;
|
||||
}
|
||||
fprintf(stderr, "\tstart: %llu, len: %llu\n", start,
|
||||
len);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print dir item with mismatch hash */
|
||||
|
Loading…
Reference in New Issue
Block a user