fix logic bugs in zfs snapshot