diff options
author | Chunwei Chen <[email protected]> | 2015-03-05 11:52:26 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-07-29 07:38:15 -0700 |
commit | 21a96fb635fb14a59efe44d7ea6767c5f9a586bc (patch) | |
tree | ad2a1724912309480f55e25d9844dc491b06c583 /man | |
parent | c1718e9580b9b6222be19c1691d3d7b61e503754 (diff) |
Fix "BUG: Bad page state" caused by writeback flag
Commit d958324 fixed the deadlock between page lock and range lock by
unlocking the page lock before acquiring the range lock. However,
this created a new issue #3075.
The problem is that if we can't set the write back bit before releasing
the page lock. Then other processes will be unaware that the page is
under active write back. They may therefore truncate the page,
invalidate the page, or not honor the sync semantics.
To workaround this problem we re-dirty the page before dropping the
page lock. While this doesn't prevent the page from being truncated
it does ensure it won't be invalidated. Then the range lock and the
page lock are reacquired in the correct deadlock-free order.
Once both locks are safely held the page state can be rechecked. If
all is well and the page is in the expect state the dirty bit can be
removed, the write back bit set, and the page removed from the skip
count. If not the page will be handled as appropriate.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3075
Diffstat (limited to 'man')
0 files changed, 0 insertions, 0 deletions