fs/proc/array.c buglet

From: David Mosberger (davidm@hpl.hp.com)
Date: Thu Oct 12 2000 - 13:07:33 EST


The attached 1-character change fixes a performance bug in
linux-2.4.0-test9 (and earlier). Without this patch, something as
simple as "cat /proc/self/maps" will read the "maps" file line by
line.

        --david

--- linux-2.4.0-test9/fs/proc/array.c Fri Sep 8 14:34:59 2000
+++ lia64-kdb/fs/proc/array.c Mon Oct 9 19:01:07 2000
@@ -575,7 +575,7 @@
                 goto getlen_out;
 
         /* Check whether the mmaps could change if we sleep */
- volatile_task = (task != current || atomic_read(&mm->mm_users) > 1);
+ volatile_task = (task != current || atomic_read(&mm->mm_users) > 2);
 
         /* decode f_pos */
         lineno = *ppos >> MAPS_LINE_SHIFT;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:23 EST