Skip to content

btrfs: workqueue fixes+cleanups

Omar Sandoval linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7btrfs: get rid of unnecessary memset() of work itemfs/btrfs/qgroup.c+0 -21 reply
2/7btrfs: don't prematurely free work in run_ordered_work()fs/btrfs/async-thread.c+44 -121 reply
3/7btrfs: don't prematurely free work in end_workqueue_fn()fs/btrfs/disk-io.c+1 -11 reply
4/7btrfs: don't prematurely free work in reada_start_machine_worker()fs/btrfs/reada.c+4 -61 reply
5/7btrfs: don't prematurely free work in scrub_missing_raid56_worker()fs/btrfs/scrub.c+1 -21 reply
6/7btrfs: get rid of unique workqueue helper functionsfs/btrfs/async-thread.c fs/btrfs/async-thread.h fs/btrfs/block-group.c +9 more+50 -1450 replies
7/7btrfs: get rid of pointless wtag variable in async-thread.cfs/btrfs/async-thread.c include/trace/events/btrfs.h+11 -160 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchNikolay BorisovFilipe MananaJohannes Thumshirn
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/7] btrfs: workqueue fixes+cleanups

From: Omar Sandoval <[email protected]>

Hello,

This series fixes a few issues with Btrfs' use of workqueues.

The bulk of this series fixes multiple cases of the same bug: a work item shouldn't be freed while it potentially depends on any other work items. Currently, we've mostly been side-stepping this issue by having different work functions for different work types (see commit 9e0af2376434 ("Btrfs: fix task hang under heavy compressed write"). However, there are cases where a work function can depend on itself, usually through stacked filesystems (e.g., loop devices).

Patch 1 is a trivial cleanup.

Patches 2-5 fix all of the cases of this bug that I could find. Patch 2 is the ordered_free fix I previously sent [1], now with an updated title and Josef's fix [2] folded in. Patch 3 fixes the deadlock reported with my previous cleanup, and patches 4 and 5 fix similar issues.

With all of those fixed, patch 6 is my previous cleanup [3] to get rid of the different work functions. Patch 7 is the same cleanup [4] as from before.

Based on misc-next.

Thanks!

1: https://lore.kernel.org/linux-btrfs/0bea516a54b26e4e1c42e6fe47548cb48cc4172b.1565112813.git.osandov@fb.com/
2: https://lore.kernel.org/linux-btrfs/[email protected]/
3: https://lore.kernel.org/linux-btrfs/afaf532af471dd1a8a1f4af9de570127529323b0.1565717248.git.osandov@fb.com/
4: https://lore.kernel.org/linux-btrfs/d4fa1870ffce027ada265a67f4e00d397b683241.1565717248.git.osandov@fb.com/

Omar Sandoval (7):
btrfs: get rid of unnecessary memset() of work item
btrfs: don't prematurely free work in run_ordered_work()
btrfs: don't prematurely free work in end_workqueue_fn()
btrfs: don't prematurely free work in reada_start_machine_worker()
btrfs: don't prematurely free work in scrub_missing_raid56_worker()
btrfs: get rid of unique workqueue helper functions
btrfs: get rid of pointless wtag variable in async-thread.c

 fs/btrfs/async-thread.c      | 107 +++++++++++++++++------------------
 fs/btrfs/async-thread.h      |  33 +----------
 fs/btrfs/block-group.c       |   3 +-
 fs/btrfs/delayed-inode.c     |   4 +-
 fs/btrfs/disk-io.c           |  36 ++++--------
 fs/btrfs/inode.c             |  36 ++++--------
 fs/btrfs/ordered-data.c      |   1 -
 fs/btrfs/qgroup.c            |   3 -
 fs/btrfs/raid56.c            |   5 +-
 fs/btrfs/reada.c             |  13 ++---
 fs/btrfs/scrub.c             |  17 +++---
 fs/btrfs/volumes.c           |   3 +-
 include/trace/events/btrfs.h |   6 +-
 13 files changed, 97 insertions(+), 170 deletions(-)
Signature · 1 line
2.23.0