diff options
Diffstat (limited to 'fs/reiserfs/fix_node.c')
-rw-r--r-- | fs/reiserfs/fix_node.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index 5e5a4e6fbaf8..bf5f2cbdb063 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c | |||
@@ -1022,7 +1022,11 @@ static int get_far_parent(struct tree_balance *tb, | |||
1022 | /* Check whether the common parent is locked. */ | 1022 | /* Check whether the common parent is locked. */ |
1023 | 1023 | ||
1024 | if (buffer_locked(*pcom_father)) { | 1024 | if (buffer_locked(*pcom_father)) { |
1025 | |||
1026 | /* Release the write lock while the buffer is busy */ | ||
1027 | reiserfs_write_unlock(tb->tb_sb); | ||
1025 | __wait_on_buffer(*pcom_father); | 1028 | __wait_on_buffer(*pcom_father); |
1029 | reiserfs_write_lock(tb->tb_sb); | ||
1026 | if (FILESYSTEM_CHANGED_TB(tb)) { | 1030 | if (FILESYSTEM_CHANGED_TB(tb)) { |
1027 | brelse(*pcom_father); | 1031 | brelse(*pcom_father); |
1028 | return REPEAT_SEARCH; | 1032 | return REPEAT_SEARCH; |
@@ -1927,7 +1931,9 @@ static int get_direct_parent(struct tree_balance *tb, int h) | |||
1927 | return REPEAT_SEARCH; | 1931 | return REPEAT_SEARCH; |
1928 | 1932 | ||
1929 | if (buffer_locked(bh)) { | 1933 | if (buffer_locked(bh)) { |
1934 | reiserfs_write_unlock(tb->tb_sb); | ||
1930 | __wait_on_buffer(bh); | 1935 | __wait_on_buffer(bh); |
1936 | reiserfs_write_lock(tb->tb_sb); | ||
1931 | if (FILESYSTEM_CHANGED_TB(tb)) | 1937 | if (FILESYSTEM_CHANGED_TB(tb)) |
1932 | return REPEAT_SEARCH; | 1938 | return REPEAT_SEARCH; |
1933 | } | 1939 | } |
@@ -2278,7 +2284,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *tb) | |||
2278 | REPEAT_SEARCH : CARRY_ON; | 2284 | REPEAT_SEARCH : CARRY_ON; |
2279 | } | 2285 | } |
2280 | #endif | 2286 | #endif |
2287 | reiserfs_write_unlock(tb->tb_sb); | ||
2281 | __wait_on_buffer(locked); | 2288 | __wait_on_buffer(locked); |
2289 | reiserfs_write_lock(tb->tb_sb); | ||
2282 | if (FILESYSTEM_CHANGED_TB(tb)) | 2290 | if (FILESYSTEM_CHANGED_TB(tb)) |
2283 | return REPEAT_SEARCH; | 2291 | return REPEAT_SEARCH; |
2284 | } | 2292 | } |
@@ -2349,7 +2357,9 @@ int fix_nodes(int op_mode, struct tree_balance *tb, | |||
2349 | 2357 | ||
2350 | /* if it possible in indirect_to_direct conversion */ | 2358 | /* if it possible in indirect_to_direct conversion */ |
2351 | if (buffer_locked(tbS0)) { | 2359 | if (buffer_locked(tbS0)) { |
2360 | reiserfs_write_unlock(tb->tb_sb); | ||
2352 | __wait_on_buffer(tbS0); | 2361 | __wait_on_buffer(tbS0); |
2362 | reiserfs_write_lock(tb->tb_sb); | ||
2353 | if (FILESYSTEM_CHANGED_TB(tb)) | 2363 | if (FILESYSTEM_CHANGED_TB(tb)) |
2354 | return REPEAT_SEARCH; | 2364 | return REPEAT_SEARCH; |
2355 | } | 2365 | } |