Commit 642b704cd7a29be0b8900971eb525086c1c995b7

Authored by Dan Carpenter
Committed by Al Viro
1 parent 18c67cb9f0

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 <dan.carpenter@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -93,7 +93,7 @@
93 93 unsigned offset;
94 94 unsigned long n;
95 95  
96   - ctx->pos = pos = (pos + chunk_size-1) & ~(chunk_size-1);
  96 + ctx->pos = pos = ALIGN(pos, chunk_size);
97 97 if (pos >= inode->i_size)
98 98 return 0;
99 99