Putting your shares on zfs and performing periodic snapshots makes you pretty much immune to ransomware attacks. Once the infection is detected and the offending machine isolated, simply reverting to a snapshot from just before the event and you are back in business.