Whamcloud - gitweb
LU-6977 lod: do_index_try should be called first 72/15972/3
authorwang di <di.wang@intel.com>
Tue, 11 Aug 2015 11:19:43 +0000 (04:19 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 24 Aug 2015 14:12:28 +0000 (14:12 +0000)
In lod_striped_it_next do_index_try should be called first
to initialize do_index_ops, then checking do_index_ops.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I477fb3c9ccd65c4e7721d78a3746f64acf8733ce
Reviewed-on: http://review.whamcloud.com/15972
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_object.c

index 255b8c8..ff13bda 100644 (file)
@@ -571,12 +571,12 @@ again:
 
        next = lo->ldo_stripe[it->lit_stripe_index];
        LASSERT(next != NULL);
 
        next = lo->ldo_stripe[it->lit_stripe_index];
        LASSERT(next != NULL);
-       LASSERT(next->do_index_ops != NULL);
-
        rc = next->do_ops->do_index_try(env, next, &dt_directory_features);
        if (rc != 0)
                RETURN(rc);
 
        rc = next->do_ops->do_index_try(env, next, &dt_directory_features);
        if (rc != 0)
                RETURN(rc);
 
+       LASSERT(next->do_index_ops != NULL);
+
        it_next = next->do_index_ops->dio_it.init(env, next, it->lit_attr);
        if (!IS_ERR(it_next)) {
                it->lit_it = it_next;
        it_next = next->do_index_ops->dio_it.init(env, next, it->lit_attr);
        if (!IS_ERR(it_next)) {
                it->lit_it = it_next;