aboutsummaryrefslogtreecommitdiff
path: root/lib/cpu-notifier-error-inject.c
diff options
context:
space:
mode:
authorLiu Bo <[email protected]>2016-07-11 10:39:07 -0700
committerDavid Sterba <[email protected]>2016-07-26 13:52:25 +0200
commitbaf863b9c29617cc9eaf24e039f58846e700db48 (patch)
tree916fe6a7c3967160de5d6d991dd6e1088953add8 /lib/cpu-notifier-error-inject.c
parentf49070957ffed84feb7944550f7edd53672b5201 (diff)
Btrfs: fix eb memory leak due to readpage failure
eb->io_pages is set in read_extent_buffer_pages(). In case of readpage failure, for pages that have been added to bio, it calls bio_endio and later readpage_io_failed_hook() does the work. When this eb's page (couldn't be the 1st page) fails to add itself to bio due to failure in merge_bio(), it cannot decrease eb->io_pages via bio_endio, and ends up with a memory leak eventually. This lets __do_readpage propagate errors to callers and adds the 'atomic_dec(&eb->io_pages)'. Signed-off-by: Liu Bo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions