From 58d4bbd286d862c65d631860b116e97c688f0720 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 19 Jun 2013 10:08:10 +1000 Subject: [PATCH] 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(-) diff --git a/fs/minix/dir.c b/fs/minix/dir.c index a9ed6f36e6ea..09b0c96979ec 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c @@ -95,7 +95,7 @@ static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) char *name; __u32 inumber; - pos = (pos + chunk_size-1) & ~(chunk_size-1); + pos = ALIGN(pos, chunk_size); if (pos >= inode->i_size) goto done; -- 2.39.5