]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw_file: alternate fix deadlock on lru eviction 20075/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 19 Jan 2018 18:05:27 +0000 (13:05 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Jan 2018 10:44:50 +0000 (11:44 +0100)
commite3fbaa92cedb101f79c7e0712017662f6d2ec1cf
tree8fe6832c701daf89466cc2efeb175e7c00efdb1b
parent029594a080b5f02c47da4f08ab4b99c77ddb75a5
rgw_file: alternate fix deadlock on lru eviction

This change is an alternate fix for two problems found and fixed
by Yao Zongyou <yaozongyou@vip.qq.com>.

The deadlock can be avoided just by not taking it in the recycle
case, which invariantly holds the lock.

The invalidation of the insert iterator by the recyle-path unlink
we'd like to handle as a condition in order to preserve the cached
insertion point optimization we get in the common case.  (The
original behavior was, indeed, incorrect.)

Based on feedback from Yao, removed the RGWFileHandle dtor version
of the unlink check, which I think happened twice.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 3cf0880f86b8f7911139c4e3d672cf47420c8f49)
src/common/cohort_lru.h
src/rgw/rgw_file.cc
src/rgw/rgw_file.h