Eric Sandeen 3e2426bd0e btrfs: fix use of uninit "ret" in end_extent_writepage()
If this condition in end_extent_writepage() is false:

	if (tree->ops && tree->ops->writepage_end_io_hook)

we will then test an uninitialized "ret" at:

	ret = ret < 0 ? ret : -EIO;

The test for ret is for the case where ->writepage_end_io_hook
failed, and we'd choose that ret as the error; but if
there is no ->writepage_end_io_hook, nothing sets ret.

Initializing ret to 0 should be sufficient; if
writepage_end_io_hook wasn't set, (!uptodate) means
non-zero err was passed in, so we choose -EIO in that case.

Signed-of-by: Eric Sandeen <sandeen@redhat.com>

Signed-off-by: Chris Mason <clm@fb.com>
2014-06-13 09:52:28 -07:00
..
2014-06-09 17:20:42 -07:00
2014-06-09 17:20:48 -07:00
2014-06-09 17:20:48 -07:00
2014-06-09 17:20:58 -07:00
2013-11-11 22:03:19 -05:00
2014-06-13 09:52:19 -07:00
2013-03-14 14:57:10 -04:00
2014-06-09 17:20:48 -07:00
2013-02-01 14:24:23 -05:00
2014-03-10 15:15:51 -04:00
2014-01-29 07:06:27 -08:00
2014-01-29 07:06:27 -08:00