Currently when mounting, we may end up finding an existing superblock that corresponds to a blocklisted MDS client. This means that the new mount ends up being unusable. If we've found an existing superblock that is already blocklisted, and the client is not configured to recover on its own, fail the match. Cc: Patrick Donnelly <pdonnell@xxxxxxxxxx> Cc: Niels de Vos <ndevos@xxxxxxxxxx> URL: https://bugzilla.redhat.com/show_bug.cgi?id=1901499 Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> --- fs/ceph/super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index f517ad9eeb26..6e0d670a7f34 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -1124,6 +1124,7 @@ static int ceph_compare_super(struct super_block *sb, struct fs_context *fc) struct ceph_mount_options *fsopt = new->mount_options; struct ceph_options *opt = new->client->options; struct ceph_fs_client *other = ceph_sb_to_client(sb); + struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(sb); dout("ceph_compare_super %p\n", sb); @@ -1140,6 +1141,12 @@ static int ceph_compare_super(struct super_block *sb, struct fs_context *fc) dout("flags differ\n"); return 0; } + + /* Exclude any blocklisted superblocks */ + if (mdsc->blocklisted && !(fsopt->flags & CEPH_MOUNT_OPT_CLEANRECOVER)) { + dout("mds client is blocklisted (and CLEANRECOVER is not set)\n"); + return 0; + } return 1; } -- 2.31.1