return 0;
}
-static bool report_eb_range(const struct extent_buffer *eb, unsigned long start,
- unsigned long len)
+/* Never inlined to decrease code size, as this is called in a cold path. */
+static noinline void report_eb_range(const struct extent_buffer *eb,
+ unsigned long start, unsigned long len)
{
btrfs_warn(eb->fs_info,
"access to eb bytenr %llu len %u out of range start %lu len %lu",
eb->start, eb->len, start, len);
DEBUG_WARN();
-
- return true;
}
/*
unsigned long offset;
/* start, start + len should not go beyond eb->len nor overflow */
- if (unlikely(check_add_overflow(start, len, &offset) || offset > eb->len))
- return report_eb_range(eb, start, len);
+ if (unlikely(check_add_overflow(start, len, &offset) || offset > eb->len)) {
+ report_eb_range(eb, start, len);
+ return true;
+ }
return false;
}