diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-03-14 08:40:29 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-03-14 08:40:29 -0400 |
commit | c618e87a5fd02aaad006c12d5a80a231dfa39250 (patch) | |
tree | 3f8f1f39fb6dedf3cb72fbd71377cc0eecafc7ce /fs | |
parent | d6a079e82efd5fcbb1c7295f22e123c2cc748018 (diff) |
GFS2: Update to AIL list locking
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/log.c | 2 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 2 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 4e3c044934e6..e7ed31f858dd 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, | |||
67 | * @mapping: The associated mapping (maybe NULL) | 67 | * @mapping: The associated mapping (maybe NULL) |
68 | * @bd: The gfs2_bufdata to remove | 68 | * @bd: The gfs2_bufdata to remove |
69 | * | 69 | * |
70 | * The log lock _must_ be held when calling this function | 70 | * The ail lock _must_ be held when calling this function |
71 | * | 71 | * |
72 | */ | 72 | */ |
73 | 73 | ||
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 4295a6a0f1e4..e919abf25ecd 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) | |||
51 | /* If this buffer is in the AIL and it has already been written | 51 | /* If this buffer is in the AIL and it has already been written |
52 | * to in-place disk block, remove it from the AIL. | 52 | * to in-place disk block, remove it from the AIL. |
53 | */ | 53 | */ |
54 | spin_lock(&sdp->sd_ail_lock); | ||
54 | if (bd->bd_ail) | 55 | if (bd->bd_ail) |
55 | list_move(&bd->bd_ail_st_list, &bd->bd_ail->ai_ail2_list); | 56 | list_move(&bd->bd_ail_st_list, &bd->bd_ail->ai_ail2_list); |
57 | spin_unlock(&sdp->sd_ail_lock); | ||
56 | get_bh(bh); | 58 | get_bh(bh); |
57 | atomic_inc(&sdp->sd_log_pinned); | 59 | atomic_inc(&sdp->sd_log_pinned); |
58 | trace_gfs2_pin(bd, 1); | 60 | trace_gfs2_pin(bd, 1); |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 939739c7b3f9..01d97f486553 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 | |||
326 | brelse(bh); | 326 | brelse(bh); |
327 | } | 327 | } |
328 | if (bd) { | 328 | if (bd) { |
329 | spin_lock(&sdp->sd_ail_lock); | ||
329 | if (bd->bd_ail) { | 330 | if (bd->bd_ail) { |
330 | gfs2_remove_from_ail(bd); | 331 | gfs2_remove_from_ail(bd); |
331 | bh->b_private = NULL; | 332 | bh->b_private = NULL; |
@@ -333,6 +334,7 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int | |||
333 | bd->bd_blkno = bh->b_blocknr; | 334 | bd->bd_blkno = bh->b_blocknr; |
334 | gfs2_trans_add_revoke(sdp, bd); | 335 | gfs2_trans_add_revoke(sdp, bd); |
335 | } | 336 | } |
337 | spin_unlock(&sdp->sd_ail_lock); | ||
336 | } | 338 | } |
337 | clear_buffer_dirty(bh); | 339 | clear_buffer_dirty(bh); |
338 | clear_buffer_uptodate(bh); | 340 | clear_buffer_uptodate(bh); |