All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs: don't ASSERT on corrupt ftype
Date: Tue, 9 Sep 2014 08:00:36 +1000	[thread overview]
Message-ID: <20140908220036.GO30012@dastard> (raw)
In-Reply-To: <540DB6F3.7090407@sandeen.net>

On Mon, Sep 08, 2014 at 09:02:27AM -0500, Eric Sandeen wrote:
> On 9/8/14 8:49 AM, Eric Sandeen wrote:
> >On 9/8/14 8:05 AM, Dave Chinner wrote:
> >>On Sun, Sep 07, 2014 at 08:06:35PM -0500, Eric Sandeen wrote:
> >>>xfs_dir3_data_get_ftype() and xfs_dir2_sf_check() get
> >>>the file type off disk, but ASSERT if it's invalid:
> >>>
> >>>    ASSERT(type < XFS_DIR3_FT_MAX);
> >>>
> >>>This might be cut & paste from the "put" functions,
> >>>which should be checking that they've not been passed
> >>>bad values, but we shouldn't ASSERT on bad values
> >>>read from disk.
> >>
> >>No, they weren't cut-n-paste from the put functions. They were
> >>actually designed for a metadata block where bad values would not be
> >>written to disk, and corrupted disk blocks would be detected by CRC
> >>validation failures. So on debug kernels it's quite appropriate to
> >>assert fail on a "should never, ever happen" condition.
> >
> >hohum, ok.
> 
> So then presumably the reason there is no ASSERT in xfs_dir3_sfe_get_ftype
> (vs in xfs_dir3_data_get_ftype) is also purely intentional and
> part of the design, but I'm unable to divine that logic... can you
> help me out?

Because that ASSERT check was put in xfs_dir2_sf_check(). Yeah, I
know, not consistent, but the shortform code is quite different to
the block/leaf/node code....

> I guess the only way forward is to create a 3rd set of ops, and have
> one for dir2, one for dir2-with-ftype, and one for dir3?  Because
> in the op, there's no way to discern between the latter 2, and
> know if we're previously CRC-protected or not...

No, just kill the asset in xfs_dir3_data_get_ftype().

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2014-09-08 22:01 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 [this message]
2014-09-08 22:18 ` [PATCH V2] " 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=20140908220036.GO30012@dastard \
    --to=david@fromorbit.com \
    --cc=sandeen@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.