Rework fs error handling
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: always abort the transaction if we abort a trans handlefs/ fs/ fs/ +2 more | +1 | 1 reply | |
| 2/3 | btrfs: add a btrfs_has_fs_error helperfs/ fs/ fs/ +6 more | +21 | 2 replies | |
| 3/3 | btrfs: do not infinite loop in data reclaim if we abortedfs/ | +24 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] Rework fs error handling
Hello,
This series brings together 3 patches I had sent separately, because they mostly depend on eachother. The first is
btrfs: always abort the transaction if we abort a trans handle
Which changes our behavior for trans handles that haven't modified any metadata. Our dependency chain can be complex, and thus we may rely on a particular async action happening and rely on the transaction actually aborting if it fails. Previously if nothing occurred we'd just let the transaction conitue, but this could put us in a bad state. We need to simply always abort the transaction for safety reasons.
That patch allows us to use the next patch
btrfs: add a btrfs_has_fs_error helper
Now that we can rely on FS_STATE_ERROR always being set if something is wrong, we can wrap that check in a helper and convert all the open coded checks for FS_STATE_ERROR and FS_STATE_ABORTED to the new helper.
And finally an actual fix
btrfs: do not infinite loop in data reclaim if we aborted
The async data path could infinite loop if we aborted because it only broke in the case of space_info->full, which would never happen if we weren't full and had aborted the transaction. This is fine stand alone, but I took advantage of the helpers here so I want to make sure the fix goes along with its dependencies. Thanks,
Josef
Josef Bacik (3):
btrfs: always abort the transaction if we abort a trans handle
btrfs: add a btrfs_has_fs_error helper
btrfs: do not infinite loop in data reclaim if we aborted
fs/btrfs/ctree.c | 5 +---- fs/btrfs/ctree.h | 5 +++++ fs/btrfs/disk-io.c | 8 +++----- fs/btrfs/extent-tree.c | 1 - fs/btrfs/extent_io.c | 2 +- fs/btrfs/file.c | 2 +- fs/btrfs/inode.c | 6 +++--- fs/btrfs/scrub.c | 2 +- fs/btrfs/space-info.c | 29 ++++++++++++++++++++++++----- fs/btrfs/super.c | 13 +------------ fs/btrfs/transaction.c | 19 +++++-------------- fs/btrfs/transaction.h | 1 - fs/btrfs/tree-log.c | 2 +- 13 files changed, 46 insertions(+), 49 deletions(-)
Signature · 1 line
2.26.3