]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: check io_ctl_prepare_pages return in __btrfs_write_out_cache
authorOmar Sandoval <osandov@osandov.com>
Tue, 24 Feb 2015 10:47:06 +0000 (02:47 -0800)
committerChris Mason <clm@fb.com>
Sun, 26 Apr 2015 13:27:01 +0000 (06:27 -0700)
commit0683ce0ad3ceaa1607fb3b362b6a36119034820f
treebd2135e03872c758cb1f543e1f02e40f71fcdd16
parent75f3f7e6408f65bbde9ef1ba3186a8a1008823dc
btrfs: check io_ctl_prepare_pages return in __btrfs_write_out_cache

If io_ctl_prepare_pages fails, the pages in io_ctl.pages are not valid.
When we try to access them later, things will blow up in various ways.

Also fix the comment about the return value, which is an errno on error,
not -1, and update the cases where it was not.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/free-space-cache.c