From: Nickolai Zeldovich Date: Sat, 5 Jan 2013 19:19:21 +0000 (-0500) Subject: jfs: avoid undefined behavior from left-shifting by 32 bits X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~49^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d48017bce890b19e3bba649850bdbc8a6f95903;p=pandora-kernel.git jfs: avoid undefined behavior from left-shifting by 32 bits Shifting a 32-bit int by 32 bits is undefined behavior in C, and results in different behavior on different architectures (e.g., x86 and PowerPC). diAlloc() in fs/jfs/jfs_imap.c computes a mask using 0xffffffffu<<(32-bitno), which can left-shift by 32 bits. To avoid unexpected behavior, explicitly check for bitno==0 and use a 0 mask. Signed-off-by: Nickolai Zeldovich Signed-off-by: Dave Kleikamp --- Reading git-diff-tree failed