Skip to content

Commit 9a083b0

Browse files
committed
CLIENT: C_Read_Async_Finisher should assume client_lock is held
Client::C_Read_Async_Finisher::finish() doesn't need to take the lock because ObjectCacher has already assured the lock is held. Of course when we immediately complete, we don't need to unlock. Signed-off-by: Frank S. Filz <[email protected]>
1 parent 297ca51 commit 9a083b0

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/client/Client.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10999,15 +10999,11 @@ void Client::do_readahead(Fh *f, Inode *in, uint64_t off, uint64_t len)
1099910999

1100011000
void Client::C_Read_Async_Finisher::finish(int r)
1100111001
{
11002-
clnt->client_lock.lock();
11003-
1100411002
// Do read ahead as long as we aren't completing with 0 bytes
1100511003
if (r != 0)
1100611004
clnt->do_readahead(f, in, off, len);
1100711005

1100811006
onfinish->complete(r);
11009-
11010-
clnt->client_lock.unlock();
1101111007
}
1101211008

1101311009
int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
@@ -11039,9 +11035,7 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
1103911035
Context *crf = io_finish.release();
1104011036

1104111037
// Complete the crf immediately with 0 bytes
11042-
client_lock.unlock();
1104311038
crf->complete(0);
11044-
client_lock.lock();
1104511039

1104611040
// Signal async completion
1104711041
return 0;
@@ -11073,9 +11067,7 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
1107311067
Context *crf = io_finish.release();
1107411068
if (r != 0) {
1107511069
// need to do readahead, so complete the crf
11076-
client_lock.unlock();
1107711070
crf->complete(r);
11078-
client_lock.lock();
1107911071
} else {
1108011072
get_cap_ref(in, CEPH_CAP_FILE_CACHE);
1108111073
}

0 commit comments

Comments
 (0)