Skip to content

Commit

Permalink
Merge PR ceph#60411 into main
Browse files Browse the repository at this point in the history
* refs/pull/60411/head:
	client: Fix a deadlock when osd is full

Reviewed-by: Venky Shankar <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Dhairya Parmar <[email protected]>
  • Loading branch information
vshankar committed Jan 2, 2025
2 parents 467582d + 60c5801 commit 557ccdc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11753,8 +11753,12 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
cond_iofinish = new C_SaferCond();
filer_iofinish.reset(cond_iofinish);
} else {
//Register a wrapper callback for the C_Write_Finisher which takes 'client_lock'
filer_iofinish.reset(new C_Lock_Client_Finisher(this, iofinish.get()));
//Register a wrapper callback C_Lock_Client_Finisher for the C_Write_Finisher which takes 'client_lock'.
//Use C_OnFinisher for callbacks. The op_cancel_writes has to be called without 'client_lock' held because
//the callback registered here needs to take it. This would cause incorrect lock order i.e., objecter->rwlock
//taken by objecter's op_cancel and then 'client_lock' taken by callback. To fix the lock order, queue
//the callback using the finisher
filer_iofinish.reset(new C_OnFinisher(new C_Lock_Client_Finisher(this, iofinish.get()), &objecter_finisher));
}

get_cap_ref(in, CEPH_CAP_FILE_BUFFER);
Expand Down

0 comments on commit 557ccdc

Please sign in to comment.