diff options
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/stree.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 6ddcecb4e8ab..960c9114f6d3 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -529,6 +529,14 @@ static void search_by_key_reada(struct super_block *s, | |||
529 | for (i = 0; i < num; i++) { | 529 | for (i = 0; i < num; i++) { |
530 | bh[i] = sb_getblk(s, b[i]); | 530 | bh[i] = sb_getblk(s, b[i]); |
531 | } | 531 | } |
532 | /* | ||
533 | * We are going to read some blocks on which we | ||
534 | * have a reference. It's safe, though we might be | ||
535 | * reading blocks concurrently changed if we release | ||
536 | * the lock. But it's still fine because we check later | ||
537 | * if the tree changed | ||
538 | */ | ||
539 | reiserfs_write_unlock(s); | ||
532 | for (j = 0; j < i; j++) { | 540 | for (j = 0; j < i; j++) { |
533 | /* | 541 | /* |
534 | * note, this needs attention if we are getting rid of the BKL | 542 | * note, this needs attention if we are getting rid of the BKL |
@@ -626,10 +634,12 @@ int search_by_key(struct super_block *sb, const struct cpu_key *key, /* Key to s | |||
626 | if ((bh = last_element->pe_buffer = | 634 | if ((bh = last_element->pe_buffer = |
627 | sb_getblk(sb, block_number))) { | 635 | sb_getblk(sb, block_number))) { |
628 | if (!buffer_uptodate(bh) && reada_count > 1) | 636 | if (!buffer_uptodate(bh) && reada_count > 1) |
637 | /* will unlock the write lock */ | ||
629 | search_by_key_reada(sb, reada_bh, | 638 | search_by_key_reada(sb, reada_bh, |
630 | reada_blocks, reada_count); | 639 | reada_blocks, reada_count); |
640 | else | ||
641 | reiserfs_write_unlock(sb); | ||
631 | ll_rw_block(READ, 1, &bh); | 642 | ll_rw_block(READ, 1, &bh); |
632 | reiserfs_write_unlock(sb); | ||
633 | wait_on_buffer(bh); | 643 | wait_on_buffer(bh); |
634 | reiserfs_write_lock(sb); | 644 | reiserfs_write_lock(sb); |
635 | if (!buffer_uptodate(bh)) | 645 | if (!buffer_uptodate(bh)) |