Whamcloud - gitweb
LU-6406 tests: fix undersized fsname and FID strings
[fs/lustre-release.git] / lustre / lod / lod_object.c
index 7e84a61..a87c4e8 100644 (file)
@@ -853,7 +853,8 @@ int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo,
                                goto next;
                }
 
-               len = snprintf(name, FID_LEN + 1, DFID":", PFID(&ent->lde_fid));
+               len = snprintf(name, sizeof(name),
+                              DFID":", PFID(&ent->lde_fid));
                /* The ent->lde_name is composed of ${FID}:${index} */
                if (ent->lde_namelen < len + 1 ||
                    memcmp(ent->lde_name, name, len) != 0) {
@@ -1176,7 +1177,8 @@ static int lod_declare_attr_set(const struct lu_env *env,
                        RETURN(0);
        } else {
                if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE |
-                                       LA_ATIME | LA_MTIME | LA_CTIME)))
+                                       LA_ATIME | LA_MTIME | LA_CTIME |
+                                       LA_FLAGS)))
                        RETURN(rc);
        }
        /*
@@ -1267,7 +1269,8 @@ static int lod_attr_set(const struct lu_env *env,
                        RETURN(0);
        } else {
                if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE |
-                                       LA_ATIME | LA_MTIME | LA_CTIME)))
+                                       LA_ATIME | LA_MTIME | LA_CTIME |
+                                       LA_FLAGS)))
                        RETURN(rc);
        }
 
@@ -1813,7 +1816,7 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
                if (i == 0) {
                        /* Right now, master stripe and master object are
                         * on the same MDT */
-                       idx = le32_to_cpu(lum->lum_stripe_offset);
+                       idx = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_node_id;
                        rc = obd_fid_alloc(env, lod->lod_child_exp, &fid,
                                           NULL);
                        if (rc < 0)