From: Christoph Hellwig <hch@infradead.org>
To: Lachlan McIlroy <lachlan@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] prevent panic during log recovery due to bogus operation header length
Date: Fri, 14 Dec 2007 20:30:41 +0000 [thread overview]
Message-ID: <20071214203041.GB23564@infradead.org> (raw)
In-Reply-To: <475F88C3.709@sgi.com>
On Wed, Dec 12, 2007 at 06:07:47PM +1100, Lachlan McIlroy wrote:
> A problem was reported where a system panicked in log recovery due
> to a corrupt log record. The cause of the corruption is not known
> but this change will at least prevent a crash for this specific
> scenario. Log recovery definitely needs some more work in this area.
>
> Lachlan
> --- fs/xfs/xfs_log_recover.c_1.332 2007-12-12 17:14:57.000000000 +1100
> +++ fs/xfs/xfs_log_recover.c 2007-12-12 17:15:42.000000000 +1100
> @@ -2912,7 +2912,12 @@ xlog_recover_process_data(
> xlog_recover_new_tid(&rhash[hash], tid,
> be64_to_cpu(rhead->h_lsn));
> } else {
> - ASSERT(dp + be32_to_cpu(ohead->oh_len) <= lp);
> + if (dp + be32_to_cpu(ohead->oh_len) > lp) {
> + xlog_warn(
> + "XFS: xlog_recover_process_data: bad length");
> + ASSERT(0);
> + return (XFS_ERROR(EIO));
> + }
this still gives a panic for debug builds.. Maybe this should become
a WARN_ON(1) instead?
prev parent reply other threads:[~2007-12-14 20:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 7:07 [PATCH] prevent panic during log recovery due to bogus operation header length Lachlan McIlroy
2007-12-14 20:30 ` Christoph Hellwig [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=20071214203041.GB23564@infradead.org \
--to=hch@infradead.org \
--cc=lachlan@sgi.com \
--cc=xfs-dev@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox