From: Lachlan McIlroy <lachlan@sgi.com>
To: David Chinner <dgc@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: review: use correct buffer flags when reading superblock
Date: Thu, 11 Oct 2007 17:23:45 +1000 [thread overview]
Message-ID: <470DCF81.10704@sgi.com> (raw)
In-Reply-To: <20071011033038.GW995458@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]
David Chinner wrote:
> On Thu, Oct 11, 2007 at 12:42:25PM +1000, Lachlan McIlroy wrote:
>> David Chinner wrote:
>>> On Wed, Oct 10, 2007 at 06:37:47PM +1000, Lachlan McIlroy wrote:
>>>> When reading the superblock during log recovery we are not setting
>>>> the correct buffer flags. Specifically we are not turning off flags
>>>> we do not need such as XBF_ASYNC that is causing the synchronous
>>>> xfs_iowait() to hang. We should also turn off XBF_WRITE and remove
>>>> the buffer from the delay write queue just to be safe.
>>> We really don't need the removal of the write flags - the XFS_bflush()
>>> call above the xfs_getsb() call guarantees that they won't be set....
>> It's not obvious though. It wasn't obvious that ASYNC was still set
>> and look where that got us.
>
> Sure, but it is incorrect to have them set at that point - incorrect
> enough that it might cause corruption. That is, if they are set
> then the changes made during log replay have not been written to
> disk and we've got bigger problems than a hanging I/O to worry
> about....
>
> So rather than clearing them, we should be asserting that the
> write flags are not set at all.
>
New patch attached.
[-- Attachment #2: xfs_getsb.diff --]
[-- Type: text/x-patch, Size: 455 bytes --]
--- fs/xfs/xfs_log_recover.c_1.329 2007-10-10 15:59:18.000000000 +1000
+++ fs/xfs/xfs_log_recover.c 2007-10-11 15:03:00.000000000 +1000
@@ -3824,7 +3824,10 @@ xlog_do_recover(
*/
bp = xfs_getsb(log->l_mp, 0);
XFS_BUF_UNDONE(bp);
+ ASSERT(!(XFS_BUF_ISWRITE(bp)));
+ ASSERT(!(XFS_BUF_ISDELAYWRITE(bp)));
XFS_BUF_READ(bp);
+ XFS_BUF_UNASYNC(bp);
xfsbdstrat(log->l_mp, bp);
if ((error = xfs_iowait(bp))) {
xfs_ioerror_alert("xlog_do_recover",
prev parent reply other threads:[~2007-10-11 7:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-10 8:37 review: use correct buffer flags when reading superblock Lachlan McIlroy
2007-10-10 9:34 ` Christoph Hellwig
2007-10-10 11:25 ` David Chinner
2007-10-18 15:46 ` Christoph Hellwig
2007-10-19 1:32 ` Lachlan McIlroy
2007-10-19 2:14 ` David Chinner
2007-10-10 11:28 ` David Chinner
2007-10-11 2:42 ` Lachlan McIlroy
2007-10-11 3:30 ` David Chinner
2007-10-11 7:23 ` Lachlan McIlroy [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=470DCF81.10704@sgi.com \
--to=lachlan@sgi.com \
--cc=dgc@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