Whamcloud - gitweb
LU-2531 osc: evict extents in trunc whatever happens
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 27 Dec 2012 20:47:38 +0000 (12:47 -0800)
committerAndreas Dilger <andreas.dilger@intel.com>
Tue, 15 Jan 2013 18:57:50 +0000 (13:57 -0500)
In osc_cache_truncate_start(), we should ignore the return code
of osc_extent_wait() because initiator will handle it and truncate
should continue in anyways.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Iaae1228d0f1c488c5deaf938761715ee3984ac3d
Reviewed-on: http://review.whamcloud.com/4896
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osc/osc_cache.c

index 367d321..ebdb17b 100644 (file)
@@ -2625,6 +2625,8 @@ again:
                        break;
                }
 
+               OSC_EXTENT_DUMP(D_CACHE, ext, "try to trunc:"LPU64".\n", size);
+
                osc_extent_get(ext);
                if (ext->oe_state == OES_ACTIVE) {
                        /* though we grab inode mutex for write path, but we
@@ -2689,13 +2691,17 @@ again:
                osc_extent_put(env, ext);
        }
        if (waiting != NULL) {
-               if (result == 0)
-                       result = osc_extent_wait(env, waiting, OES_INV);
+               int rc;
+
+               /* ignore the result of osc_extent_wait the write initiator
+                * should take care of it. */
+               rc = osc_extent_wait(env, waiting, OES_INV);
+               if (rc < 0)
+                       OSC_EXTENT_DUMP(D_CACHE, ext, "wait error: %d.\n", rc);
 
                osc_extent_put(env, waiting);
                waiting = NULL;
-               if (result == 0)
-                       goto again;
+               goto again;
        }
        RETURN(result);
 }