diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-19 10:08:10 +1000 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 12:57:35 +0400 |
commit | 642b704cd7a29be0b8900971eb525086c1c995b7 (patch) | |
tree | 616b89d759f128c01e967ed64fd7c7da1b763dcf /fs/minix | |
parent | 18c67cb9f0d2ac1e5660899c852f657ba84ddd2e (diff) | |
download | linux-642b704cd7a29be0b8900971eb525086c1c995b7.tar.gz linux-642b704cd7a29be0b8900971eb525086c1c995b7.tar.bz2 linux-642b704cd7a29be0b8900971eb525086c1c995b7.zip |
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>
Diffstat (limited to 'fs/minix')
-rw-r--r-- | fs/minix/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |