[Cluster-devel] [PATCH] gfs2: Incomplete "sbstat" statistics?

Bob Peterson rpeterso at redhat.com
Wed Aug 26 17:45:55 UTC 2015


----- 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 <agruenba at redhat.com>
> ---
>  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




More information about the Cluster-devel mailing list