From: Bob Peterson Date: Wed, 26 Aug 2015 13:45:55 -0400 (EDT) Subject: [Cluster-devel] [PATCH] gfs2: Incomplete "sbstat" statistics? In-Reply-To: <1440598230-15527-1-git-send-email-agruenba@redhat.com> References: <1440598230-15527-1-git-send-email-agruenba@redhat.com> Message-ID: <525878374.17770167.1440611155892.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > 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? > > Signed-off-by: Andreas Gruenbacher > --- > fs/gfs2/glock.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c > index 1b6aebe..9b6e1a0 100644 > --- a/fs/gfs2/glock.c > +++ b/fs/gfs2/glock.c > @@ -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; > } > -- > 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