staging/lustre/osc: LBUG in osc_lru_reclaim
authorHiroya Nozaki <nozaki.hiroya@jp.fujitsu.com>
Mon, 14 Sep 2015 22:41:25 +0000 (18:41 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Sep 2015 13:26:53 +0000 (06:26 -0700)
LASSERT touches cl_client_cache->ccc_lru without any protection.
So this patch the LASSERT moves to the section protected by
cl_client_cache->ccc_lru_lock

Signed-off-by: Hiroya Nozaki <nozaki.hiroya@jp.fujitsu.com>
Reviewed-on: http://review.whamcloud.com/14901
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6624
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/osc/osc_page.c

index 856d859c385e26a0c3915fe9d0a6451e8a6d73cb..2af3232230ecaedeb17229620e146afc5a6fc03d 100644 (file)
@@ -818,7 +818,6 @@ static int osc_lru_reclaim(struct client_obd *cli)
        int rc;
 
        LASSERT(cache != NULL);
-       LASSERT(!list_empty(&cache->ccc_lru));
 
        rc = osc_lru_shrink(cli, lru_shrink_min);
        if (rc != 0) {
@@ -835,6 +834,8 @@ static int osc_lru_reclaim(struct client_obd *cli)
        /* Reclaim LRU slots from other client_obd as it can't free enough
         * from its own. This should rarely happen. */
        spin_lock(&cache->ccc_lru_lock);
+       LASSERT(!list_empty(&cache->ccc_lru));
+
        cache->ccc_lru_shrinkers++;
        list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);