1 From: Tao Ma <tao.ma@oracle.com>
2 Date: Fri, 9 Jan 2009 07:32:48 +0800
3 Subject: [PATCH] ocfs2: Access and dirty the buffer_head in mark_written.
6 In __ocfs2_mark_extent_written, when we meet with the situation
7 of c_split_covers_rec, the old solution just replace the extent
8 record and forget to access and dirty the buffer_head. This will
9 cause a problem when the unwritten extent is in an extent block.
10 So access and dirty it.
12 Signed-off-by: Tao Ma <tao.ma@oracle.com>
13 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 fs/ocfs2/alloc.c | 27 ++++++++++++++++++++++++++-
16 1 files changed, 26 insertions(+), 1 deletions(-)
18 Index: linux-2.6.27-sle11_ocfs2_update2/fs/ocfs2/alloc.c
19 ===================================================================
20 --- linux-2.6.27-sle11_ocfs2_update2.orig/fs/ocfs2/alloc.c
21 +++ linux-2.6.27-sle11_ocfs2_update2/fs/ocfs2/alloc.c
22 @@ -4708,6 +4708,29 @@ out:
26 +static int ocfs2_replace_extent_rec(struct inode *inode,
28 + struct ocfs2_path *path,
29 + struct ocfs2_extent_list *el,
31 + struct ocfs2_extent_rec *split_rec)
35 + ret = ocfs2_journal_access(handle, inode, path_leaf_bh(path),
36 + OCFS2_JOURNAL_ACCESS_WRITE);
42 + el->l_recs[split_index] = *split_rec;
44 + ocfs2_journal_dirty(handle, path_leaf_bh(path));
50 * Mark part or all of the extent record at split_index in the leaf
51 * pointed to by path as written. This removes the unwritten
52 @@ -4802,7 +4825,9 @@ static int __ocfs2_mark_extent_written(s
54 if (ctxt.c_contig_type == CONTIG_NONE) {
55 if (ctxt.c_split_covers_rec)
56 - el->l_recs[split_index] = *split_rec;
57 + ret = ocfs2_replace_extent_rec(inode, handle,
59 + split_index, split_rec);
61 ret = ocfs2_split_and_insert(inode, handle, path, et,
62 &last_eb_bh, split_index,