public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Leah Rumancik <leah.rumancik@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org, djwong@kernel.org
Subject: Re: [PATCH v2] xfs: up(ic_sema) if flushing data device fails
Date: Fri, 27 Oct 2023 16:11:40 -0700	[thread overview]
Message-ID: <ZTxDrGmO_J2r7xQK@google.com> (raw)
In-Reply-To: <ZTm1n2I3bif0h4er@dread.disaster.area>

On Thu, Oct 26, 2023 at 11:41:03AM +1100, Dave Chinner wrote:
> Hmmmm. So we'll leave an unreferenced, unlocked iclog in a SYNCING
> state where something else can access it, then hope that the
> shutdown gets to it first and that it cleans it all up? That doesn't
> seem completely safe to me.
> 
> At entry to this function, if the log is already shut down, it runs
> xlog_state_done_syncing() to force the iclog and it's attached state
> to be cleaned up before dropping the lock and returning.
> 
> If I look at xlog_ioend_work(), if it gets an error it does the
> shutdown, then calls xlog_state_done_syncing() to clean up the iclog
> and attached state, then drops the lock.
> 
> Hence it appears to me that the error handling for a fatal errors in
> IO submission should match the io completion error handling. i.e the
> error stack for this function should look like this:
> 
> ....
> 	if (xlog_is_shutdown(log))
> 		goto out_done_sync;
> ....
> 	if (error)
> 		goto out_do_shutdown;
> ....
> out_do_shutdown:
> 	xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR);
> out_done_sync:
> 	xlog_state_done_syncing(iclog);
> 	up(&iclog->ic_sema);
> }
> 
> Thoughts?
Sure, that makes sense to me and will make things more consistent. I'll
send out a new version. Thanks for the review!

- Leah

> 
> -Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

      reply	other threads:[~2023-10-27 23:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 22:58 [PATCH v2] xfs: up(ic_sema) if flushing data device fails Leah Rumancik
2023-10-26  0:41 ` Dave Chinner
2023-10-27 23:11   ` Leah Rumancik [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=ZTxDrGmO_J2r7xQK@google.com \
    --to=leah.rumancik@gmail.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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