Btrfs: fix inode cache waiters hanging on path allocation failure
authorFilipe Manana <fdmanana@suse.com>
Thu, 4 Jul 2019 15:24:44 +0000 (16:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:12 +0000 (14:51 +0100)
commitcbbc34abc395d3cf91265f3b35a29ca76f7c0c04
tree7e684b97f1e4c8f663c37d73e5618de80430dde8
parentb34203a51250f649fe870fe2253a75fff03e1d96
Btrfs: fix inode cache waiters hanging on path allocation failure

[ Upstream commit 9d123a35d7e97bb2139747b16127c9b22b6a593e ]

If the caching thread fails to allocate a path, it returns without waking
up any cache waiters, leaving them hang forever. Fix this by following the
same approach as when we fail to start the caching thread: print an error
message, disable inode caching and make the wakers fallback to non-caching
mode behaviour (calling btrfs_find_free_objectid()).

Fixes: 581bb050941b4f ("Btrfs: Cache free inode numbers in memory")
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