All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] xfs: don't ASSERT on corrupt ftype
Date: Mon, 08 Sep 2014 17:18:07 -0500	[thread overview]
Message-ID: <540E2B1F.9070009@sandeen.net> (raw)
In-Reply-To: <540D011B.2000807@redhat.com>

xfs_dir3_data_get_ftype() gets the file type off
disk, but ASSERTs if it's invalid:

     ASSERT(type < XFS_DIR3_FT_MAX);

We shouldn't ASSERT on bad values read from disk.
V3 dirs are CRC-protected, but V2 dirs + ftype
are not.

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

diff --git a/fs/xfs/libxfs/xfs_da_format.c b/fs/xfs/libxfs/xfs_da_format.c
index c9aee52..7e42fdf 100644
--- a/fs/xfs/libxfs/xfs_da_format.c
+++ b/fs/xfs/libxfs/xfs_da_format.c
@@ -270,7 +270,6 @@ xfs_dir3_data_get_ftype(
  {
      __uint8_t    ftype = dep->name[dep->namelen];
  
-    ASSERT(ftype < XFS_DIR3_FT_MAX);
      if (ftype >= XFS_DIR3_FT_MAX)
          return XFS_DIR3_FT_UNKNOWN;
      return ftype;

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

      parent reply	other threads:[~2014-09-08 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08  1:06 [PATCH] xfs: don't ASSERT on corrupt ftype Eric Sandeen
2014-09-08 12:03 ` Brian Foster
2014-09-08 13:05 ` Dave Chinner
2014-09-08 13:49   ` Eric Sandeen
2014-09-08 14:02     ` Eric Sandeen
2014-09-08 22:00       ` Dave Chinner
2014-09-08 22:18 ` 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=540E2B1F.9070009@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=sandeen@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 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.