diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series deleted file mode 120000 index 8241b1c..0000000 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series +++ /dev/null @@ -1 +0,0 @@ -ldiskfs-3.0-sles11sp3.series \ No newline at end of file diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series new file mode 100644 index 0000000..8241b1c --- /dev/null +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series @@ -0,0 +1 @@ +ldiskfs-3.0-sles11sp3.series \ No newline at end of file diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h index 3647791..7d563da 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h @@ -242,7 +242,9 @@ struct lod_object { ldo_def_striping_set:1, /* ldo_dir_slave_stripe indicate this is a slave stripe of * a striped dir */ - ldo_dir_slave_stripe:1; + ldo_dir_slave_stripe:1, + /* ldo_nonstripe indicate this is a non-stripe file/directory */ + ldo_nonstripe:1; __u32 ldo_def_stripe_size; __u16 ldo_def_stripenr; __u16 ldo_def_stripe_offset; diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 5ae4a43..bccc906 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -845,14 +845,18 @@ int lod_load_striping(const struct lu_env *env, struct lod_object *lo) GOTO(out, rc = 0); /* Do not load stripe for slaves of striped dir */ - if (!dt_object_exists(next) || lo->ldo_dir_slave_stripe) + if (!dt_object_exists(next) || lo->ldo_dir_slave_stripe || + lo->ldo_nonstripe) GOTO(out, rc = 0); /* only regular files can be striped */ if (lu_object_attr(lod2lu_obj(lo)) & S_IFREG) { rc = lod_get_lov_ea(env, lo); - if (rc <= 0) + if (rc <= 0) { + if (rc == 0) + lo->ldo_nonstripe = 1; GOTO(out, rc); + } /* * there is LOV EA (striping information) in this object * let's parse it and create in-core objects for the stripes @@ -862,8 +866,15 @@ int lod_load_striping(const struct lu_env *env, struct lod_object *lo) rc = lod_parse_striping(env, lo, &info->lti_buf); } else if (lu_object_attr(lod2lu_obj(lo)) & S_IFDIR) { rc = lod_get_lmv_ea(env, lo); - if (rc <= 0) + if (rc <= 0) { + /* Let's set nonstripe to avoid further + * stripe loading for non-stripe directory, + * which can hurt performance. (See LU-9840) + */ + if (rc == 0) + lo->ldo_nonstripe = 1; GOTO(out, rc); + } /* * there is LOV EA (striping information) in this object * let's parse it and create in-core objects for the stripes diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 3f2a5e5..665ae8a 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -717,6 +717,7 @@ static int lod_prep_md_striped_create(const struct lu_env *env, idx_array[i] = idx; } + lo->ldo_nonstripe = 0; lo->ldo_dir_striped = 1; lo->ldo_stripe = stripe; lo->ldo_stripenr = i - 1; @@ -904,6 +905,8 @@ static int lod_declare_xattr_set(const struct lu_env *env, rc = lod_declare_striped_object(env, dt, attr, buf, th); if (rc) RETURN(rc); + /* Reset the non-stripe flags */ + lod_dt_obj(dt)->ldo_nonstripe = 0; } else { rc = dt_declare_xattr_set(env, next, buf, name, fl, th); } @@ -997,6 +1000,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt, if (rc != 0) RETURN(rc); + LASSERT(lo->ldo_nonstripe == 0); for (i = 0; i < lo->ldo_stripenr; i++) { struct dt_object *dto; struct lu_attr *attr = &lod_env_info(env)->lti_attr;