X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosc%2Fosc_cache.c;h=23dc755807ce314e1f406ee79739442f5055147d;hp=b67911b9b70a3291d661ce31b205b261b05e832b;hb=3762e55302ac6df9818b791f065acb8e716af6f9;hpb=3b7d840a6f1ca207ec810272013bc7aa3907f96b diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index b67911b..23dc755 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -2678,6 +2678,10 @@ void osc_cache_truncate_end(const struct lu_env *env, struct osc_io *oio, OSC_EXTENT_DUMP(D_CACHE, ext, "trunc -> cache.\n"); osc_object_lock(obj); osc_extent_state_set(ext, OES_CACHE); + if (ext->oe_fsync_wait && !ext->oe_urgent) { + ext->oe_urgent = 1; + cfs_list_move_tail(&ext->oe_link, &obj->oo_urgent_exts); + } osc_update_pending(obj, OBD_BRW_WRITE, ext->oe_nr_pages); osc_object_unlock(obj); osc_extent_put(env, ext); @@ -2808,6 +2812,11 @@ int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj, * grants. We do this for the correctness of fsync. */ LASSERT(hp == 0 && discard == 0); ext->oe_urgent = 1; + break; + case OES_TRUNC: + /* this extent is being truncated, can't do anything + * for it now. it will be set to urgent after truncate + * is finished in osc_cache_truncate_end(). */ default: break; }