From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
Brian Behlendorf <behlendorf1@llnl.gov>,
Siarhei Volkau <lis8215@gmail.com>
Subject: Re: [PATCH] lib/div64: off by one in shift
Date: Tue, 29 Jan 2019 16:21:06 +0100 [thread overview]
Message-ID: <20190129152105.GA18383@redhat.com> (raw)
In-Reply-To: <20190128094503.19e9f2ae0b286f7b1f743d70@linux-foundation.org>
On Mon, Jan 28, 2019 at 09:45:03AM -0800, Andrew Morton wrote:
> On Mon, 28 Jan 2019 15:49:04 +0100 Stanislaw Gruszka <sgruszka@redhat.com> wrote:
>
> > fls counts bits starting from 1 to 32 (returns 0 for zero argument).
> > If we add 1 we shift right one bit more and loose precision from
> > divisor, what cause function incorect results with some numbers.
> >
> > Corrected code was tested in user-space, see bugzilla:
> > https://bugzilla.kernel.org/show_bug.cgi?id=202391
>
> What are the usersoace-visible runtime effects of this change?
The bug is rather theoretical and for most cases divisor is within
32 bits, so problem is not visible. Moreover the bug is only for
32-bit systems and various users of it like btrfs are unlikely
to be run on such systems. So I do not consider this as very
important fix.
Thanks
Stanislaw
prev parent reply other threads:[~2019-01-29 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 14:49 [PATCH] lib/div64: off by one in shift Stanislaw Gruszka
2019-01-28 17:35 ` Oleg Nesterov
2019-01-28 17:45 ` Andrew Morton
2019-01-29 15:21 ` Stanislaw Gruszka [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=20190129152105.GA18383@redhat.com \
--to=sgruszka@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=behlendorf1@llnl.gov \
--cc=linux-kernel@vger.kernel.org \
--cc=lis8215@gmail.com \
--cc=oleg@redhat.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