aboutsummaryrefslogtreecommitdiff
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-08-31 12:14:44 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-31 12:14:44 -0400
commit623d93555c8884768db65ffc11509c93e50dd4db (patch)
tree08be5484217e9c7851b129d2794b4afe8e44760c /fs/gfs2/lops.c
parent899be4d3b7e00bf364d84c1c8cfe8bbbd1e3507b (diff)
[GFS2] Fix releasepage bug (fixes direct i/o writes)
This patch fixes three main bugs. Firstly the direct i/o get_block was returning the wrong return code in certain cases. Secondly, the GFS2's releasepage function was not dealing with cases when clean, ordered buffers were found still queued on a transaction (which can happen depending on the ordering of journal flushes). Thirdly, the journaling code itself needed altering to take account of the after effects of removing the clean ordered buffers from the transactions before a journal flush. The releasepage bug did also show up under "normal" buffered i/o as well, so its not just a fix for direct i/o. In fact its not normally used in the direct i/o path at all, except when flushing existing buffers after performing a direct i/o write, but that was the code path that led us to spot this. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 08de8b7fb31..0ec38b39909 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -592,6 +592,17 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
gfs2_log_lock(sdp);
if (n++ > num)
break;
+ } else if (!bd1->bd_bh) {
+ total_dbuf--;
+ sdp->sd_log_num_databuf--;
+ list_del_init(&bd1->bd_le.le_list);
+ if (bd1 == bd2) {
+ bd2 = NULL;
+ bd2 = list_prepare_entry(bd2,
+ &sdp->sd_log_le_databuf,
+ bd_le.le_list);
+ }
+ kmem_cache_free(gfs2_bufdata_cachep, bd1);
}
}
gfs2_log_unlock(sdp);