From: Amir Vadai Date: Tue, 8 Mar 2011 08:23:24 +0000 (+0200) Subject: sdp: fix "sdpprf empty after a long run" X-Git-Tag: v4.1.12-92~264^2~5^2~25 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=74bb1807369c3fc3988c86bfaedb7c7195c1c88a;p=users%2Fjedix%2Flinux-maple.git sdp: fix "sdpprf empty after a long run" sdpprf_log_count gets to a negative value after a long run. This is only a quick fix - still might loose logs sometimes. Signed-off-by: Amir Vadai --- diff --git a/drivers/infiniband/ulp/sdp/sdp_proc.c b/drivers/infiniband/ulp/sdp/sdp_proc.c index 6fe0136d10649..953bb69146822 100644 --- a/drivers/infiniband/ulp/sdp/sdp_proc.c +++ b/drivers/infiniband/ulp/sdp/sdp_proc.c @@ -516,7 +516,8 @@ static void *sdpprf_start(struct seq_file *p, loff_t *pos) return SEQ_START_TOKEN; } - if (*pos >= MIN(atomic_read(&sdpprf_log_count), SDPPRF_LOG_SIZE)) + if (atomic_read(&sdpprf_log_count) > 0 && + *pos >= MIN(atomic_read(&sdpprf_log_count), SDPPRF_LOG_SIZE)) return NULL; if (atomic_read(&sdpprf_log_count) >= SDPPRF_LOG_SIZE - 1) {