From: alex Date: Tue, 24 Feb 2009 21:43:46 +0000 (+0000) Subject: - ofd doesn't panic if fsfilt isn't found X-Git-Tag: GIT_EPOCH_B_HD_KDMU~2^4~163 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=630742871f6e660f9c252520d960a57e6c4f9783;p=fs%2Flustre-release.git - ofd doesn't panic if fsfilt isn't found - dmu's create object declaration needs dof (object type) --- diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index a4ce304..e2b8471 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -589,7 +589,9 @@ static int filter_init0(const struct lu_env *env, struct filter_device *m, lmi = server_get_mount(dev); obd->obd_fsops = fsfilt_get_ops(MT_STR(s2lsi(lmi->lmi_sb)->lsi_ldd)); - LASSERT(obd->obd_fsops != NULL); + if (obd->obd_fsops == NULL) + CERROR("this filesystem (%s) doesn't support fsfilt\n", + MT_STR(s2lsi(lmi->lmi_sb)->lsi_ldd)); spin_lock_init(&m->ofd_transno_lock); spin_lock_init(&m->ofd_client_bitmap_lock); diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index d737425..cbfa05d 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -64,6 +64,8 @@ struct filter_object *filter_object_find_or_create(const struct lu_env *env, if (filter_object_exists(fo)) RETURN(fo); + dof.dof_type = dt_mode_to_dft(S_IFREG); + next = filter_object_child(fo); LASSERT(next != NULL); @@ -71,7 +73,7 @@ struct filter_object *filter_object_find_or_create(const struct lu_env *env, if (IS_ERR(th)) GOTO(out, rc = PTR_ERR(th)); - rc = dt_declare_create(env, next, attr, NULL, NULL, th); + rc = dt_declare_create(env, next, attr, NULL, &dof, th); LASSERT(rc == 0); rc = filter_trans_start(env, ofd, th); @@ -85,7 +87,6 @@ struct filter_object *filter_object_find_or_create(const struct lu_env *env, CDEBUG(D_OTHER, "create new object %lu:%llu\n", (unsigned long) fid->f_oid, fid->f_seq); - dof.dof_type = dt_mode_to_dft(S_IFREG); rc = dt_create(env, next, attr, NULL, &dof, th); LASSERT(rc == 0); LASSERT(filter_object_exists(fo));