From: Dan Carpenter Date: Wed, 19 Jun 2013 00:08:10 +0000 (+1000) Subject: minix: bug widening a binary "not" operation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=642b704cd7a29be0b8900971eb525086c1c995b7;p=linux-beck.git minix: bug widening a binary "not" operation "chunk_size" is an unsigned int and "pos" is an unsigned long. The "& ~(chunk_size-1)" operation clears the high 32 bits unintentionally. The ALIGN() macro does the correct thing. Signed-off-by: Dan Carpenter Cc: Al Viro Signed-off-by: Andrew Morton --- diff --git a/fs/minix/dir.c b/fs/minix/dir.c index 08c442902fcd..dfaf6fa9b7b5 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c @@ -93,7 +93,7 @@ static int minix_readdir(struct file *file, struct dir_context *ctx) unsigned offset; unsigned long n; - ctx->pos = pos = (pos + chunk_size-1) & ~(chunk_size-1); + ctx->pos = pos = ALIGN(pos, chunk_size); if (pos >= inode->i_size) return 0;