- /*Make sure the dentry really fits into the metadata resource.*/
- if (offset + sizeof(u64) < offset ||
- offset + sizeof(u64) > metadata_resource_len)
+ /* Before reading the whole dentry, we need to read just the length.
+ * This is because a dentry of length 8 (that is, just the length field)
+ * terminates the list of sibling directory entries. */
+ if (offset + sizeof(u64) > metadata_resource_len ||
+ offset + sizeof(u64) < offset)