From 47cbe90691a57616114eb1a65288d0ab9fec11e1 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Sun, 15 Mar 2009 18:42:34 +0000 Subject: [PATCH] STABLE14-cellservdb-proc-file-glocking-20090315 LICENSE IPL10 FIXES 124407 hold GLOCK appropriately when dealing with the proc file (cherry picked from commit 6308037dec22d5a141fc64a11472b1a36585deb2) --- src/afs/LINUX/osi_module.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index 8a7a2ac44..12ac6948d 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -83,6 +83,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) struct afs_q *cq, *tq; loff_t n = 0; + AFS_GLOCK(); ObtainReadLock(&afs_xcell); for (cq = CellLRU.next; cq != &CellLRU; cq = tq) { tq = QNext(cq); @@ -91,8 +92,9 @@ static void *c_start(struct seq_file *m, loff_t *pos) break; } if (cq == &CellLRU) - return NULL; + cq = NULL; + AFS_GUNLOCK(); return cq; } @@ -100,18 +102,23 @@ static void *c_next(struct seq_file *m, void *p, loff_t *pos) { struct afs_q *cq = p, *tq; + + AFS_GLOCK(); (*pos)++; tq = QNext(cq); if (tq == &CellLRU) - return NULL; + tq = NULL; + AFS_GUNLOCK(); return tq; } static void c_stop(struct seq_file *m, void *p) { + AFS_GLOCK(); ReleaseReadLock(&afs_xcell); + AFS_GUNLOCK(); } static int c_show(struct seq_file *m, void *p) -- 2.39.5