[PATCH] loop 9/9 don't lose PF_MEMDIE

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Jun 10 2003 - 10:38:03 EST


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).

--- loop8/drivers/block/loop.c Tue Jun 10 11:55:11 2003
+++ loop9/drivers/block/loop.c Tue Jun 10 12:05:17 2003
@@ -484,7 +484,9 @@
 
                 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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:24 EST