From: Chaskiel M Grundman Date: Sun, 15 Mar 2009 18:42:23 +0000 (+0000) Subject: DEVEL15-cellservdb-proc-file-glocking-20090315 X-Git-Tag: openafs-devel-1_5_58~112 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d0cf16e6761e2c3c0679ce0d18aea9991a745ed2;p=packages%2Fo%2Fopenafs.git DEVEL15-cellservdb-proc-file-glocking-20090315 LICENSE IPL10 FIXES 124407 hold GLOCK appropriately when dealing with the proc file (cherry picked from commit 6308037dec22d5a141fc64a11472b1a36585deb2) --- diff --git a/src/afs/LINUX/osi_proc.c b/src/afs/LINUX/osi_proc.c index 75ee013bf..cf5497c3a 100644 --- a/src/afs/LINUX/osi_proc.c +++ b/src/afs/LINUX/osi_proc.c @@ -46,6 +46,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); @@ -54,8 +55,9 @@ static void *c_start(struct seq_file *m, loff_t *pos) break; } if (cq == &CellLRU) - return NULL; + cq = NULL; + AFS_GUNLOCK(); return cq; } @@ -63,18 +65,22 @@ 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; + 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)