File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -834,7 +834,21 @@ static struct list_head *find_workspace(int type)
834
834
* workspace preallocated for each type and the compression
835
835
* time is bounded so we get to a workspace eventually. This
836
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
852
goto again ;
839
853
}
840
854
return workspace ;
You can’t perform that action at this time.
0 commit comments