Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: clear s_cap_reconnect when ceph_pagelist_encode_32() fails

This MDS reconnect error path leaves s_cap_reconnect set.
send_mds_reconnect() sets the bit at the beginning of the reconnect,
but the first failing operation after that, ceph_pagelist_encode_32(),
can jump to `fail:` without clearing it.

__ceph_remove_cap() consults that flag to decide whether cap releases
should be queued. A reconnect-preparation failure therefore leaves the
session in reconnect mode from the cap-release path's point of view
and can strand release work until some later state transition repairs
it.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Max Kellermann and committed by
Ilya Dryomov
cc564309 803447f9

+5 -1
+5 -1
fs/ceph/mds_client.c
··· 4956 4956 /* placeholder for nr_caps */ 4957 4957 err = ceph_pagelist_encode_32(recon_state.pagelist, 0); 4958 4958 if (err) 4959 - goto fail; 4959 + goto fail_clear_cap_reconnect; 4960 4960 4961 4961 if (test_bit(CEPHFS_FEATURE_MULTI_RECONNECT, &session->s_features)) { 4962 4962 recon_state.msg_version = 3; ··· 5046 5046 ceph_pagelist_release(recon_state.pagelist); 5047 5047 return; 5048 5048 5049 + fail_clear_cap_reconnect: 5050 + spin_lock(&session->s_cap_lock); 5051 + session->s_cap_reconnect = 0; 5052 + spin_unlock(&session->s_cap_lock); 5049 5053 fail: 5050 5054 ceph_msg_put(reply); 5051 5055 up_read(&mdsc->snap_rwsem);