Whamcloud - gitweb
- ofd doesn't panic if fsfilt isn't found
authoralex <alex>
Tue, 24 Feb 2009 21:43:46 +0000 (21:43 +0000)
committeralex <alex>
Tue, 24 Feb 2009 21:43:46 +0000 (21:43 +0000)
 - dmu's create object declaration needs dof (object type)

lustre/ofd/ofd_dev.c
lustre/ofd/ofd_objects.c

index a4ce304..e2b8471 100644 (file)
@@ -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);
index d737425..cbfa05d 100644 (file)
@@ -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));