Fix another !PageUptodate related warning
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: do not SetPageError on a read error for extent buffersfs/ | +0 | 1 reply | |
| 2/2 | btrfs: do not WARN_ON() if we have PageError setfs/ | +14 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] Fix another !PageUptodate related warning
We hit a warning in generic/281 in our overnight testing. This is the same error that I thought I fixed with c2e39305299f01 ("btrfs: clear extent buffer uptodate when we fail to write it"), however all I did was make the race window much smaller.
The race is relatively simple
Task 1 Task 2switch_commit_roots()
btrfs_search_slot(path->search_commit_root) btrfs_write_and_wait_transaction() start processing path->nodes[0]
write failureend_bio_extent_buffer_writepage
ClearPageUptodate()
try to read from the extent buffer
trigger warning
There's no real way to stop this without adding some heavy handed locking in here to make sure we don't invalidate an extent buffer while we're reading it. And we can't really add more locking because this particular path uses ->skip_locking, so we'd have to be very intentional about what we're wanting to do.
To fix this we need two things. First is to be consistent with how we use PageError. Everybody uses it for writes, and in fact that's how we use it with the exception of one error path on the extent buffer read. So first fix that so we don't ever have PageError without a write error.
Secondly change assert_eb_page_uptodate() to only WARN_ON if !Uptodate && !Error, so we get a warning if we didn't properly read an extent buffer, but not if we failed to write the buffer out. With this I'm now able to run 100 runs of generic/281 without warnings, whereas before it reproduced in around 10 runs. Thanks,
Josef
Josef Bacik (2):
btrfs: do not SetPageError on a read error for extent buffers
btrfs: do not WARN_ON() if we have PageError set
fs/btrfs/extent_io.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.3