masking a 64-bit value with a 32-bit mask that's zero-extended will turn off many more bits than intended. make the mask the right length to keep all the high-order 1s. Reference: /n/sources/patch/applied/aquarela-mask Date: Thu Feb 28 18:55:35 CET 2013 Signed-off-by: charles.forsyth@gmail.com --- /sys/src/cmd/aquarela/smbcommon.c Thu Feb 28 18:54:45 2013 +++ /sys/src/cmd/aquarela/smbcommon.c Thu Feb 28 18:54:41 2013 @@ -290,7 +290,7 @@ vlong smbl2roundupvlong(vlong v, int l2) { - ulong mask; + uvlong mask; mask = (1 << l2) - 1; return (v + mask) & ~mask; }