mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
btrfs: make find_workspace warn if there are no workspaces
Be verbose if there are no workspaces at all, ie. the module init time preallocation failed. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e721e49dd1
commit
523567168d
1 changed files with 14 additions and 0 deletions
|
@ -834,7 +834,21 @@ static struct list_head *find_workspace(int type)
|
||||||
* workspace preallocated for each type and the compression
|
* workspace preallocated for each type and the compression
|
||||||
* time is bounded so we get to a workspace eventually. This
|
* time is bounded so we get to a workspace eventually. This
|
||||||
* makes our caller's life easier.
|
* makes our caller's life easier.
|
||||||
|
*
|
||||||
|
* To prevent silent and low-probability deadlocks (when the
|
||||||
|
* initial preallocation fails), check if there are any
|
||||||
|
* workspaces at all.
|
||||||
*/
|
*/
|
||||||
|
if (atomic_read(total_ws) == 0) {
|
||||||
|
static DEFINE_RATELIMIT_STATE(_rs,
|
||||||
|
/* once per minute */ 60 * HZ,
|
||||||
|
/* no burst */ 1);
|
||||||
|
|
||||||
|
if (__ratelimit(&_rs)) {
|
||||||
|
printk(KERN_WARNING
|
||||||
|
"no compression workspaces, low memory, retrying");
|
||||||
|
}
|
||||||
|
}
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
return workspace;
|
return workspace;
|
||||||
|
|
Loading…
Reference in a new issue