]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/jbd2/journal.c
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[karo-tx-linux.git] / fs / jbd2 / journal.c
index 1ce13479b10dd1f7f1a9193e2df55408eb9abb09..5a0245e362408657e6d101c10c6479ca21aa40eb 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/backing-dev.h>
 #include <linux/bitops.h>
 #include <linux/ratelimit.h>
+#include <linux/sched/mm.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/jbd2.h>
@@ -205,6 +206,14 @@ static int kjournald2(void *arg)
        journal->j_task = current;
        wake_up(&journal->j_wait_done_commit);
 
+       /*
+        * Make sure that no allocations from this kernel thread will ever
+        * recurse to the fs layer because we are responsible for the
+        * transaction commit and any fs involvement might get stuck waiting for
+        * the trasn. commit.
+        */
+       memalloc_nofs_save();
+
        /*
         * And now, wait forever for commit wakeup events.
         */