• Sage Weil's avatar
    ceph: fix iput race when queueing inode work · 15a2015f
    Sage Weil authored
    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>
    15a2015f
inode.c 48.7 KB