Commit e109007461cddfc80a908f0b015f4eeb485e1d85
1 parent
7d04a335b6
Exists in
master
and in
4 other branches
[XFS] Fix a buffer refcount leak in dir2 code on a forced shutdown.
SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26097a Signed-off-by: Nathan Scott <nathans@sgi.com>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
fs/xfs/xfs_dir2_node.c
... | ... | @@ -505,7 +505,6 @@ |
505 | 505 | XFS_DATA_FORK))) { |
506 | 506 | return error; |
507 | 507 | } |
508 | - curfdb = newfdb; | |
509 | 508 | free = curbp->data; |
510 | 509 | ASSERT(be32_to_cpu(free->hdr.magic) == |
511 | 510 | XFS_DIR2_FREE_MAGIC); |
512 | 511 | |
... | ... | @@ -527,8 +526,11 @@ |
527 | 526 | if (unlikely(be16_to_cpu(free->bests[fi]) == NULLDATAOFF)) { |
528 | 527 | XFS_ERROR_REPORT("xfs_dir2_leafn_lookup_int", |
529 | 528 | XFS_ERRLEVEL_LOW, mp); |
529 | + if (curfdb != newfdb) | |
530 | + xfs_da_brelse(tp, curbp); | |
530 | 531 | return XFS_ERROR(EFSCORRUPTED); |
531 | 532 | } |
533 | + curfdb = newfdb; | |
532 | 534 | if (be16_to_cpu(free->bests[fi]) >= length) { |
533 | 535 | *indexp = index; |
534 | 536 | state->extravalid = 1; |