Commit 9001a6cb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] loop: don't lose PF_MEMDIE

From: Hugh Dickins <hugh@veritas.com>

loop_get_buffer loses PF_MEMDIE if it's added while in loop_copy_bio: not a
high probability since it's not waiting there, but could happen, and sets a
bad example (compare with add_to_swap fixed a while back).
parent 665cc275
......@@ -484,7 +484,9 @@ static struct bio *loop_get_buffer(struct loop_device *lo, struct bio *rbh)
current->flags &= ~PF_MEMALLOC;
bio = loop_copy_bio(rbh);
current->flags = flags;
if (flags & PF_MEMALLOC)
current->flags |= PF_MEMALLOC;
if (bio == NULL)
blk_congestion_wait(WRITE, HZ/10);
} while (bio == NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment