]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: fix "sdpprf empty after a long run"
authorAmir Vadai <amirv@mellanox.co.il>
Tue, 8 Mar 2011 08:23:24 +0000 (10:23 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:46 +0000 (05:05 -0700)
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 <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_proc.c

index 6fe0136d1064951c8eda182defacbb1fa16baed8..953bb691468225fa74a5c7cf69baa6b2a87d2d50 100644 (file)
@@ -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) {