From: Ben Myers <bpm@sgi.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: XFS mailing list <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs: Fix a deadlock in xfs_log_commit_cil() code path
Date: Mon, 22 Jul 2013 13:53:43 -0500 [thread overview]
Message-ID: <20130722185343.GB3111@sgi.com> (raw)
In-Reply-To: <1374273098.8941.2075.camel@chandra-dt.ibm.com>
On Fri, Jul 19, 2013 at 05:31:38PM -0500, Chandra Seetharaman wrote:
>
> While testing and rearranging pquota/gquota code, I stumbled
> on a xfs_shutdown() during a mount. But the mount just hung.
>
> Debugged and found that there is a deadlock involving
> &log->l_cilp->xc_ctx_lock.
>
> It is in a code path where &log->l_cilp->xc_ctx_lock is first
> acquired in read mode and some levels down the same semaphore
> is being acquired in write mode causing a deadlock.
>
> This is the stack:
> xfs_log_commit_cil -> acquires &log->l_cilp->xc_ctx_lock in read mode
> xlog_print_tic_res
> xfs_force_shutdown
> xfs_log_force_umount
> xlog_cil_force
> xlog_cil_force_lsn
> xlog_cil_push_foreground
> xlog_cil_push - tries to acquire same semaphore in write mode
>
> This patch fixes the deadlock by changing the reason code for
> xfs_force_shutdown in xlog_print_tic_res() to SHUTDOWN_LOG_IO_ERROR.
>
> SHUTDOWN_LOG_IO_ERROR is the right reason code to be set since
> we are in the log path.
>
> Thanks to Dave for suggesting this solution.
>
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Looks fine.
Reviewed-by: Ben Myers <bpm@sgi.com>
Applied.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-07-22 18:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 22:31 [PATCH] xfs: Fix a deadlock in xfs_log_commit_cil() code path Chandra Seetharaman
2013-07-22 18:53 ` Ben Myers [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-07-15 22:52 Chandra Seetharaman
2013-07-16 0:54 ` Dave Chinner
2013-07-17 21:32 ` Chandra Seetharaman
2013-07-18 2:24 ` Dave Chinner
2013-07-18 19:54 ` Chandra Seetharaman
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=20130722185343.GB3111@sgi.com \
--to=bpm@sgi.com \
--cc=sekharan@us.ibm.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