From 642b704cd7a29be0b8900971eb525086c1c995b7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 19 Jun 2013 10:08:10 +1000 Subject: 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 --- fs/minix/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/minix/dir.c b/fs/minix/dir.c index 08c442902fc..dfaf6fa9b7b 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; -- cgit v1.2.3-18-g5258