Skip to contentSkip to conversation

gfs2: Incomplete "sbstat" statistics?

PATCH New Andreas Gruenbacher 2 participants 3 messages Aug 26, 2015 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: Incomplete "sbstat" statistics?

In gfs2_sbstats_seq_show, we are using the first column for the cpu number. We are only iterating over "gltype" times "stype" values so we end up not reporting the last statistic, "journal queue". I assume this is a bug?

---
 fs/gfs2/glock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/glock.c +2 -2
index 1b6aebe..9b6e1a0 100644
@@ -1933,7 +1933,7 @@ static void *gfs2_sbstats_seq_start(struct seq_file *seq, loff_t *pos)
 	struct gfs2_glock_iter *gi = seq->private;
 
 	gi->hash = *pos;
-	if (*pos >= GFS2_NR_SBSTATS)
+	if (*pos > GFS2_NR_SBSTATS)
 		return NULL;
 	preempt_disable();
 	return SEQ_START_TOKEN;
@@ -1945,7 +1945,7 @@ static void *gfs2_sbstats_seq_next(struct seq_file *seq, void *iter_ptr,
 	struct gfs2_glock_iter *gi = seq->private;
 	(*pos)++;
 	gi->hash++;
-	if (gi->hash >= GFS2_NR_SBSTATS) {
+	if (gi->hash > GFS2_NR_SBSTATS) {
 		preempt_enable();
 		return NULL;
 	}
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 gfs2: Incomplete "sbstat" statistics?

----- Original Message -----

Quoted 33 lines

In gfs2_sbstats_seq_show, we are using the first column for the cpu number. We
are only iterating over "gltype" times "stype" values so we end up not reporting the last statistic, "journal queue". I assume this is a bug?

---
 fs/gfs2/glock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/glock.c +1 -1
index 1b6aebe..9b6e1a0 100644
@@ -1933,7 +1933,7 @@ static void *gfs2_sbstats_seq_start(struct seq_file
 *seq, loff_t *pos)
 	struct gfs2_glock_iter *gi = seq->private;
 
 	gi->hash = *pos;
-	if (*pos >= GFS2_NR_SBSTATS)
+	if (*pos > GFS2_NR_SBSTATS)
 		return NULL;
 	preempt_disable();
fs/gfs2/glock.c +1 -1
 	return SEQ_START_TOKEN;
@@ -1945,7 +1945,7 @@ static void *gfs2_sbstats_seq_next(struct seq_file
 *seq, void *iter_ptr,
 	struct gfs2_glock_iter *gi = seq->private;
 	(*pos)++;
 	gi->hash++;
-	if (gi->hash >= GFS2_NR_SBSTATS) {
+	if (gi->hash > GFS2_NR_SBSTATS) {
 		preempt_enable();
 		return NULL;
Quoted 3 lines

}
--
2.4.3

Hi Andreas,

NAK. I'm pretty sure this indexing was intentional. The "0th" entry is just to print the entry number. The rest of the entries are indexed by [index - 1] in function gfs2_sbstats_seq_show. Yeah, it's kind of an obscure way to do it, but it works. :)

Regards,

Bob Peterson
Red Hat File Systems

#2 lore raw

PATCH 1/1 gfs2: Incomplete "sbstat" statistics?

Bob,

2015-08-26 19:45 GMT+02:00 Bob Peterson <[email protected]>:

Quoted 2 lines

NAK. I'm pretty sure this indexing was intentional. The "0th" entry is just to print the entry number.

ah, I see now that the gfs2_gltype array contains a special first entry that makes things balance out again. My mistake.

Thanks,
Andreas