Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173170
b: refs/heads/master
c: 09eb47a
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Sep 14, 2009
1 parent 0d134a0 commit 77ad182
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1c839bb2d8d6f1f6bf48f5c657752b4963f88f8
refs/heads/master: 09eb47a7c52ad535aafca889e0b936c445c375ce
12 changes: 11 additions & 1 deletion trunk/fs/reiserfs/stree.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,14 @@ static void search_by_key_reada(struct super_block *s,
for (i = 0; i < num; i++) {
bh[i] = sb_getblk(s, b[i]);
}
/*
* We are going to read some blocks on which we
* have a reference. It's safe, though we might be
* reading blocks concurrently changed if we release
* the lock. But it's still fine because we check later
* if the tree changed
*/
reiserfs_write_unlock(s);
for (j = 0; j < i; j++) {
/*
* note, this needs attention if we are getting rid of the BKL
Expand Down Expand Up @@ -626,10 +634,12 @@ int search_by_key(struct super_block *sb, const struct cpu_key *key, /* Key to s
if ((bh = last_element->pe_buffer =
sb_getblk(sb, block_number))) {
if (!buffer_uptodate(bh) && reada_count > 1)
/* will unlock the write lock */
search_by_key_reada(sb, reada_bh,
reada_blocks, reada_count);
else
reiserfs_write_unlock(sb);
ll_rw_block(READ, 1, &bh);
reiserfs_write_unlock(sb);
wait_on_buffer(bh);
reiserfs_write_lock(sb);
if (!buffer_uptodate(bh))
Expand Down

0 comments on commit 77ad182

Please sign in to comment.