From nobody Tue Nov 26 01:35:35 2024 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 054DE7DA7C for ; Tue, 22 Oct 2024 14:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608557; cv=none; b=MXPefC06ZkxWuZbk6pxkRWnGWyj27wMBeJxSi2MB1qtIEpqHYnlWWNc4ubuWLsPCNrWhJBtkNbEkILBai568UdZrdD7ukV2HeIqJaCqroul/xnrRP2oLvVtqNbV5ifIzHoT9VvehLVHHCn5QiexJ+VvLdhyLk6L2Rnt4q8AGZs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608557; c=relaxed/simple; bh=lFchxuWYdoChXXQRufyH2iiBvFGz6l9XBMUrcB9WM6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rY4j4KtFqdAwHmYjmbi0Z8qGvl2caGOXBNiF3xefTf1I3XUs5KMJSGMmxgdvsLN2h1jtepDBcM/b1CSjcae2t8oaQUkySxHqRgGyEg1TAfbIhbL/ynxK7g/AG6t5uK+tZ8sS91mTxTm3yyeqjwzDjgFrasP+pTw+5NItBkvivdI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com; spf=none smtp.mailfrom=batbytes.com; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b=euFVfnXv; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=batbytes.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b="euFVfnXv" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-71806621d42so2777469a34.3 for ; Tue, 22 Oct 2024 07:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1729608555; x=1730213355; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qKaj8XArk4+aUuXdEGwzY4pbQVUlMNZ2d7arPW6y4hE=; b=euFVfnXvL3lY+cdxbzYrRV7OwKEvHrB729WWGf1MgUkeePZSHGSTXqbdWhYcRRqq+y cOKZW4KxK5rJD9ET3ieYlk/xS9KlTlFmG8ElqqQPGveXuxJI/v328m0w119/1bFTNVxF CCBEhoEa92U5XwVi8VfKVwL7ojdLvcOXcSFv2xzXPi+obqvq5xcyzlEHnFdDzk2XymWg dEucFuD1FJYzPPpP8tH8mAjG4VxGzdHiVAuA2pqfaBaP6ageIBh50ZBJX8KRNLrB5B25 K2HtgB/JHL7NZh5l5ge4fX++oCLUPMmC1jsKi30mEQBtYassSqffEiTlpp2+WOwA8dzg scCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729608555; x=1730213355; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qKaj8XArk4+aUuXdEGwzY4pbQVUlMNZ2d7arPW6y4hE=; b=HFBsE01iyJYYZaj98fIWf76M6RD5H+j1okIka8WX9QN0PcsVsDEWZzJutFaCeHdtqg 1OUxr7RumzfjEshIdVLI3vX8kWOAVRr187c7kXVidyIR9m1GV+BZC2ttFQtjdDtd7G92 Y6sr3zSeVriCpq5sB9Ttw5Nv6fFC0ejFC/tRX660xpkpmnJ2xxsimcCRqmEGFgdlS0Ks kxfjFwaEQzuf9ubUQLP82i1ESdjVhAT26GSxS9alIN94F+hSU2NYCjfB2LGsJVVRfFTf iTLwuepOGGns9THyVhHeORb1CDzokZA3tm8e5BcedQA0Tdl8aV8YtTdMGVbdeMEw72Pt njMA== X-Forwarded-Encrypted: i=1; AJvYcCUMBLJuALXJNwu5CRvnexPrqY3GiHUMjBj+FJ42AaR+xP5FTwWFy6v150h8ctO0P1f+JP2wGBlxhiO7t0U=@vger.kernel.org X-Gm-Message-State: AOJu0YwmkUkcxkOHkbKHeDo1jaTAslHSgYLeu3ky0o5uO1vv4UODDLPR wLf/3IC6YbfPEUD57Wmk5IAlvlm4PFxFvgtGlKQlXXV4lJMTaz+nnlMGQ8Nc+w== X-Google-Smtp-Source: AGHT+IEwaVAWGLfmNMr+lJeaJ8Yjtm1v6/BmAIKrS4HDg/0jFnT+ZsEs65PuzbPkJaDPNgiT6tOGMw== X-Received: by 2002:a05:6358:311b:b0:1c3:7503:86bd with SMTP id e5c5f4694b2df-1c3cd4f3699mr170166855d.14.1729608555009; Tue, 22 Oct 2024 07:49:15 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ce008fb5e0sm29567476d6.33.2024.10.22.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 07:49:14 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , Patrick Donnelly , ceph-devel@vger.kernel.org (open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/3] ceph: correct ceph_mds_cap_item field name Date: Tue, 22 Oct 2024 10:48:33 -0400 Message-ID: <20241022144838.1049499-2-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241022144838.1049499-1-batrick@batbytes.com> References: <20241022144838.1049499-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The issue_seq is sent with bulk cap releases, not the current sequence numb= er. See also ceph.git commit: "include/ceph_fs: correct ceph_mds_cap_item field= name". See-also: https://tracker.ceph.com/issues/66704 Signed-off-by: Patrick Donnelly --- fs/ceph/mds_client.c | 2 +- include/linux/ceph/ceph_fs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index c4a5fd94bbbb..0be82de8a6da 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2362,7 +2362,7 @@ static void ceph_send_cap_releases(struct ceph_mds_cl= ient *mdsc, item->ino =3D cpu_to_le64(cap->cap_ino); item->cap_id =3D cpu_to_le64(cap->cap_id); item->migrate_seq =3D cpu_to_le32(cap->mseq); - item->seq =3D cpu_to_le32(cap->issue_seq); + item->issue_seq =3D cpu_to_le32(cap->issue_seq); msg->front.iov_len +=3D sizeof(*item); =20 ceph_put_cap(mdsc, cap); diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index ee1d0e5f9789..4ff3ad5e9210 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h @@ -822,7 +822,7 @@ struct ceph_mds_cap_release { struct ceph_mds_cap_item { __le64 ino; __le64 cap_id; - __le32 migrate_seq, seq; + __le32 migrate_seq, issue_seq; } __attribute__ ((packed)); =20 #define CEPH_MDS_LEASE_REVOKE 1 /* mds -> client */ --=20 Patrick Donnelly, Ph.D. He / Him / His Red Hat Partner Engineer IBM, Inc. GPG: 19F28A586F808C2402351B93C3301A3E258DD79D From nobody Tue Nov 26 01:35:35 2024 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AF591A2653 for ; Tue, 22 Oct 2024 14:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608559; cv=none; b=F9QbonskcAMdNMgsWIZdGcdr7ckmGw/d6Z7Z1DSbNhg4kWyy4I2Xe9S8hmmJezG22w7F89D0UssNsnKG5XoojkFyfnxSaML2bBVLiMdtNRyFkSdq4QWtad9H3CaoBumQyMDSp3I3HTaFmqpQwFc8q3W0vsjvqtaC8weoke3NIaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608559; c=relaxed/simple; bh=B4/JBdGM31QVKWtGy9/jYiS1rDqbLwKvIygE6O9yYRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kq5//ByvKnYlAMYcGYLCU24U5LPQn10yBfanHfBP37zR+baFd7a78uDV/Pv4uvnW01PHR3PcnxhvccISgN8Z98hhmHLVvMMlZRXfSi6obyUeOtmO6ibRkLp1pIMktivolQN+pQH9uJdUoTgOpqg4sdEoe5Ikz6H+vYS9HA/8250= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com; spf=none smtp.mailfrom=batbytes.com; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b=mXlTSl1f; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=batbytes.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b="mXlTSl1f" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6cbcd8ce5f9so42460196d6.2 for ; Tue, 22 Oct 2024 07:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1729608557; x=1730213357; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ao33/Ao6F4cGAA89YWrjFOas+y1/CWWJL3mox+XBbjc=; b=mXlTSl1fnTW0aUFzgbuwqW0N6nlgDP8fdzi5Y72/c16b5czYfey1C9MFd+1cknohik 0DVhjSP1CsoknxMWZdpjZ6SAjgl5QKDRbKTodsTpj1l9EA9RDHwbjD+00euZ90MzmKlN RLAiCvmC7VlpMX5dmSmvqm6vtju7gz+BH8IcXyusoZrWPKSEhyBhXlDVKh3W8gTx9poM ocDrES5FVD3hZB5p3aN0UV6AIZkyUCWnd0JNOVe1z28URgqKCmAgi5BfS0s/RSKpwLlC Bub4sFTSPQ+5Pbdm3VESUKbM1DretIbbOASdA9ptmKp4aqf+2+8SHiK+YRsfG3rYejKr cZfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729608557; x=1730213357; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ao33/Ao6F4cGAA89YWrjFOas+y1/CWWJL3mox+XBbjc=; b=JHZ23qPiW8ncpFgLNiqmpOnmQDlLXImefzoHa7Va3wro5UsBQ2IcMXhKc/Gl1aRyKQ uUnApDfAva4GkeLCKlEtrOUDnY3hGT0avF3RgKc55MqpNAn9ttd3ORV1gVq0qJKVCZCQ yHjMqLzPbpkdajcErTJrWqqQl3DoK+B1mL5kdrqG6Exwhb1vf1WsRH5RSqGLceBftj8+ MXzqxkhtrKCw7c7prqZ83fcE1TSikO5B9eD5RepzOrdj1IUS2SGdVJfBY8ulGxtSgJ7K YgDGbRw/dhYWrjErCiuBAozxXzkvDVR/L2OtOK9T19/LBh5Q8a8DrTECzQ4vVoxs0nwd hj5A== X-Forwarded-Encrypted: i=1; AJvYcCVQXyKaJCVY1VYbE0ATEW4yGXUye2N366VDMMBoAFszrau8qkCaPOJ4NBshCs+A5o/CXr0xSlJqdRSXDd4=@vger.kernel.org X-Gm-Message-State: AOJu0YycD3qB4esPHOnOnQRP12+tvkb05vnprdjm1zckrCop6yQqcEiv Ns14RXn7Jv7Bn9dSe8ipzvV9bTDIvRPechnHCAR3DYrVO60AvqUqFvJm49n+Fw== X-Google-Smtp-Source: AGHT+IEQvf5cTMPWOx5JdiKcQp2p2AUl+navPVpwui70L5Ta37U4YKujOI9u35XkgTY1mpQRh+hL+g== X-Received: by 2002:a05:6214:2dc8:b0:6cb:5418:4523 with SMTP id 6a1803df08f44-6cde15d31a9mr294382766d6.40.1729608557223; Tue, 22 Oct 2024 07:49:17 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ce008fb5e0sm29567476d6.33.2024.10.22.07.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 07:49:16 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , Patrick Donnelly , ceph-devel@vger.kernel.org (open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] ceph: correct ceph_mds_cap_peer field name Date: Tue, 22 Oct 2024 10:48:34 -0400 Message-ID: <20241022144838.1049499-3-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241022144838.1049499-1-batrick@batbytes.com> References: <20241022144838.1049499-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" See also ceph.git commit: "include/ceph_fs: correct ceph_mds_cap_peer field= name". See-also: https://tracker.ceph.com/issues/66704 Signed-off-by: Patrick Donnelly --- fs/ceph/caps.c | 23 ++++++++++++----------- include/linux/ceph/ceph_fs.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index bed34fc11c91..88a674cf27a8 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -4086,17 +4086,17 @@ static void handle_cap_export(struct inode *inode, = struct ceph_mds_caps *ex, struct ceph_inode_info *ci =3D ceph_inode(inode); u64 t_cap_id; unsigned mseq =3D le32_to_cpu(ex->migrate_seq); - unsigned t_seq, t_mseq; + unsigned t_issue_seq, t_mseq; int target, issued; int mds =3D session->s_mds; =20 if (ph) { t_cap_id =3D le64_to_cpu(ph->cap_id); - t_seq =3D le32_to_cpu(ph->seq); + t_issue_seq =3D le32_to_cpu(ph->issue_seq); t_mseq =3D le32_to_cpu(ph->mseq); target =3D le32_to_cpu(ph->mds); } else { - t_cap_id =3D t_seq =3D t_mseq =3D 0; + t_cap_id =3D t_issue_seq =3D t_mseq =3D 0; target =3D -1; } =20 @@ -4134,12 +4134,12 @@ static void handle_cap_export(struct inode *inode, = struct ceph_mds_caps *ex, if (tcap) { /* already have caps from the target */ if (tcap->cap_id =3D=3D t_cap_id && - ceph_seq_cmp(tcap->seq, t_seq) < 0) { + ceph_seq_cmp(tcap->seq, t_issue_seq) < 0) { doutc(cl, " updating import cap %p mds%d\n", tcap, target); tcap->cap_id =3D t_cap_id; - tcap->seq =3D t_seq - 1; - tcap->issue_seq =3D t_seq - 1; + tcap->seq =3D t_issue_seq - 1; + tcap->issue_seq =3D t_issue_seq - 1; tcap->issued |=3D issued; tcap->implemented |=3D issued; if (cap =3D=3D ci->i_auth_cap) { @@ -4154,7 +4154,7 @@ static void handle_cap_export(struct inode *inode, st= ruct ceph_mds_caps *ex, int flag =3D (cap =3D=3D ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0; tcap =3D new_cap; ceph_add_cap(inode, tsession, t_cap_id, issued, 0, - t_seq - 1, t_mseq, (u64)-1, flag, &new_cap); + t_issue_seq - 1, t_mseq, (u64)-1, flag, &new_cap); =20 if (!list_empty(&ci->i_cap_flush_list) && ci->i_auth_cap =3D=3D tcap) { @@ -4268,14 +4268,14 @@ static void handle_cap_import(struct ceph_mds_clien= t *mdsc, doutc(cl, " remove export cap %p mds%d flags %d\n", ocap, peer, ph->flags); if ((ph->flags & CEPH_CAP_FLAG_AUTH) && - (ocap->seq !=3D le32_to_cpu(ph->seq) || + (ocap->seq !=3D le32_to_cpu(ph->issue_seq) || ocap->mseq !=3D le32_to_cpu(ph->mseq))) { pr_err_ratelimited_client(cl, "mismatched seq/mseq: " "%p %llx.%llx mds%d seq %d mseq %d" " importer mds%d has peer seq %d mseq %d\n", inode, ceph_vinop(inode), peer, ocap->seq, ocap->mseq, mds, - le32_to_cpu(ph->seq), + le32_to_cpu(ph->issue_seq), le32_to_cpu(ph->mseq)); } ceph_remove_cap(mdsc, ocap, (ph->flags & CEPH_CAP_FLAG_RELEASE)); @@ -4350,7 +4350,7 @@ void ceph_handle_caps(struct ceph_mds_session *sessio= n, struct ceph_snap_realm *realm =3D NULL; int op; int msg_version =3D le16_to_cpu(msg->hdr.version); - u32 seq, mseq; + u32 seq, mseq, issue_seq; struct ceph_vino vino; void *snaptrace; size_t snaptrace_len; @@ -4375,6 +4375,7 @@ void ceph_handle_caps(struct ceph_mds_session *sessio= n, vino.snap =3D CEPH_NOSNAP; seq =3D le32_to_cpu(h->seq); mseq =3D le32_to_cpu(h->migrate_seq); + issue_seq =3D le32_to_cpu(h->issue_seq); =20 snaptrace =3D h + 1; snaptrace_len =3D le32_to_cpu(h->snap_trace_len); @@ -4598,7 +4599,7 @@ void ceph_handle_caps(struct ceph_mds_session *sessio= n, cap->cap_id =3D le64_to_cpu(h->cap_id); cap->mseq =3D mseq; cap->seq =3D seq; - cap->issue_seq =3D seq; + cap->issue_seq =3D issue_seq; spin_lock(&session->s_cap_lock); __ceph_queue_cap_release(session, cap); spin_unlock(&session->s_cap_lock); diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index 4ff3ad5e9210..2d7d86f0290d 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h @@ -808,7 +808,7 @@ struct ceph_mds_caps { =20 struct ceph_mds_cap_peer { __le64 cap_id; - __le32 seq; + __le32 issue_seq; __le32 mseq; __le32 mds; __u8 flags; --=20 Patrick Donnelly, Ph.D. He / Him / His Red Hat Partner Engineer IBM, Inc. GPG: 19F28A586F808C2402351B93C3301A3E258DD79D From nobody Tue Nov 26 01:35:35 2024 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B01441A3047 for ; Tue, 22 Oct 2024 14:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608562; cv=none; b=t1yR4SO21QzgPcw2Teym3fyXRCpTZ5bpHbp1Un3ILurMf+8AYofBWw9cKcssdpU5fdQmok+mhcrPVD4fWdc4vkbxE+cHnfvjtiq1vGEWEAPyGFjrnA3jkQxYprt1igNb48D0pMUye22/d+pBEBs8+JGctmSOyuH1XxMVs0ITmaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608562; c=relaxed/simple; bh=4OEr5DlA2GJoYYQduLmLnz2yUHPnnHV7+HNBrHK40y8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TxSDVSmrgjNFtnFrq2ItetStXE2+BhtWg8Ik1SvaOGGJ5L6eqKHTATIN+TNYyZ/nJ55XFX7DQ6xd7/TsVCJzJcx5h0R8YpSdvuRa9xNIidH8WSoySeyns6uvIz0ReYNMgfSzB4K5Cy0xzRrena54/6w6JxzgN+Dcj1z4wArq+Sc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com; spf=none smtp.mailfrom=batbytes.com; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b=t7FFmX+K; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=batbytes.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b="t7FFmX+K" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6c5ab2de184so33879326d6.0 for ; Tue, 22 Oct 2024 07:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1729608559; x=1730213359; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JUIHvjCHyF6SlVUAxO2Vzn0YEoHF5gMFXLys0iHDmcY=; b=t7FFmX+KGk9OKSkIJZOJDWrQ5kuJt6OlBJxmBKu09bpSpDAt6mUVbmjrX09eQM9zyF zrkPvvdCP2wVPU55hLTcAUtt+mARuBGGDMhR6fnLu8Yii/LalUSjc2NVG6I8fCcVW8G4 GiC7F/aX40bsJntb9j/Z/Bv0FrcI6dptfrRt28wJL/iTdpEDwHhcycTMy4ekem9sKDam uZnMOSkv5rh7ivtxEAtMOuG0dn7Js9Rw6poxvvNoeATtujVM2BvZIM9nToxyfZGP9pko FzRuSkcQlYexydcEZnJeztjTAmXA56vOB2DvALh2FmKbogg0l3ASHJOnBSWzQVelCGMJ Lk+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729608559; x=1730213359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JUIHvjCHyF6SlVUAxO2Vzn0YEoHF5gMFXLys0iHDmcY=; b=n01m/lHWMhS0j0WSEa7M6FI4pQAsZrMjQSkK5vrCdMiPfecUv5YCQ8ueDjNqG2QyHI L45NwGDibcQ2BOKDxKGeSPU40Gfv1XcThcTSeSeis9ey7I5j9UW22hwwKn2ORL/UtIQF LPem6k0iToFbKUzoj5y/tmCPfqWYjr5d6rLn3MauXkogrpbhk31dxLchJ16JS5C3ri4t htS4yexFK+T2ScmTbqzXEWccG49QAswaPPVM6elqmGiTX7iVshfqpcGSk8/ltedLTMW5 6RreZ5VRPZweC1w+uA06toBf7TDEeNi+M4xxhoj6NJGqCzJ2QmW7/drMtI5Pa3Xi3TPd f02g== X-Forwarded-Encrypted: i=1; AJvYcCVspHpTt5dCozGMmle/BmugH4+WsuWIQIoMSWVosm9921ZCXgr7B5a1t2dFhScgIi+4NJjIYQalqTYYBvs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+wxgYQaTrsYYsCzEO/BwuRjwtwXkly+9gzX5FRx4yND2KOBAK 4xw4EKDNUUi642M5U/TbvShqf4ZB/VQgnC9ZpFWpdn17Ddo2ojWNBbbb6Vh4nw== X-Google-Smtp-Source: AGHT+IH3GsDmqjG7wCDqtCT6s5bIQ7bSl7g/uLVQ9ufgCfUrWcFOgQzIsrGJDmIGgT4w6Y6GpQAnMQ== X-Received: by 2002:ad4:4b6e:0:b0:6ce:2f4e:40f1 with SMTP id 6a1803df08f44-6ce2f4e43d0mr10514266d6.26.1729608559507; Tue, 22 Oct 2024 07:49:19 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ce008fb5e0sm29567476d6.33.2024.10.22.07.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 07:49:19 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , ceph-devel@vger.kernel.org (open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] ceph: improve caps debugging output Date: Tue, 22 Oct 2024 10:48:35 -0400 Message-ID: <20241022144838.1049499-4-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241022144838.1049499-1-batrick@batbytes.com> References: <20241022144838.1049499-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Patrick Donnelly This improves uniformity and exposes important sequence numbers. Now looks like: <7>[ 73.749563] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f8= 4-5a195b205e9a 15290] caps mds2 op export ino 20000000000.fffffffffffffffe= inode 0000000008d2e5ea seq 0 iseq 0 mseq 0 ... <7>[ 73.749574] ceph: caps.c:4102 : [c9653bca-110b-4f70-9f8= 4-5a195b205e9a 15290] cap 20000000000.fffffffffffffffe export to peer 1 pi= seq 1 pmseq 1 ... <7>[ 73.749645] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f8= 4-5a195b205e9a 15290] caps mds1 op import ino 20000000000.fffffffffffffffe= inode 0000000008d2e5ea seq 1 iseq 1 mseq 1 ... <7>[ 73.749681] ceph: caps.c:4244 : [c9653bca-110b-4f70-9f8= 4-5a195b205e9a 15290] cap 20000000000.fffffffffffffffe import from peer 2 = piseq 686 pmseq 0 ... <7>[ 248.645596] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f8= 4-5a195b205e9a 15290] caps mds1 op revoke ino 20000000000.fffffffffffffffe= inode 0000000008d2e5ea seq 2538 iseq 1 mseq 1 See also: "mds: add issue_seq to all cap messages" in ceph.git See-also: https://tracker.ceph.com/issues/66704 Signed-off-by: Patrick Donnelly --- fs/ceph/caps.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 88a674cf27a8..74ba310dfcc7 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -4085,8 +4085,7 @@ static void handle_cap_export(struct inode *inode, st= ruct ceph_mds_caps *ex, struct ceph_cap *cap, *tcap, *new_cap =3D NULL; struct ceph_inode_info *ci =3D ceph_inode(inode); u64 t_cap_id; - unsigned mseq =3D le32_to_cpu(ex->migrate_seq); - unsigned t_issue_seq, t_mseq; + u32 t_issue_seq, t_mseq; int target, issued; int mds =3D session->s_mds; =20 @@ -4100,8 +4099,8 @@ static void handle_cap_export(struct inode *inode, st= ruct ceph_mds_caps *ex, target =3D -1; } =20 - doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d target %d\n", - inode, ceph_vinop(inode), ci, mds, mseq, target); + doutc(cl, " cap %llx.%llx export to peer %d piseq %u pmseq %u\n", + ceph_vinop(inode), target, t_issue_seq, t_mseq); retry: down_read(&mdsc->snap_rwsem); spin_lock(&ci->i_ceph_lock); @@ -4228,18 +4227,22 @@ static void handle_cap_import(struct ceph_mds_clien= t *mdsc, u64 realmino =3D le64_to_cpu(im->realm); u64 cap_id =3D le64_to_cpu(im->cap_id); u64 p_cap_id; + u32 piseq =3D 0; + u32 pmseq =3D 0; int peer; =20 if (ph) { p_cap_id =3D le64_to_cpu(ph->cap_id); peer =3D le32_to_cpu(ph->mds); + piseq =3D le32_to_cpu(ph->issue_seq); + pmseq =3D le32_to_cpu(ph->mseq); } else { p_cap_id =3D 0; peer =3D -1; } =20 - doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d peer %d\n", - inode, ceph_vinop(inode), ci, mds, mseq, peer); + doutc(cl, " cap %llx.%llx import from peer %d piseq %u pmseq %u\n", + ceph_vinop(inode), peer, piseq, pmseq); retry: cap =3D __get_cap_for_mds(ci, mds); if (!cap) { @@ -4268,15 +4271,13 @@ static void handle_cap_import(struct ceph_mds_clien= t *mdsc, doutc(cl, " remove export cap %p mds%d flags %d\n", ocap, peer, ph->flags); if ((ph->flags & CEPH_CAP_FLAG_AUTH) && - (ocap->seq !=3D le32_to_cpu(ph->issue_seq) || - ocap->mseq !=3D le32_to_cpu(ph->mseq))) { + (ocap->seq !=3D piseq || + ocap->mseq !=3D pmseq)) { pr_err_ratelimited_client(cl, "mismatched seq/mseq: " "%p %llx.%llx mds%d seq %d mseq %d" " importer mds%d has peer seq %d mseq %d\n", inode, ceph_vinop(inode), peer, - ocap->seq, ocap->mseq, mds, - le32_to_cpu(ph->issue_seq), - le32_to_cpu(ph->mseq)); + ocap->seq, ocap->mseq, mds, piseq, pmseq); } ceph_remove_cap(mdsc, ocap, (ph->flags & CEPH_CAP_FLAG_RELEASE)); } @@ -4360,8 +4361,6 @@ void ceph_handle_caps(struct ceph_mds_session *sessio= n, bool close_sessions =3D false; bool do_cap_release =3D false; =20 - doutc(cl, "from mds%d\n", session->s_mds); - if (!ceph_inc_mds_stopping_blocker(mdsc, session)) return; =20 @@ -4463,12 +4462,11 @@ void ceph_handle_caps(struct ceph_mds_session *sess= ion, =20 /* lookup ino */ inode =3D ceph_find_inode(mdsc->fsc->sb, vino); - doutc(cl, " op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), - vino.ino, vino.snap, inode); + doutc(cl, " caps mds%d op %s ino %llx.%llx inode %p seq %u iseq %u mseq %= u\n", + session->s_mds, ceph_cap_op_name(op), vino.ino, vino.snap, inode, + seq, issue_seq, mseq); =20 mutex_lock(&session->s_mutex); - doutc(cl, " mds%d seq %lld cap seq %u\n", session->s_mds, - session->s_seq, (unsigned)seq); =20 if (!inode) { doutc(cl, " i don't have ino %llx\n", vino.ino); --=20 Patrick Donnelly, Ph.D. He / Him / His Red Hat Partner Engineer IBM, Inc. GPG: 19F28A586F808C2402351B93C3301A3E258DD79D