Skip to content
Commit 15a2015f authored by Sage Weil's avatar Sage Weil
Browse files

ceph: fix iput race when queueing inode work



If we queue a work item that calls iput(), make sure we ihold() before
attempting to queue work. Otherwise our queued work might miraculously run
before we notice the queue_work() succeeded and call ihold(), allowing the
inode to be destroyed.

That is, instead of

	if (queue_work(...))
		ihold();

we need to do

	ihold();
	if (!queue_work(...))
		iput();

Reported-by: default avatarAmon Ott <a.ott@m-privacy.de>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 0c6d4b4e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment