Whamcloud - gitweb
LU-13511 obdclass: don't initialize obj for zero FID
[fs/lustre-release.git] / lustre / obdclass / lu_object.c
index dce91d5..e174dfa 100644 (file)
@@ -815,6 +815,13 @@ struct lu_object *lu_object_find_at(const struct lu_env *env,
 
        ENTRY;
 
+       /* FID is from disk or network, zero FID is meaningless, return error
+        * early to avoid assertion in lu_object_put. If a zero FID is wanted,
+        * it should be allocated via lu_object_anon().
+        */
+       if (fid_is_zero(f))
+               RETURN(ERR_PTR(-EINVAL));
+
        /*
         * This uses standard index maintenance protocol:
         *