public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs@oss.sgi.com
Subject: Re: [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c
Date: Tue, 10 Nov 2015 12:45:27 -0600	[thread overview]
Message-ID: <56423B47.4060306@sandeen.net> (raw)
In-Reply-To: <56423596.3030300@redhat.com>

On 11/10/15 12:21 PM, Eric Sandeen wrote:
> Commit:
> 
> 7141fc xfsprogs: make fsr use mntinfo when there is no mntent
> 
> added an inadvertent "break;" to initallfs() after the call
> to find_mountpoint_check(); this is likely a cut & paste error
> from the call in find_mountpoint(), where we really *do* want to
> stop after the first one we find.
> 
> Fix that by removing the break, and fix the declaration-after-code.
> 
> Addresses-Coverity-Id: 1338431
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Actually, unless Jan's commit fixes something important for this
release (and I don't think it does?) I'd just revert it; it's
pretty chock full of outright errors and other weirdness.

For example:

initallfs(mtab);
   struct stat64 sb;
   mntp = find_mountpoint_check(&sb, mp, &ms);

and find_mounpoint_check() does:

     if (S_ISDIR(sb->st_mode)) {

so "sb" is never initialized on that path.  Weird that Coverity
didn't see it.

(I'm also not a fan of using "sb" and "mp" for things that aren't
superblocks and xfs_mount_t's, but that's just style I guess...)

((and every caller passes an ms stat buffer into the function,
which can be local to the function, as no caller uses it ...))

(((and there's whitespace damage)))

Jan said this patch "fell under the sofa" - I think it might need a
bit more dusting off before it's ready to go... ;)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-11-10 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 18:21 [PATCH] xfsprogs: fix cut & paste error in xfs_fsr.c Eric Sandeen
2015-11-10 18:45 ` Eric Sandeen [this message]
2015-11-10 20:28 ` Dave Chinner
2015-11-10 20:35   ` Eric Sandeen
2015-11-11 13:13     ` Jan Tulak
2015-11-11 15:41       ` Eric Sandeen
2015-11-10 20:45   ` [PATCH] xfsprogs: tidy up xfs_fsr.c Eric Sandeen

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=56423B47.4060306@sandeen.net \
    --to=sandeen@sandeen.net \
    --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