]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ceph: use correct index when encoding client supported features
authorLuís Henriques <lhenriques@suse.de>
Tue, 24 May 2022 16:06:27 +0000 (17:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:38:00 +0000 (11:38 +0200)
commit97cea2cb7c861f9c2f7870c6068c1131f59311ae
tree45b1ae6ab4577c2af643afca2a4848db3665f1e2
parent7a327285a7b04daca52fe1e7b277cd5da2a957d2
ceph: use correct index when encoding client supported features

commit fea013e020e6ecc7be75bea0d61697b7e916b44d upstream.

Feature bits have to be encoded into the correct locations.  This hasn't
been an issue so far because the only hole in the feature bits was in bit
10 (CEPHFS_FEATURE_RECLAIM_CLIENT), which is located in the 2nd byte.  When
adding more bits that go beyond the this 2nd byte, the bug will show up.

[xiubli: remove incorrect comment for CEPHFS_FEATURES_CLIENT_SUPPORTED]

Fixes: 9ba1e224538a ("ceph: allocate the correct amount of extra bytes for the session features")
Signed-off-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/mds_client.c
fs/ceph/mds_client.h