X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flvfs%2Flvfs_lib.c;h=7f5af3d264eacaabebe5d0635542696575a033aa;hb=2df621277398ddcbfcc9f3e9ccc6d7389057363f;hp=3db6b25713e0d5901b3ed37b2af091b8f3c4b47c;hpb=98060d83459ba10409f295898f0ec917f938b4d3;p=fs%2Flustre-release.git diff --git a/lustre/lvfs/lvfs_lib.c b/lustre/lvfs/lvfs_lib.c index 3db6b25..7f5af3d 100644 --- a/lustre/lvfs/lvfs_lib.c +++ b/lustre/lvfs/lvfs_lib.c @@ -58,6 +58,9 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount) if (stats == NULL) return; + LASSERTF(0 <= idx && idx < stats->ls_num, + "idx %d, ls_num %hu\n", idx, stats->ls_num); + /* With per-client stats, statistics are allocated only for * single CPU area, so the smp_id should be 0 always. */ smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID, &flags); @@ -106,6 +109,9 @@ void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx, long amount) if (stats == NULL) return; + LASSERTF(0 <= idx && idx < stats->ls_num, + "idx %d, ls_num %hu\n", idx, stats->ls_num); + /* With per-client stats, statistics are allocated only for * single CPU area, so the smp_id should be 0 always. */ smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID, &flags);