All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 2/4] xfs_repair: remove impossible tests in process_sf_dir2
Date: Fri, 13 Mar 2015 10:34:24 -0400	[thread overview]
Message-ID: <20150313143424.GE2678@laptop.bfoster> (raw)
In-Reply-To: <54FF5BA6.4000508@sandeen.net>

On Tue, Mar 10, 2015 at 05:01:26PM -0400, Eric Sandeen wrote:
> We're testing for an impossible case in here:
> 
>                 if (i == num_entries - 1)  {
> ...
>                 } else  {
> ...
>                                 if (i == num_entries - 1)
>                                     /* can't happen! */
> ...
>                 }
> 
> So, remove the impossible case.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/repair/dir2.c b/repair/dir2.c
> index 25793e9..7aede6a 100644
> --- a/repair/dir2.c
> +++ b/repair/dir2.c
> @@ -928,26 +928,12 @@ _("size of last entry overflows space left in in shortform dir %" PRIu64 ", "),
>  				do_warn(
>  _("size of entry #%d overflows space left in in shortform dir %" PRIu64 "\n"),
>  					i, ino);
> -				if (!no_modify)  {
> -					if (i == num_entries - 1)
> -						do_warn(
> -						_("junking entry #%d\n"),
> -							i);
> -					else
> -						do_warn(
> -						_("junking %d entries\n"),
> -							num_entries - i);
> -				} else  {
> -					if (i == num_entries - 1)
> -						do_warn(
> -						_("would junk entry #%d\n"),
> -							i);
> -					else
> -						do_warn(
> -						_("would junk %d entries\n"),
> -							num_entries - i);
> -				}
> -
> +				if (!no_modify)
> +					do_warn(_("junking %d entries\n"),
> +						num_entries - i);
> +				else
> +					do_warn(_("would junk %d entries\n"),
> +						num_entries - i);
>  				break;
>  			}
>  		}
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2015-03-13 14:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 20:53 [PATCH 0/4] xfs_repair: clean up process_sf_dir2 Eric Sandeen
2015-03-10 20:55 ` [PATCH 1/4] xfs_repair: dirty inode in process_sf_dir2 if we change namelen Eric Sandeen
2015-03-13 14:34   ` Brian Foster
2015-03-10 21:01 ` [PATCH 2/4] xfs_repair: remove impossible tests in process_sf_dir2 Eric Sandeen
2015-03-13 14:34   ` Brian Foster [this message]
2015-03-10 21:04 ` [PATCH 3/4] xfs_repair: collapse 2 cases " Eric Sandeen
2015-03-13 14:35   ` Brian Foster
2015-03-10 21:11 ` [PATCH 4/4] xfs_repair: remove last-entry hack " Eric Sandeen
2015-03-13 14:41   ` Brian Foster

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=20150313143424.GE2678@laptop.bfoster \
    --to=bfoster@redhat.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.