From: Filipe Manana Date: Thu, 4 Jul 2019 15:24:44 +0000 (+0100) Subject: Btrfs: fix inode cache waiters hanging on path allocation failure X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9d123a35d7e97bb2139747b16127c9b22b6a593e;p=openwrt%2Fstaging%2Fblogic.git Btrfs: fix inode cache waiters hanging on path allocation failure 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 Signed-off-by: Filipe Manana Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c index c242ae434355..c692c8b6e371 100644 --- a/fs/btrfs/inode-map.c +++ b/fs/btrfs/inode-map.c @@ -42,8 +42,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;