Skip to content

Commit e1bf4cc

Browse files
author
Al Viro
committed
ocfs: ->rl_used breakage on big-endian
it's le16, not le32 or le64... Signed-off-by: Al Viro <[email protected]>
1 parent 3a251f0 commit e1bf4cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/ocfs2/refcounttree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh,
14681468

14691469
trace_ocfs2_divide_leaf_refcount_block(
14701470
(unsigned long long)ref_leaf_bh->b_blocknr,
1471-
le32_to_cpu(rl->rl_count), le32_to_cpu(rl->rl_used));
1471+
le32_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used));
14721472

14731473
/*
14741474
* XXX: Improvement later.
@@ -2411,7 +2411,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
24112411
rb = (struct ocfs2_refcount_block *)
24122412
prev_bh->b_data;
24132413

2414-
if (le64_to_cpu(rb->rf_records.rl_used) +
2414+
if (le16_to_cpu(rb->rf_records.rl_used) +
24152415
recs_add >
24162416
le16_to_cpu(rb->rf_records.rl_count))
24172417
ref_blocks++;
@@ -2476,7 +2476,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
24762476
if (prev_bh) {
24772477
rb = (struct ocfs2_refcount_block *)prev_bh->b_data;
24782478

2479-
if (le64_to_cpu(rb->rf_records.rl_used) + recs_add >
2479+
if (le16_to_cpu(rb->rf_records.rl_used) + recs_add >
24802480
le16_to_cpu(rb->rf_records.rl_count))
24812481
ref_blocks++;
24822482

@@ -3629,7 +3629,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode,
36293629
* one will split a refcount rec, so totally we need
36303630
* clusters * 2 new refcount rec.
36313631
*/
3632-
if (le64_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
3632+
if (le16_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
36333633
le16_to_cpu(rb->rf_records.rl_count))
36343634
ref_blocks++;
36353635

0 commit comments

Comments
 (0)