diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-08-02 08:09:36 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-10-21 07:39:20 -0400 |
commit | 75549186edf1515062fe2fcbfbd92bd99659afba (patch) | |
tree | c3942739398fdf76b2cfaa3e5f72575f7fa8d4f8 /fs/gfs2/glops.c | |
parent | 2f0264d592e34cde99efbad7d616b04af138e913 (diff) |
GFS2: Fix bug-trap in ail flush code
The assert was being tested under the wrong lock, a
legacy of the original code. Also, if it does trigger,
the resulting information was not always a lot of help.
This moves the patch under the correct lock and also
prints out more useful information in tacking down the
source of the problem.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glops.c')
-rw-r--r-- | fs/gfs2/glops.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index da21ecaafcc2..99df4832f94c 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -28,6 +28,17 @@ | |||
28 | #include "trans.h" | 28 | #include "trans.h" |
29 | #include "dir.h" | 29 | #include "dir.h" |
30 | 30 | ||
31 | static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) | ||
32 | { | ||
33 | fs_err(gl->gl_sbd, "AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page state 0x%lx\n", | ||
34 | bh, (unsigned long long)bh->b_blocknr, bh->b_state, | ||
35 | bh->b_page->mapping, bh->b_page->flags); | ||
36 | fs_err(gl->gl_sbd, "AIL glock %u:%llu mapping %p\n", | ||
37 | gl->gl_name.ln_type, gl->gl_name.ln_number, | ||
38 | gfs2_glock2aspace(gl)); | ||
39 | gfs2_lm_withdraw(gl->gl_sbd, "AIL error\n"); | ||
40 | } | ||
41 | |||
31 | /** | 42 | /** |
32 | * __gfs2_ail_flush - remove all buffers for a given lock from the AIL | 43 | * __gfs2_ail_flush - remove all buffers for a given lock from the AIL |
33 | * @gl: the glock | 44 | * @gl: the glock |
@@ -41,20 +52,24 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl) | |||
41 | struct list_head *head = &gl->gl_ail_list; | 52 | struct list_head *head = &gl->gl_ail_list; |
42 | struct gfs2_bufdata *bd; | 53 | struct gfs2_bufdata *bd; |
43 | struct buffer_head *bh; | 54 | struct buffer_head *bh; |
55 | sector_t blocknr; | ||
44 | 56 | ||
45 | spin_lock(&sdp->sd_ail_lock); | 57 | spin_lock(&sdp->sd_ail_lock); |
46 | while (!list_empty(head)) { | 58 | while (!list_empty(head)) { |
47 | bd = list_entry(head->next, struct gfs2_bufdata, | 59 | bd = list_entry(head->next, struct gfs2_bufdata, |
48 | bd_ail_gl_list); | 60 | bd_ail_gl_list); |
49 | bh = bd->bd_bh; | 61 | bh = bd->bd_bh; |
50 | gfs2_remove_from_ail(bd); | 62 | blocknr = bh->b_blocknr; |
51 | bd->bd_bh = NULL; | 63 | if (buffer_busy(bh)) |
64 | gfs2_ail_error(gl, bh); | ||
52 | bh->b_private = NULL; | 65 | bh->b_private = NULL; |
66 | gfs2_remove_from_ail(bd); /* drops ref on bh */ | ||
53 | spin_unlock(&sdp->sd_ail_lock); | 67 | spin_unlock(&sdp->sd_ail_lock); |
54 | 68 | ||
55 | bd->bd_blkno = bh->b_blocknr; | 69 | bd->bd_bh = NULL; |
70 | bd->bd_blkno = blocknr; | ||
71 | |||
56 | gfs2_log_lock(sdp); | 72 | gfs2_log_lock(sdp); |
57 | gfs2_assert_withdraw(sdp, !buffer_busy(bh)); | ||
58 | gfs2_trans_add_revoke(sdp, bd); | 73 | gfs2_trans_add_revoke(sdp, bd); |
59 | gfs2_log_unlock(sdp); | 74 | gfs2_log_unlock(sdp); |
60 | 75 | ||