]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.fixes/ocfs2-use-ocfs2_rec_clusters-in-ocfs2_adjust_adjace.patch
Imported linux-2.6.27.39 suse/xen patches.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / ocfs2-use-ocfs2_rec_clusters-in-ocfs2_adjust_adjace.patch
1 From 82e12644cf5227dab15201fbcaf0ca6330ebd70f Mon Sep 17 00:00:00 2001
2 From: Tao Ma <tao.ma@oracle.com>
3 Date: Thu, 23 Jul 2009 08:12:58 +0800
4 Subject: [PATCH] ocfs2: Use ocfs2_rec_clusters in ocfs2_adjust_adjacent_records.
5 References: bnc#528427
6
7 In ocfs2_adjust_adjacent_records, we will adjust adjacent records
8 according to the extent_list in the lower level. But actually
9 the lower level tree will either be a leaf or a branch. If we only
10 use ocfs2_is_empty_extent we will meet with some problem if the lower
11 tree is a branch (tree_depth > 1). So use !ocfs2_rec_clusters instead.
12 And actually only the leaf record can have holes. So add a BUG_ON
13 for non-leaf branch.
14
15 Signed-off-by: Tao Ma <tao.ma@oracle.com>
16 Signed-off-by: Joel Becker <joel.becker@oracle.com>
17 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
18 ---
19 fs/ocfs2/alloc.c | 3 ++-
20 1 files changed, 2 insertions(+), 1 deletions(-)
21
22 Index: linux-2.6.27-SLE11_BRANCH/fs/ocfs2/alloc.c
23 ===================================================================
24 --- linux-2.6.27-SLE11_BRANCH.orig/fs/ocfs2/alloc.c
25 +++ linux-2.6.27-SLE11_BRANCH/fs/ocfs2/alloc.c
26 @@ -1769,7 +1769,8 @@ static void ocfs2_adjust_adjacent_record
27 * immediately to their right.
28 */
29 left_clusters = le32_to_cpu(right_child_el->l_recs[0].e_cpos);
30 - if (ocfs2_is_empty_extent(&right_child_el->l_recs[0])) {
31 + if (!ocfs2_rec_clusters(right_child_el, &right_child_el->l_recs[0])) {
32 + BUG_ON(right_child_el->l_tree_depth);
33 BUG_ON(le16_to_cpu(right_child_el->l_next_free_rec) <= 1);
34 left_clusters = le32_to_cpu(right_child_el->l_recs[1].e_cpos);
35 }