diff options
author | David Sterba <dsterba@suse.com> | 2016-04-26 21:07:39 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-05-10 03:46:16 -0400 |
commit | 523567168da04bae0f88802ddef49d00072c5d58 (patch) | |
tree | 9e5341242e6becf6a81a0bdea5ac080b3f1797a3 | |
parent | e721e49dd1681d45d71919f0561f5e978a34153c (diff) |
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>
-rw-r--r-- | fs/btrfs/compression.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index c70625560265..658c39b70fba 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -834,7 +834,21 @@ again: | |||
834 | * workspace preallocated for each type and the compression | 834 | * workspace preallocated for each type and the compression |
835 | * time is bounded so we get to a workspace eventually. This | 835 | * time is bounded so we get to a workspace eventually. This |
836 | * makes our caller's life easier. | 836 | * makes our caller's life easier. |
837 | * | ||
838 | * To prevent silent and low-probability deadlocks (when the | ||
839 | * initial preallocation fails), check if there are any | ||
840 | * workspaces at all. | ||
837 | */ | 841 | */ |
842 | if (atomic_read(total_ws) == 0) { | ||
843 | static DEFINE_RATELIMIT_STATE(_rs, | ||
844 | /* once per minute */ 60 * HZ, | ||
845 | /* no burst */ 1); | ||
846 | |||
847 | if (__ratelimit(&_rs)) { | ||
848 | printk(KERN_WARNING | ||
849 | "no compression workspaces, low memory, retrying"); | ||
850 | } | ||
851 | } | ||
838 | goto again; | 852 | goto again; |
839 | } | 853 | } |
840 | return workspace; | 854 | return workspace; |