From: Jinshan Xiong Date: Thu, 27 Dec 2012 20:47:38 +0000 (-0800) Subject: LU-2531 osc: evict extents in trunc whatever happens X-Git-Tag: 2.3.59~16 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2b9bf34b87597bc5235c5dff01ae2ec0b2a02d91 LU-2531 osc: evict extents in trunc whatever happens 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 Change-Id: Iaae1228d0f1c488c5deaf938761715ee3984ac3d Reviewed-on: http://review.whamcloud.com/4896 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin Tested-by: Oleg Drokin Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index 367d321..ebdb17b 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -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); }