From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel@redhat.com, linux-kernel@vger.kernel.org
Cc: Steven Whitehouse <swhiteho@redhat.com>,
Dave Chinner <dchinner@redhat.com>
Subject: [PATCH 13/15] GFS2: Update to AIL list locking
Date: Tue, 15 Mar 2011 09:11:43 +0000 [thread overview]
Message-ID: <1300180305-5993-14-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1300180305-5993-1-git-send-email-swhiteho@redhat.com>
The previous patch missed a couple of places where the AIL list
needed locking, so this fixes up those places, plus a comment
is corrected too.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Dave Chinner <dchinner@redhat.com>
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 4e3c044..e7ed31f 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -67,7 +67,7 @@ unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct,
* @mapping: The associated mapping (maybe NULL)
* @bd: The gfs2_bufdata to remove
*
- * The log lock _must_ be held when calling this function
+ * The ail lock _must_ be held when calling this function
*
*/
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 4295a6a..e919abf 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -51,8 +51,10 @@ static void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh)
/* If this buffer is in the AIL and it has already been written
* to in-place disk block, remove it from the AIL.
*/
+ spin_lock(&sdp->sd_ail_lock);
if (bd->bd_ail)
list_move(&bd->bd_ail_st_list, &bd->bd_ail->ai_ail2_list);
+ spin_unlock(&sdp->sd_ail_lock);
get_bh(bh);
atomic_inc(&sdp->sd_log_pinned);
trace_gfs2_pin(bd, 1);
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 939739c..01d97f4 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -326,6 +326,7 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int
brelse(bh);
}
if (bd) {
+ spin_lock(&sdp->sd_ail_lock);
if (bd->bd_ail) {
gfs2_remove_from_ail(bd);
bh->b_private = NULL;
@@ -333,6 +334,7 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int
bd->bd_blkno = bh->b_blocknr;
gfs2_trans_add_revoke(sdp, bd);
}
+ spin_unlock(&sdp->sd_ail_lock);
}
clear_buffer_dirty(bh);
clear_buffer_uptodate(bh);
--
1.7.4
next prev parent reply other threads:[~2011-03-15 9:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 9:11 GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2011-03-15 9:11 ` [PATCH 01/15] GFS2: Use RCU for glock hash table Steven Whitehouse
2011-03-15 9:11 ` [PATCH 02/15] GFS2: Post-VFS scale update for RCU path walk Steven Whitehouse
2011-03-15 9:11 ` [PATCH 03/15] GFS2: Fix glock queue trace point Steven Whitehouse
2011-03-15 9:11 ` [PATCH 04/15] GFS2: Improve cluster mmap scalability Steven Whitehouse
2011-03-15 9:11 ` [PATCH 05/15] GFS2: panics on quotacheck update Steven Whitehouse
2011-03-15 9:11 ` [PATCH 06/15] GFS2: deallocation performance patch Steven Whitehouse
2011-03-15 9:11 ` [PATCH 07/15] GFS2: quota allows exceeding hard limit Steven Whitehouse
2011-03-15 9:11 ` [PATCH 08/15] GFS2: Fix glock deallocation race Steven Whitehouse
2011-03-15 9:11 ` [PATCH 09/15] GFS2: Remove potential race in flock code Steven Whitehouse
2011-03-15 9:11 ` [PATCH 10/15] GFS2: Optimize glock multiple-dequeue code Steven Whitehouse
2011-03-15 9:11 ` [PATCH 11/15] GFS2: fix block allocation check for fallocate Steven Whitehouse
2011-03-15 9:11 ` [PATCH 12/15] GFS2: introduce AIL lock Steven Whitehouse
2011-03-15 9:11 ` Steven Whitehouse [this message]
2011-03-15 9:11 ` [PATCH 14/15] GFS2: Adding missing unlock_page() Steven Whitehouse
2011-03-15 9:11 ` [PATCH 15/15] GFS2: Don't use _raw version of RCU dereference Steven Whitehouse
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=1300180305-5993-14-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=dchinner@redhat.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®