linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kari Argillander <kari.argillander@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/ntfs3: Use kernel ALIGN macros over driver specific
Date: Wed, 25 Aug 2021 21:04:39 +0300	[thread overview]
Message-ID: <20210825180439.ctyxdhykrqtl55rj@kari-VirtualBox> (raw)
In-Reply-To: <20210825043715.GP7722@kadam>

On Wed, Aug 25, 2021 at 07:37:15AM +0300, Dan Carpenter wrote:
> On Tue, Aug 24, 2021 at 09:20:59PM +0300, Kari Argillander wrote:
> > Prefer built in ALIGN macros over special made ones. This can be
> > helpful for some static analyzing tools.
> > 
> 
> The patch is fine but the commit message is not clear that this fixes
> a runtime bug.

Is below better? Will send V2 if this is ok to you.


fs/ntfs3: Use kernel ALIGN macros over driver specific

The static checkers (Smatch) were complaining because QuadAlign() was
buggy.  If you try to align something higher than UINT_MAX it got
truncated to a u32.

Smatch warning was:
	fs/ntfs3/attrib.c:383 attr_set_size_res()
	warn: was expecting a 64 bit value instead of '~7'

So that this will not happen again we will change all these macros to
kernel made ones. This can also help some other static analyzing tools
to give us better warnings.

Patch was generated with Coccinelle script and after that some style
issue was hand fixed.

<insert coccinelle script >

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kari Argillander <kari.argillander@gmail.com>


> 
> The static checkers (Smatch) were complaining because QuadAlign() was
> buggy.  If you try to align something higher than UINT_MAX it got
> truncated to a u32.
> 
> regards,
> dan carpenter

      reply	other threads:[~2021-08-25 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 18:20 [PATCH] fs/ntfs3: Use kernel ALIGN macros over driver specific Kari Argillander
2021-08-25  4:37 ` Dan Carpenter
2021-08-25 18:04   ` Kari Argillander [this message]

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=20210825180439.ctyxdhykrqtl55rj@kari-VirtualBox \
    --to=kari.argillander@gmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).