Peculiar effect of sample size in layered superconductors