[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0906231634210.2767@localhost.localdomain>
Date: Tue, 23 Jun 2009 16:41:14 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Matthew Wilcox <matthew@....cx>
cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] dmapools: protect page_list walk in show_pools()
show_pools() walks the page_list of a pool w/o protection against the
list modifications in alloc/free. Take pool->lock to avoid stomping
into nirvana.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
diff --git a/mm/dmapool.c b/mm/dmapool.c
index b1f0885..3df0637 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -86,10 +86,12 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf)
unsigned pages = 0;
unsigned blocks = 0;
+ spin_lock_irq(&pool->lock);
list_for_each_entry(page, &pool->page_list, page_list) {
pages++;
blocks += page->in_use;
}
+ spin_unlock_irq(&pool->lock);
/* per-pool info, no real statistics yet */
temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n",
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists