public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] minix: bug widening a binary "not" operation
Date: Wed, 29 May 2013 15:28:26 -0700	[thread overview]
Message-ID: <20130529152826.043e95791122bbd39fc9d005@linux-foundation.org> (raw)
In-Reply-To: <20130516075148.GA7494@elgon.mountain>

On Thu, 16 May 2013 10:51:49 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote:

> "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.
> 
> ...
>
> @@ -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;
>  

I'm suspecting there aren't many minix filesystems out there with a >4G
directory ;)

But we should fix it to set a good example, and to quieten
whatever-tool-i-suspect-you-were-using(?).

  reply	other threads:[~2013-05-29 22:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  7:51 [patch] minix: bug widening a binary "not" operation Dan Carpenter
2013-05-29 22:28 ` Andrew Morton [this message]
2013-05-30  6:52   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130529152826.043e95791122bbd39fc9d005@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox