FSDirectory#getFileEncryptionInfo always acquires readLock and checks if the path belongs to an EZ. For a busy system with potentially many listing operations, this could cause locking contention.
I think we should add a call EncryptionZoneManager#hasEncryptionZone() to return whether the system has any EZ. If no EZ at all, getFileEncryptionInfo should return null without readLock.
If hasEncryptionZone is only used in the above scenario, maybe itself doesn't need a readLock – if the system doesn't have any EZ when getFileEncryptionInfo is called on a path, it means the path cannot be encrypted.