From: Xie XiuQi <xiexiuqi@huawei.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix signed integer overflow
Date: Tue, 13 Sep 2016 15:23:39 +0800 [thread overview]
Message-ID: <57D7A97B.4080901@huawei.com> (raw)
In-Reply-To: <20160913065738.GF30497@dastard>
On 2016/9/13 14:57, Dave Chinner wrote:
> On Fri, Sep 09, 2016 at 03:16:48PM +0800, Xie XiuQi wrote:
>> On 2016/9/9 14:42, Joe Perches wrote:
>>> On Fri, 2016-09-09 at 14:38 +0800, Xie XiuQi wrote:
>>>> Use 1U for unsigned long, or we'll meet a overflow issue with UBSAN.
>>> trivia: misleading commit message
>>>
>>> 1U is for unsigned int not unsigned long int
>>>
>> Sorry, my fault. Thank you for your comments.
>>
>> From 9cb8e36406a54ce0eaade31dd28f6068f03de1d2 Mon Sep 17 00:00:00 2001
>> From: Xie XiuQi <xiexiuqi@huawei.com>
>> Date: Tue, 6 Sep 2016 11:15:34 +0800
>> Subject: [PATCH v2] xfs: fix signed integer overflow
> ....
>> ---
>> fs/xfs/xfs_buf_item.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
>> index e455f90..3a27997 100644
>> --- a/fs/xfs/xfs_buf_item.c
>> +++ b/fs/xfs/xfs_buf_item.c
>> @@ -865,7 +865,7 @@ xfs_buf_item_log_segment(
>> */
>> if (bit) {
>> end_bit = MIN(bit + bits_to_set, (uint)NBWORD);
>> - mask = ((1 << (end_bit - bit)) - 1) << bit;
>> + mask = ((1U << (end_bit - bit)) - 1) << bit;
>> *wordp |= mask;
>> wordp++;
>> bits_set = end_bit - bit;
> This patch is whitespace damaged and fails to apply. I've fixed it
> up as this is a trivial change. However, please fix the problem
> before you submit more patches.
I will, thank you very mush.
>
> Cheers,
>
> Dave.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2016-09-13 7:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-09 6:38 [PATCH] xfs: fix signed integer overflow Xie XiuQi
2016-09-09 6:42 ` Joe Perches
2016-09-09 7:16 ` Xie XiuQi
2016-09-13 6:57 ` Dave Chinner
2016-09-13 7:23 ` Xie XiuQi [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=57D7A97B.4080901@huawei.com \
--to=xiexiuqi@huawei.com \
--cc=david@fromorbit.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/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).