]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix regression in lock_delalloc_pages
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 7 Mar 2017 02:20:56 +0000 (18:20 -0800)
committerChris Mason <clm@fb.com>
Fri, 17 Mar 2017 20:47:09 +0000 (13:47 -0700)
commitcd680b09e3c5f77ced79e5d5728e538c60c5e018
tree880f0ad774ba62ec99733632d306339b742fc3e6
parente946a7e4377f7481a56f1eed72b67830a7a5dc41
Btrfs: fix regression in lock_delalloc_pages

The bug is a regression after commit
(83ddda0edbef "btrfs: teach __process_pages_contig about PAGE_LOCK operation")
and commit
(841b3caca2e4 "Btrfs: use helper to simplify lock/unlock pages").

So if the dirty pages which are under writeback got truncated partially
before we lock the dirty pages, we couldn't find all pages mapping to the
delalloc range, and the bug didn't return an error so it kept going on and
found that the delalloc range got truncated and got to unlock the dirty
pages, and then the ASSERT could caught the error, and showed

-----------------------------------------------------------------------------
assertion failed: page_ops & PAGE_LOCK, file: fs/btrfs/extent_io.c, line: 1716
-----------------------------------------------------------------------------

This fixes the bug by returning the proper -EAGAIN.

Cc: David Sterba <dsterba@suse.com>
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c