From: Jinshan Xiong Date: Thu, 22 Nov 2012 22:31:36 +0000 (-0800) Subject: LU-2367 osc: unplug IO queue for writeback anyway X-Git-Tag: 2.3.59~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9747825ae27d9234ada1ef442835d08485ec3848 LU-2367 osc: unplug IO queue for writeback anyway osc_io_unplug_async() in osc_extent_release() may not unplug IO queue due to a race in ptlrpc_queue_work(). As a fix, we should unplug it when the page is being flushed or fsync calls. Signed-off-by: Jinshan Xiong Change-Id: Ied1d6ad12b79a28229cdae83a9db9ad9b3189462 Reviewed-on: http://review.whamcloud.com/4659 Reviewed-by: Lai Siyao Reviewed-by: Prakash Surya Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index 469de7f..367d321 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -2444,10 +2444,11 @@ int osc_flush_async_page(const struct lu_env *env, struct cl_io *io, ext->oe_memalloc = 1; ext->oe_urgent = 1; - if (ext->oe_state == OES_CACHE && cfs_list_empty(&ext->oe_link)) { + if (ext->oe_state == OES_CACHE) { OSC_EXTENT_DUMP(D_CACHE, ext, "flush page %p make it urgent.\n", oap); - cfs_list_add_tail(&ext->oe_link, &obj->oo_urgent_exts); + if (cfs_list_empty(&ext->oe_link)) + cfs_list_add_tail(&ext->oe_link, &obj->oo_urgent_exts); unplug = true; } rc = 0; @@ -2830,10 +2831,9 @@ int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj, ext->oe_urgent = 1; list = &obj->oo_urgent_exts; } - if (list != NULL) { + if (list != NULL) cfs_list_move_tail(&ext->oe_link, list); - unplug = true; - } + unplug = true; } else { /* the only discarder is lock cancelling, so * [start, end] must contain this extent */