Skip to content
Commit 034f784d authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: replace cleaner_delayed_iput_mutex with a waitqueue



The throttle path doesn't take cleaner_delayed_iput_mutex, which means
we could think we're done flushing iputs in the data space reservation
path when we could have a throttler doing an iput.  There's no real
reason to serialize the delayed iput flushing, so instead of taking the
cleaner_delayed_iput_mutex whenever we flush the delayed iputs just
replace it with an atomic counter and a waitqueue.  This removes the
short (or long depending on how big the inode is) window where we think
there are no more pending iputs when there really are some.

The waiting is killable as it could be indirectly called from user
operations like fallocate or zero-range. Such call sites should handle
the error but otherwise it's not necessary. Eg. flush_space just needs
to attempt to make space by waiting on iputs.

Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
[ add killable comment and changelog parts ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3ece54e5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment