diff options
| author | Filipe Manana <fdmanana@suse.com> | 2014-09-22 12:41:04 -0400 |
|---|---|---|
| committer | Chris Mason <clm@fb.com> | 2014-10-03 19:14:58 -0400 |
| commit | 55e3bd2e0c2e1cfb43429b962e61415e0526bc01 (patch) | |
| tree | abb89e714c5ad0532229a19816fbe8aa317b33af | |
| parent | 32be3a1ac6d09576c57063c6c350ca36eaebdbd3 (diff) | |
Btrfs: add missing end_page_writeback on submit_extent_page failure
If submit_extent_page() fails in write_one_eb(), we end up with the current
page not marked dirty anymore, unlocked and marked for writeback. But we never
end up calling end_page_writeback() against the page, which will make calls to
filemap_fdatawait_range (e.g. at transaction commit time) hang forever waiting
for the writeback bit to be cleared from the page.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
| -rw-r--r-- | fs/btrfs/extent_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 78229007f99e..828aded0f8aa 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
| @@ -3663,6 +3663,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, | |||
| 3663 | if (ret) { | 3663 | if (ret) { |
| 3664 | set_bit(EXTENT_BUFFER_IOERR, &eb->bflags); | 3664 | set_bit(EXTENT_BUFFER_IOERR, &eb->bflags); |
| 3665 | SetPageError(p); | 3665 | SetPageError(p); |
| 3666 | end_page_writeback(p); | ||
| 3666 | if (atomic_sub_and_test(num_pages - i, &eb->io_pages)) | 3667 | if (atomic_sub_and_test(num_pages - i, &eb->io_pages)) |
| 3667 | end_extent_buffer_writeback(eb); | 3668 | end_extent_buffer_writeback(eb); |
| 3668 | ret = -EIO; | 3669 | ret = -EIO; |
