Whamcloud - gitweb
LU-16717 mdt: treat unknown hash type as sane type
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_user.h
index 151dbf8..25a3642 100644 (file)
@@ -1106,6 +1106,16 @@ static inline bool lmv_is_known_hash_type(__u32 type)
 
 #define LMV_HASH_FLAG_KNOWN            0xbe000000
 
+/* migration failure may leave hash type as
+ * LMV_HASH_TYPE_UNKNOWN|LMV_HASH_FLAG_BAD_TYPE, which should be treated as
+ * sane, so such directory can be accessed (resume migration or unlink).
+ */
+static inline bool lmv_is_sane_hash_type(__u32 type)
+{
+       return lmv_is_known_hash_type(type) ||
+              type == (LMV_HASH_TYPE_UNKNOWN | LMV_HASH_FLAG_BAD_TYPE);
+}
+
 /* both SPLIT and MIGRATION are set for directory split */
 static inline bool lmv_hash_is_splitting(__u32 hash)
 {