X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fofd%2Fofd_objects.c;h=245b5d89cec3eed3064106984b29d2be1d4e37dc;hp=b6fcd4a81c6cab08826bf484e98d246c9129b816;hb=51e076360d6d1cbc6a128324bdc18aa833a66614;hpb=b65efe20dc07f925e06d58658cd24247ae36037c diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index b6fcd4a..245b5d8 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -305,7 +305,10 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, rc = dt_declare_create(env, next, &info->fti_attr, NULL, &info->fti_dof, th); - if (rc) { + if (rc < 0) { + if (i == 0) + GOTO(trans_stop, rc); + nr = i; break; } @@ -318,8 +321,6 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, CDEBUG(D_OTHER, "%s: create new object "DFID" nr %d\n", ofd_name(ofd), PFID(fid), nr); - LASSERT(nr > 0); - /* When the LFSCK scanning the whole device to verify the LAST_ID file * consistency, it will load the last_id into RAM firstly, and compare * the last_id with each OST-object's ID. If the later one is larger, @@ -362,8 +363,13 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, rc = dt_create(env, next, &info->fti_attr, NULL, &info->fti_dof, th); - if (rc) + if (rc < 0) { + if (i == 0) + GOTO(trans_stop, rc); + + rc = 0; break; + } LASSERT(ofd_object_exists(fo)); } ofd_seq_last_oid_set(oseq, id + i);