libceph: wait for latest osdmap in ceph_monc_blacklist_add()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 20 Mar 2019 08:46:58 +0000 (09:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2019 05:13:51 +0000 (14:13 +0900)
commit2e5522ad5c1cca8848525721643f824cc651ca16
treea70c7db44cf4008ba88795397ea4eb0c9c3e30d0
parent1e7b9a3143ad2a24c909351acecfdeafe17d0a9d
libceph: wait for latest osdmap in ceph_monc_blacklist_add()

commit bb229bbb3bf63d23128e851a1f3b85c083178fa1 upstream.

Because map updates are distributed lazily, an OSD may not know about
the new blacklist for quite some time after "osd blacklist add" command
is completed.  This makes it possible for a blacklisted but still alive
client to overwrite a post-blacklist update, resulting in data
corruption.

Waiting for latest osdmap in ceph_monc_blacklist_add() and thus using
the post-blacklist epoch for all post-blacklist requests ensures that
all such requests "wait" for the blacklist to come into force on their
respective OSDs.

Cc: stable@vger.kernel.org
Fixes: 6305a3b41515 ("libceph: support for blacklisting clients")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/ceph/libceph.h
net/ceph/ceph_common.c
net/ceph/mon_client.c