Message ID | 1306762449-sup-979@shiny (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 70d4579..a95b72e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -596,6 +596,11 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, */ first_page_offset = (sizeof(u32) * num_pages) + sizeof(u64); + if (first_page_offset + sizeof(struct btrfs_free_space_entry) >= PAGE_CACHE_SIZE) { + printk(KERN_CRIT "bad first page offset %lu\n", first_page_offset); + BUG(); + } + /* Get the cluster for this block_group if it exists */ if (block_group && !list_empty(&block_group->cluster_list)) cluster = list_entry(block_group->cluster_list.next,