mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
Btrfs: fix inode cache waiters hanging on path allocation failure
[ Upstream commit9d123a35d7] 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:581bb05094("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>
This commit is contained in:
parent
b34203a512
commit
cbbc34abc3
|
|
@ -41,8 +41,10 @@ static int caching_kthread(void *data)
|
|||
return 0;
|
||||
|
||||
path = btrfs_alloc_path();
|
||||
if (!path)
|
||||
if (!path) {
|
||||
fail_caching_thread(root);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Since the commit root is read-only, we can safely skip locking. */
|
||||
path->skip_locking = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user