Skip to content

Commit 3523c8a

Browse files
Shan Haijfvogel
authored andcommitted
Btrfs: fix a bug introduced by back porting an upstream commit
Resolution of a code conflict when cherry picking upstream commit 1f250e9 (Btrfs: fix log replay failure after unlink and link combination) introduces a regression which causes failure of several xfstests cases including btrfs/095,159, generic/034,039,040,041,065,066,101,107,311,325,348, 376 etc., fix it by back porting a dependence upstream commit and remove the conflict resolving code and left the original commit intact. Orabug: 28920621 Signed-off-by: Shan Hai <[email protected]> Reviewed-by: Allen Pais <[email protected]>
1 parent b0f6ba5 commit 3523c8a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/btrfs/tree-log.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,6 @@ static int unlink_old_inode_refs(struct btrfs_trans_handle *trans,
12361236
struct btrfs_key *key)
12371237
{
12381238
int ret;
1239-
int slot;
12401239
unsigned long ref_ptr;
12411240
unsigned long ref_end;
12421241
struct extent_buffer *eb;
@@ -1254,18 +1253,17 @@ static int unlink_old_inode_refs(struct btrfs_trans_handle *trans,
12541253
eb = path->nodes[0];
12551254
ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]);
12561255
ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]);
1257-
slot = 0;
12581256
while (ref_ptr < ref_end) {
12591257
char *name = NULL;
12601258
int namelen;
12611259
u64 parent_id;
12621260

12631261
if (key->type == BTRFS_INODE_EXTREF_KEY) {
1264-
ret = extref_get_fields(eb, slot, ref_ptr, &namelen, &name,
1262+
ret = extref_get_fields(eb, ref_ptr, &namelen, &name,
12651263
NULL, &parent_id);
12661264
} else {
12671265
parent_id = key->offset;
1268-
ret = ref_get_fields(eb, slot, ref_ptr, &namelen, &name,
1266+
ret = ref_get_fields(eb, ref_ptr, &namelen, &name,
12691267
NULL);
12701268
}
12711269
if (ret)
@@ -1304,7 +1302,6 @@ static int unlink_old_inode_refs(struct btrfs_trans_handle *trans,
13041302
ref_ptr += sizeof(struct btrfs_inode_extref);
13051303
else
13061304
ref_ptr += sizeof(struct btrfs_inode_ref);
1307-
slot++;
13081305
}
13091306
ret = 0;
13101307
out:

0 commit comments

Comments
 (0)