diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-01 17:41:58 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-01 17:41:58 -0500 |
commit | b4dc72911d149d7d6b7ffb512bd68906f1cbd33a (patch) | |
tree | 2b00b45b2c63eac9b3aa3b353f1ba44b9a14582d | |
parent | c9fd43078f5007c6ca6b3a9cd04c51a8f0e44a20 (diff) |
[GFS2] Fix some bugs
Fix a bug I introduced earlier with a kfree() and usage of
a structure in the wrong order. Also try and get the counts
of the journaled data buffers "more correct". Still some work
to do in this area though.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r-- | fs/gfs2/log.c | 2 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 1 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 13 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 32a41a274bf8..e6a84f7a9b71 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -597,8 +597,6 @@ void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) | |||
597 | sdp->sd_vfs->s_dirt = 1; | 597 | sdp->sd_vfs->s_dirt = 1; |
598 | unlock_from_trans(sdp); | 598 | unlock_from_trans(sdp); |
599 | 599 | ||
600 | kfree(tr); | ||
601 | |||
602 | gfs2_log_lock(sdp); | 600 | gfs2_log_lock(sdp); |
603 | if (sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks)) { | 601 | if (sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks)) { |
604 | gfs2_log_unlock(sdp); | 602 | gfs2_log_unlock(sdp); |
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 430161a05a21..9d40e21f6ead 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -474,6 +474,7 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
474 | gfs2_trans_add_gl(bd->bd_gl); | 474 | gfs2_trans_add_gl(bd->bd_gl); |
475 | list_add(&bd->bd_list_tr, &tr->tr_list_buf); | 475 | list_add(&bd->bd_list_tr, &tr->tr_list_buf); |
476 | gfs2_pin(sdp, bd->bd_bh); | 476 | gfs2_pin(sdp, bd->bd_bh); |
477 | tr->tr_num_buf_new++; | ||
477 | } | 478 | } |
478 | gfs2_log_lock(sdp); | 479 | gfs2_log_lock(sdp); |
479 | if (!list_empty(&le->le_list)) { | 480 | if (!list_empty(&le->le_list)) { |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 5d1f4a1e4077..63e7fed2bd47 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -87,7 +87,6 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks, | |||
87 | void gfs2_trans_end(struct gfs2_sbd *sdp) | 87 | void gfs2_trans_end(struct gfs2_sbd *sdp) |
88 | { | 88 | { |
89 | struct gfs2_trans *tr; | 89 | struct gfs2_trans *tr; |
90 | struct gfs2_holder *t_gh; | ||
91 | 90 | ||
92 | tr = current->journal_info; | 91 | tr = current->journal_info; |
93 | current->journal_info = NULL; | 92 | current->journal_info = NULL; |
@@ -95,13 +94,11 @@ void gfs2_trans_end(struct gfs2_sbd *sdp) | |||
95 | if (gfs2_assert_warn(sdp, tr)) | 94 | if (gfs2_assert_warn(sdp, tr)) |
96 | return; | 95 | return; |
97 | 96 | ||
98 | t_gh = &tr->tr_t_gh; | ||
99 | |||
100 | if (!tr->tr_touched) { | 97 | if (!tr->tr_touched) { |
101 | gfs2_log_release(sdp, tr->tr_reserved); | 98 | gfs2_log_release(sdp, tr->tr_reserved); |
102 | 99 | ||
103 | gfs2_glock_dq(t_gh); | 100 | gfs2_glock_dq(&tr->tr_t_gh); |
104 | gfs2_holder_uninit(t_gh); | 101 | gfs2_holder_uninit(&tr->tr_t_gh); |
105 | 102 | ||
106 | kfree(tr); | 103 | kfree(tr); |
107 | return; | 104 | return; |
@@ -120,8 +117,10 @@ void gfs2_trans_end(struct gfs2_sbd *sdp) | |||
120 | 117 | ||
121 | gfs2_log_commit(sdp, tr); | 118 | gfs2_log_commit(sdp, tr); |
122 | 119 | ||
123 | gfs2_glock_dq(t_gh); | 120 | gfs2_glock_dq(&tr->tr_t_gh); |
124 | gfs2_holder_uninit(t_gh); | 121 | gfs2_holder_uninit(&tr->tr_t_gh); |
122 | |||
123 | kfree(tr); | ||
125 | 124 | ||
126 | if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS) | 125 | if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS) |
127 | gfs2_log_flush(sdp); | 126 | gfs2_log_flush(sdp); |