- return (inode->i_num_ads > 0 &&
- inode->i_num_ads < 0xffff && /* overflow check */
- inode->i_canonical_streams); /* assume the dentry is okay if it
- already had an unnamed ADS entry
- when it was read in */
+ /* Normal case */
+ if (likely(inode->i_num_ads <= 0))
+ return false;
+
+ /* Overflow check */
+ if (inode->i_num_ads >= 0xFFFF)
+ return false;
+
+ /* Assume the dentry is okay if it already had an unnamed ADS entry when
+ * it was read in. */
+ if (!inode->i_canonical_streams)
+ return false;
+
+ /* We can't use use this workaround on encrypted files because WIMGAPI
+ * reports that the WIM is in an incorrect format. */
+ if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)
+ return false;
+
+ return true;