On Fri, Feb 10, 2017 at 08:12:35PM -0800, Pat Erley wrote:


On 02/10/17 15:03, Omar Sandoval wrote:
From: Omar Sandoval <osan...@fb.com>

If btrfs_decompress_buf2page() is handed a bio with its page in the
middle of the working buffer, then we adjust the offset into the working
buffer. After we copy into the bio, we advance the iterator by the
number of bytes we copied. Then, we have some logic to handle the case
of discontiguous pages and adjust the offset into the working buffer
again. However, if we didn't advance the bio to a new page, we may enter
this case in error, essentially repeating the adjustment that we already
made when we entered the function. The end result is bogus data in the
bio.

Previously, we only checked for this case when we advanced to a new
page, but the conversion to bio iterators changed that. This restores
the old, correct behavior.

I can confirm this fixes the corruption I was seeing

Feel free to add:

Tested-by: Pat Erley <pat-l...@erley.org>

Thanks again Pat for bisecting this down. It passed overnight so I'm sending in right now.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to