diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2012-10-15 05:57:02 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-11-07 08:31:07 -0500 |
commit | 8eae1ca0034cce78a24738087a32adb1ddb66aa7 (patch) | |
tree | f43287fa4232a5fdcf78eb74a004ec986c261807 /fs/gfs2/glops.c | |
parent | 0e4a43ed08e2f44aa7b96aa95d0a540d675483e1 (diff) |
GFS2: Review bug traps in glops.c
Two of the bug traps here could really be warnings. The others are
converted from BUG() to GLOCK_BUG_ON() since we'll most likely
need to know the glock state in order to debug any issues which
arise. As a result of this, __dump_glock has to be renamed and
is no longer static.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glops.c')
-rw-r--r-- | fs/gfs2/glops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 32cc4fde975c..0a3e7c7e26c1 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -74,7 +74,7 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) | |||
74 | 74 | ||
75 | gfs2_trans_add_revoke(sdp, bd); | 75 | gfs2_trans_add_revoke(sdp, bd); |
76 | } | 76 | } |
77 | BUG_ON(!fsync && atomic_read(&gl->gl_ail_count)); | 77 | GLOCK_BUG_ON(gl, !fsync && atomic_read(&gl->gl_ail_count)); |
78 | spin_unlock(&sdp->sd_ail_lock); | 78 | spin_unlock(&sdp->sd_ail_lock); |
79 | gfs2_log_unlock(sdp); | 79 | gfs2_log_unlock(sdp); |
80 | } | 80 | } |
@@ -96,7 +96,7 @@ static void gfs2_ail_empty_gl(struct gfs2_glock *gl) | |||
96 | tr.tr_ip = (unsigned long)__builtin_return_address(0); | 96 | tr.tr_ip = (unsigned long)__builtin_return_address(0); |
97 | sb_start_intwrite(sdp->sd_vfs); | 97 | sb_start_intwrite(sdp->sd_vfs); |
98 | gfs2_log_reserve(sdp, tr.tr_reserved); | 98 | gfs2_log_reserve(sdp, tr.tr_reserved); |
99 | BUG_ON(current->journal_info); | 99 | WARN_ON_ONCE(current->journal_info); |
100 | current->journal_info = &tr; | 100 | current->journal_info = &tr; |
101 | 101 | ||
102 | __gfs2_ail_flush(gl, 0); | 102 | __gfs2_ail_flush(gl, 0); |
@@ -139,7 +139,7 @@ static void rgrp_go_sync(struct gfs2_glock *gl) | |||
139 | 139 | ||
140 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) | 140 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) |
141 | return; | 141 | return; |
142 | BUG_ON(gl->gl_state != LM_ST_EXCLUSIVE); | 142 | GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); |
143 | 143 | ||
144 | gfs2_log_flush(gl->gl_sbd, gl); | 144 | gfs2_log_flush(gl->gl_sbd, gl); |
145 | filemap_fdatawrite(metamapping); | 145 | filemap_fdatawrite(metamapping); |
@@ -168,7 +168,7 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags) | |||
168 | { | 168 | { |
169 | struct address_space *mapping = gfs2_glock2aspace(gl); | 169 | struct address_space *mapping = gfs2_glock2aspace(gl); |
170 | 170 | ||
171 | BUG_ON(!(flags & DIO_METADATA)); | 171 | WARN_ON_ONCE(!(flags & DIO_METADATA)); |
172 | gfs2_assert_withdraw(gl->gl_sbd, !atomic_read(&gl->gl_ail_count)); | 172 | gfs2_assert_withdraw(gl->gl_sbd, !atomic_read(&gl->gl_ail_count)); |
173 | truncate_inode_pages(mapping, 0); | 173 | truncate_inode_pages(mapping, 0); |
174 | 174 | ||
@@ -197,7 +197,7 @@ static void inode_go_sync(struct gfs2_glock *gl) | |||
197 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) | 197 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) |
198 | return; | 198 | return; |
199 | 199 | ||
200 | BUG_ON(gl->gl_state != LM_ST_EXCLUSIVE); | 200 | GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); |
201 | 201 | ||
202 | gfs2_log_flush(gl->gl_sbd, gl); | 202 | gfs2_log_flush(gl->gl_sbd, gl); |
203 | filemap_fdatawrite(metamapping); | 203 | filemap_fdatawrite(metamapping); |