All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, sandeen@redhat.com
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 11/11] xfs_repair: don't assert on bad '.' entry in no-modify mode
Date: Fri, 4 May 2018 17:41:06 -0500	[thread overview]
Message-ID: <fff8ec8c-0c23-7a38-b323-233db98cffdd@sandeen.net> (raw)
In-Reply-To: <152401966025.13319.16584599904269469257.stgit@magnolia>

On 4/17/18 9:47 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> During phase 3, we check the '.' entry of a directory inode and (in
> modify mode) zap it if the name isn't valid.  During phase 6, we assert
> that the '.' entry now reflects the correct name.  In no-modify mode
> this is incorrect because we didn't actually fix anything, so repair
> asserts and crashes.
> 
> Found by fuzzing bu[0].namelen = 4 in xfs/387 and running xfs_repair -n.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  repair/phase6.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/repair/phase6.c b/repair/phase6.c
> index 2005e40..e65fc4a 100644
> --- a/repair/phase6.c
> +++ b/repair/phase6.c
> @@ -1884,7 +1884,8 @@ longform_dir2_entry_check_data(
>  		 * of when directory is moved to orphanage.
>  		 */
>  		if (ip->i_ino == inum)  {
> -			ASSERT(dep->name[0] == '.' && dep->namelen == 1);
> +			ASSERT(no_modify ||
> +			       (dep->name[0] == '.' && dep->namelen == 1));
>  			add_inode_ref(current_irec, current_ino_offset);
>  			if (da_bno != 0 ||
>  			    dep != M_DIROPS(mp)->data_entry_p(d)) {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2018-05-04 22:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  2:46 [PATCH 00/11] xfsprogs-4.17: xfs_repair fixes Darrick J. Wong
2018-04-18  2:46 ` [PATCH 01/11] xfs_repair: examine all remote attribute blocks Darrick J. Wong
2018-05-04 18:20   ` Eric Sandeen
2018-05-04 19:23     ` Darrick J. Wong
2018-05-23  3:15   ` [PATCH v2 " Darrick J. Wong
2018-05-23  3:47     ` Allison Henderson
2018-04-18  2:46 ` [PATCH 02/11] xfs_repair: don't leak buffer on xattr remote buf verifier error Darrick J. Wong
2018-05-04 19:16   ` Eric Sandeen
2018-04-18  2:46 ` [PATCH 03/11] xfs_repair: validate some of the log space information Darrick J. Wong
2018-05-04 19:29   ` Eric Sandeen
2018-05-04 20:25     ` Darrick J. Wong
2018-05-04 20:54       ` Eric Sandeen
2018-05-23  3:15   ` [PATCH v2 " Darrick J. Wong
2018-05-23  3:52     ` Allison Henderson
2018-04-18  2:46 ` [PATCH 04/11] xfs_repair: zap corrupt remote symlink Darrick J. Wong
2018-05-04 19:46   ` Eric Sandeen
2018-05-04 20:22     ` Darrick J. Wong
2018-04-18  2:47 ` [PATCH 05/11] xfs_repair: treat zero da btree pointers as corruption Darrick J. Wong
2018-05-04 19:59   ` Eric Sandeen
2018-04-18  2:47 ` [PATCH 06/11] xfs_repair: invalidate dirty dir buffers when we zap a directory Darrick J. Wong
2018-05-04 20:13   ` Eric Sandeen
2018-04-18  2:47 ` [PATCH 07/11] xfs_repair: only update in-core extent state after scanning full extent Darrick J. Wong
2018-05-04 21:52   ` Eric Sandeen
2018-04-18  2:47 ` [PATCH 08/11] xfs_repair: don't crash if da btree is corrupt Darrick J. Wong
2018-05-04 22:00   ` Eric Sandeen
2018-04-18  2:47 ` [PATCH 09/11] xfs_repair: don't assert if we run across a dir entry with null ino ptr Darrick J. Wong
2018-05-04 22:33   ` Eric Sandeen
2018-05-04 22:45     ` Darrick J. Wong
2018-05-08 16:07       ` Darrick J. Wong
2018-05-08 16:31   ` [PATCH v2 09/11] xfs_repair: actually fix .. entries that point to inode zero Darrick J. Wong
2018-04-18  2:47 ` [PATCH 10/11] xfs_repair: check inode nsec for obviously garbage values Darrick J. Wong
2018-05-04 22:38   ` Eric Sandeen
2018-04-18  2:47 ` [PATCH 11/11] xfs_repair: don't assert on bad '.' entry in no-modify mode Darrick J. Wong
2018-05-04 22:41   ` Eric Sandeen [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=fff8ec8c-0c23-7a38-b323-233db98cffdd@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@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 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.