From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v3] xfs: fix unbalanced inode reclaim flush locking
Date: Wed, 26 Oct 2016 16:49:47 +1100 [thread overview]
Message-ID: <20161026054947.GK23194@dastard> (raw)
In-Reply-To: <20161025173312.GA6594@laptop.bfoster>
On Tue, Oct 25, 2016 at 01:33:12PM -0400, Brian Foster wrote:
> On Tue, Oct 18, 2016 at 02:26:15PM -0400, Brian Foster wrote:
> > Filesystem shutdown testing on an older distro kernel has uncovered an
> > imbalanced locking pattern for the inode flush lock in
> > xfs_reclaim_inode(). Specifically, there is a double unlock sequence
> > between the call to xfs_iflush_abort() and xfs_reclaim_inode() at the
> > "reclaim:" label.
> >
> > This actually does not cause obvious problems on current kernels due to
> > the current flush lock implementation. Older kernels use a counting
> > based flush lock mechanism, however, which effectively breaks the lock
> > indefinitely when an already unlocked flush lock is repeatedly unlocked.
> > Though this only currently occurs on filesystem shutdown, it has
> > reproduced the effect of elevating an fs shutdown to a system-wide crash
> > or hang.
> >
> > As it turns out, the flush lock is not actually required for the reclaim
> > logic in xfs_reclaim_inode() because by that time we have already cycled
> > the flush lock once while holding ILOCK_EXCL. Therefore, remove the
> > additional flush lock/unlock cycle around the 'reclaim:' label and
> > update branches into this label to release the flush lock where
> > appropriate. Add an assert to xfs_ifunlock() to help prevent future
> > occurences of the same problem.
> >
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > Reported-by: Zorro Lang <zlang@redhat.com>
> > ---
>
> ping?
not had a chance to context switch back to this. Once I've got the
reflink userspace stuff sorted, I'll switch back to kernel stuff...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2016-10-26 5:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 18:26 [PATCH v3] xfs: fix unbalanced inode reclaim flush locking Brian Foster
2016-10-20 7:50 ` Zorro Lang
2016-10-25 17:33 ` Brian Foster
2016-10-26 5:49 ` Dave Chinner [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=20161026054947.GK23194@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).