From: bugzilla-daemon@bugzilla.kernel.org
To: linux-xfs@vger.kernel.org
Subject: [Bug 201453] Bug 1640090 - [xfstests xfs/490]: xfs_db print a bad (negative number) as agi freecount
Date: Wed, 24 Oct 2018 20:10:39 +0000 [thread overview]
Message-ID: <bug-201453-201763-bguEGVYkfx@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-201453-201763@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=201453
--- Comment #5 from Eric Sandeen (sandeen@sandeen.net) ---
So zorro correctly points out that the big vs little endian certainly should
not matter for this u8.
What does matter is the signed type, because getbitval is doing tricks to try
to handle sign extension and it does it differently for big vs. little endian:
if (getbit_l(p, bit + i)) {
/* If the last bit is on and we care about sign
* bits and we don't have a full 64 bit
* container, turn all bits on between the
* sign bit and the most sig bit.
*/
/* handle endian swap here */
#if __BYTE_ORDER == LITTLE_ENDIAN
if (i == 0 && signext && nbits < 64)
rval = (~0ULL) << nbits;
rval |= 1ULL << (nbits - i - 1);
#else
if ((i == (nbits - 1)) && signext && nbits < 64)
rval |= ((~0ULL) << nbits);
rval |= 1ULL << (nbits - i - 1);
#endif
Switching it to FLDT_UINT8D makes "signext" false so none of this happens, but
that's papering over the underlying bug with signed types.
The bug seems to be the test for if ((i == (nbits - 1)) ...) - this is testing
the last / rightmost bit in the number, which is /not/ the MSB.
But I cannot seem to wrap my head around the right way to fix it, yet.
--
You are receiving this mail because:
You are watching the assignee of the bug.
prev parent reply other threads:[~2018-10-25 4:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 11:20 [Bug 201453] New: Bug 1640090 - [xfstests xfs/490]: xfs_db print a bad (negative number) as agi freecount bugzilla-daemon
2018-10-17 17:49 ` [Bug 201453] " bugzilla-daemon
2018-10-18 1:41 ` [Bug 201453] New: " Dave Chinner
2018-10-18 1:41 ` [Bug 201453] " bugzilla-daemon
2018-10-18 1:50 ` bugzilla-daemon
2018-10-18 6:25 ` bugzilla-daemon
2018-10-24 20:10 ` bugzilla-daemon [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=bug-201453-201763-bguEGVYkfx@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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).