Whamcloud - gitweb
LU-8147 osd-zfs: fix osd_mount error path
[fs/lustre-release.git] / lustre / osd-zfs / osd_oi.c
index 2333685..0802bf4 100644 (file)
@@ -128,10 +128,9 @@ osd_oi_lookup(const struct lu_env *env, struct osd_device *o,
        if (rc >= sizeof(oi->oi_name))
                return -E2BIG;
 
-       rc = 0;
        oi->oi_zapid = zde->zde_dnode;
 
-       return rc;
+       return 0;
 }
 
 /**
@@ -467,7 +466,7 @@ int osd_fid_lookup(const struct lu_env *env, struct osd_device *dev,
        int                     rc = 0;
        ENTRY;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT))
+       if (OBD_FAIL_CHECK(OBD_FAIL_SRV_ENOENT))
                RETURN(-ENOENT);
 
        if (unlikely(fid_is_acct(fid))) {
@@ -505,6 +504,8 @@ osd_oi_remove_table(const struct lu_env *env, struct osd_device *o, int key)
 
        oi = o->od_oi_table[key];
        if (oi) {
+               if (oi->oi_db)
+                       sa_buf_rele(oi->oi_db, osd_obj_tag);
                OBD_FREE_PTR(oi);
                o->od_oi_table[key] = NULL;
        }
@@ -534,6 +535,7 @@ osd_oi_add_table(const struct lu_env *env, struct osd_device *o,
        }
 
        o->od_oi_table[key] = oi;
+       __osd_obj2dbuf(env, o->od_os, oi->oi_zapid, &oi->oi_db);
 
        return 0;
 }
@@ -617,15 +619,6 @@ osd_oi_probe(const struct lu_env *env, struct osd_device *o, int *count)
        RETURN(0);
 }
 
-static void osd_ost_seq_init(const struct lu_env *env, struct osd_device *osd)
-{
-       struct osd_seq_list *osl = &osd->od_seq_list;
-
-       INIT_LIST_HEAD(&osl->osl_seq_list);
-       rwlock_init(&osl->osl_seq_list_lock);
-       sema_init(&osl->osl_seq_init_sem, 1);
-}
-
 static void osd_ost_seq_fini(const struct lu_env *env, struct osd_device *osd)
 {
        struct osd_seq_list     *osl = &osd->od_seq_list;
@@ -660,7 +653,6 @@ osd_oi_init_compat(const struct lu_env *env, struct osd_device *o)
 
        o->od_O_id = sdb;
 
-       osd_ost_seq_init(env, o);
        /* Create on-disk indexes to maintain per-UID/GID inode usage.
         * Those new indexes are created in the top-level ZAP outside the
         * namespace in order not to confuse ZPL which might interpret those