Btrfs: fix inode cache waiters hanging on failure to start caching thread
authorFilipe Manana <fdmanana@suse.com>
Thu, 4 Jul 2019 15:24:32 +0000 (16:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:12 +0000 (14:51 +0100)
commitb34203a51250f649fe870fe2253a75fff03e1d96
tree75ea0c870768d570b13dd8dceb103eb43264cb66
parentfe4929accb4511a3bb360a75332943c0323bc6e0
Btrfs: fix inode cache waiters hanging on failure to start caching thread

[ Upstream commit a68ebe0790fc88b4314d17984a2cf99ce2361901 ]

If we fail to start the inode caching thread, we print an error message
and disable the inode cache, however we never wake up any waiters, so they
hang forever waiting for the caching to finish. Fix this by waking them
up and have them fallback to a call to btrfs_find_free_objectid().

Fixes: e60efa84252c05 ("Btrfs: avoid triggering bug_on() when we fail to start inode caching task")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/inode-map.c