Whamcloud - gitweb
LU-4852 osc: osc_extent_truncate()) ASSERTION( !ext->oe_urgent ) failed 04/10204/2
authorAndriy Skulysh <Andriy_Skulysh@xyratex.com>
Sun, 4 May 2014 10:30:27 +0000 (13:30 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Jun 2014 19:32:42 +0000 (19:32 +0000)
The bug was caused by race between truncate & fsync.
osc_extent_wait() doesn't takes into account oe_trunc_pending
during setting oe_urgent. The race arises after
osc_object_unlock().
osc_extent_wait() should ignore extents with oe_trunc_pending
while waiting for OES_INV. osc_cache_truncate_end() will set
oe_urgent and call osc_io_unplug_async()

Change-Id: I6f4c8420faa67bf4b14b1c5c2bc37fa282a7b072
Xyratex-bug-id: LELUS-239
Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-on: http://review.whamcloud.com/10204
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osc/osc_cache.c

index 9352bf1..c5ee26b 100644 (file)
@@ -876,7 +876,8 @@ static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
        LASSERT(sanity_check_nolock(ext) == 0);
        /* `Kick' this extent only if the caller is waiting for it to be
         * written out. */
-       if (state == OES_INV && !ext->oe_urgent && !ext->oe_hp) {
+       if (state == OES_INV && !ext->oe_urgent && !ext->oe_hp &&
+           !ext->oe_trunc_pending) {
                if (ext->oe_state == OES_ACTIVE) {
                        ext->oe_urgent = 1;
                } else if (ext->oe_state == OES_CACHE) {
@@ -929,8 +930,8 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
        ENTRY;
 
        LASSERT(sanity_check(ext) == 0);
-       LASSERT(ext->oe_state == OES_TRUNC);
-       LASSERT(!ext->oe_urgent);
+       EASSERT(ext->oe_state == OES_TRUNC, ext);
+       EASSERT(!ext->oe_urgent, ext);
 
        /* Request new lu_env.
         * We can't use that env from osc_cache_truncate_start() because