From: Dave Chinner <david@fromorbit.com>
To: Jan Tulak <jtulak@redhat.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: xfsprogs: useless code blocks
Date: Tue, 21 Jul 2015 16:37:38 +1000 [thread overview]
Message-ID: <20150721063738.GA7943@dastard> (raw)
In-Reply-To: <1213913978.543970.1437400666553.JavaMail.zimbra@redhat.com>
On Mon, Jul 20, 2015 at 09:57:46AM -0400, Jan Tulak wrote:
> Hi all,
>
> I found these useless bits of code in xfsprogs:
>
> repair/incore_ino.c:575-576:
> if (ino_rec->ino_startnum == 0)
> ino_rec = ino_rec;
>
> This one is pretty clear. It is there since 2001 (commit 2bd0ea187
> by nathans@sgi.com, who didn't wrote here since 2006, so I find
nathans@redhat.com will get you that same person ;)
> CC-ing him useless). It looks like a forgotten code which doesn't
> do anything, but I ask in case it is a hidden bug.
Who knows? It came from the Irix code base by the look of it, so
maybe it was just working around a compiler bug?
> And:
>
> db/check.c:3035, 3037: Always true expression, as be32_to_cpu()
> translates to __u32 type and unsigned can't be less than zero.
>
> be32_to_cpu(free->hdr.nvalid) < 0 ||
The old endian conversion stuff in userspace needed that. When we
converted it to the same as the kernel macros, we didn't change any
of the logic. gcc isn't warning about this on x86-64, so in general
signed/unsigned stuff goes unnoticed.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-07-21 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2035333009.511763.1437398166766.JavaMail.zimbra@redhat.com>
2015-07-20 13:57 ` xfsprogs: useless code blocks Jan Tulak
2015-07-21 6:37 ` Dave Chinner [this message]
2015-07-21 9:18 ` Jan Tulak
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=20150721063738.GA7943@dastard \
--to=david@fromorbit.com \
--cc=jtulak@redhat.com \
--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