Btrfs: check if extent buffer is aligned to sectorsize
Thanks to fuzz testing, we can pass an invalid bytenr to extent buffer via alloc_extent_buffer(). An unaligned eb can have more pages than it should have, which ends up extent buffer's leak or some corrupted content in extent buffer. This adds a warning to let us quickly know what was happening. Now that alloc_extent_buffer() no more returns NULL, this changes its caller and callers of its caller to match with the new error handling. Signed-off-by:Liu Bo <bo.li.liu@oracle.com> Reviewed-by:
David Sterba <dsterba@suse.com> Signed-off-by:
David Sterba <dsterba@suse.com>
Showing
- fs/btrfs/ctree.c 2 additions, 0 deletionsfs/btrfs/ctree.c
- fs/btrfs/disk-io.c 4 additions, 4 deletionsfs/btrfs/disk-io.c
- fs/btrfs/extent-tree.c 6 additions, 4 deletionsfs/btrfs/extent-tree.c
- fs/btrfs/extent_io.c 12 additions, 3 deletionsfs/btrfs/extent_io.c
- fs/btrfs/tree-log.c 2 additions, 2 deletionsfs/btrfs/tree-log.c
- fs/btrfs/volumes.c 2 additions, 2 deletionsfs/btrfs/volumes.c
Loading
Please register or sign in to comment