From: David Chinner <dgc@sgi.com>
To: xfs@oss.sgi.com
Cc: t-nagano@ah.jp.nec.com, xfs-dev@sgi.com
Subject: [REVIEW 4 of 4] Fix race in xfs_iunpin
Date: Tue, 24 Oct 2006 17:22:14 +1000 [thread overview]
Message-ID: <20061024072214.GU11034@melbourne.sgi.com> (raw)
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
Close a race condition in xfs_iunpin() - we need to guarantee the
atomicity of the last unpin and the checking of the XFS_IRECLAIM*
flags otherwise pre-emption or interrupt can cause us to race with
xfs_iget_core() which would now see the inode as unpinned and hence
clear the XFS_IRECLAIMABLE flag.
---
fs/xfs/xfs_inode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2006-10-19 10:26:01.983441994 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2006-10-19 10:29:31.008384156 +1000
@@ -2741,7 +2741,7 @@ xfs_iunpin(
{
ASSERT(atomic_read(&ip->i_pincount) > 0);
- if (atomic_dec_and_test(&ip->i_pincount)) {
+ if (atomic_dec_and_lock(&ip->i_pincount, &ip->i_flags_lock)) {
/*
* If the inode is currently being reclaimed, the link between
@@ -2760,7 +2760,6 @@ xfs_iunpin(
* unpinned.
*/
- spin_lock(&ip->i_flags_lock);
if (!__xfs_iflags_test(ip, XFS_IRECLAIM|XFS_IRECLAIMABLE)) {
bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
struct inode *inode = NULL;
reply other threads:[~2006-10-24 7:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061024072214.GU11034@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=t-nagano@ah.jp.nec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.