From patchwork Sat Oct 12 23:55:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13833507 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 701012F870 for ; Sat, 12 Oct 2024 23:55:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777346; cv=none; b=r6PSTEDpBco1toOFRMtsox8iTMAUQhWlfuIrF4F2xr8sUh2BoDtrihrcFUcsMQUXUEJZcJ3rDrYKcoJ1RzyzbT5FOmcfEtwRihyqn2M978dguuz5f6DkdFNB1pFPHBO1D6FVml1qH97Z089oPcT+3uy+860XWuje7Mq+WnrLU+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777346; c=relaxed/simple; bh=Rs0WhVYlqwQ9GIF9wqpRbWP2+E5Qn796AkiW/OgXwcI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YerrBy7egi3NzyPReBewwXxvPSmBGJaL1nL/u8mGxBozMOHxQd5O8PQ/KhT6HWxVk8o/cYDe9crRd8XEVFIqhpCIUmuxNngOIY090jCg5EsMLnTftTKLPtMWLHAtETLKSPSTURQTWmi+wIh81/oFKOJfvPjp4dJHjFuIQb1/NHI= 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=Bmg4o//l; arc=none smtp.client-ip=209.85.160.176 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="Bmg4o//l" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-460407b421bso25635971cf.3 for ; Sat, 12 Oct 2024 16:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728777343; x=1729382143; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+sk6LUiLeleXUsSllRpsc5OH3Y6ZTlzg70lgLuDUR68=; b=Bmg4o//lsNVigdXFCWLLM1H7fGmb4Fvzfno3G8QVRU0+7J/qRxsmQm385h/A5YJ1ma 34wz8G5pJogkwEV6bR5fEG/wAkOy0g70JNXIRftEf0trR7rDqJyskav+yPRagnaySJTS TzHrL4PS9K75H7UqhkFiV1VbEuet5urZpSJChF+Gr+yKDhb1IOb7DQkiGEMq/QvjMkDy Gj0IupEqbWdgPGFIkpD/RNi4ZMmp0MP+ueuiBx6+mEznmvaKJ3Lptk+m/kCOhUniCgWE ors2nme+QnmNkU0UsDkaA3zqhCHN6MMIwwt6R6ZA1K3DOBVgSma1hyi6jTfYK+c7IQr9 z4hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728777343; x=1729382143; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+sk6LUiLeleXUsSllRpsc5OH3Y6ZTlzg70lgLuDUR68=; b=SEPQnMc4zryF75oPRRm7hisag5ye7kIEO+ycgP+olgqmJOjwK7lqBJkm1qk8kozag7 UWP9i6hWRbFQMiTtVSYxV9NAUVdXegiavnmwTJ83cJzNMRQzmj7rA6yzZJw+WkjTp4eD w4BP8XkcloEysaXbpq/vE/VEh96W3dbf012r9zEhZw7OoCyjJM2xZGmz8ZxTN4zYp5ni OAb5/KqloXQoYqvY9bR9cSiqT6K6kD6s1sB9Hd1LyHcZsNYZZluH8ZnT7yh2RJnr5k4l iY5LVOhYDiIwx20mZkLpVu+GEVpYXpUfpQzFIdwH54E37vY/QVZB5mxXEefFp/f9bz3C lXzQ== X-Forwarded-Encrypted: i=1; AJvYcCVLmZe4tC1ccmcskBjCVKNokeTcHciBhratKM6vBA5E/tFPQh+5JXvI+xZ58oXOAaZ6Bb3txxAkuBcl@vger.kernel.org X-Gm-Message-State: AOJu0YzThZs2Yqj8+5cpv3QPZJjL6759WTbkPTQ3nJzjTLJ9/Wl/Wohl f1S8v/1CdRo+pYAa/jeqH+pDFpp/GGrnhAw/H0knCiYL79hLmZ5dIHyEFUzsc/610pHX0OW7x6L TKQ== X-Google-Smtp-Source: AGHT+IHk5YHd59N8jAKWL+/oKO+RM0w7kbYnSajqFt83qDlUq2bDjS287Ot2L2/6nIQoY78Ym5jFQg== X-Received: by 2002:a05:6214:460d:b0:6cc:9:3205 with SMTP id 6a1803df08f44-6cc00093482mr40916936d6.45.1728777343295; Sat, 12 Oct 2024 16:55:43 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cbe85b7772sm30477966d6.49.2024.10.12.16.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 16:55:42 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , Patrick Donnelly , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ceph: correct ceph_mds_cap_item field name Date: Sat, 12 Oct 2024 19:55:25 -0400 Message-ID: <20241012235529.520289-1-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The issue_seq is sent with bulk cap releases, not the current sequence number. 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(-) base-commit: 75b607fab38d149f232f01eae5e6392b394dd659 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_client *mdsc, item->ino = cpu_to_le64(cap->cap_ino); item->cap_id = cpu_to_le64(cap->cap_id); item->migrate_seq = cpu_to_le32(cap->mseq); - item->seq = cpu_to_le32(cap->issue_seq); + item->issue_seq = cpu_to_le32(cap->issue_seq); msg->front.iov_len += sizeof(*item); 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)); #define CEPH_MDS_LEASE_REVOKE 1 /* mds -> client */ From patchwork Sat Oct 12 23:55:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13833508 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.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 2F04119CC09 for ; Sat, 12 Oct 2024 23:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777350; cv=none; b=Z95fODCFdFM8TqjNdVS3mBZUO+r8i58K5H+XKBH/tX0+uEvSH1hkAza15e4UXukE6hy5AmeAGfgTt+EMyusFXZW4I90juFXuVhSUlQYZtsg/Tdfvqr7zUhBgyJkjvwfBdq7ncFR6gdhbAU9vrFwGJlOexubsfK82QaG3Ek/sUkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777350; c=relaxed/simple; bh=B4/JBdGM31QVKWtGy9/jYiS1rDqbLwKvIygE6O9yYRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pea0MglfIWNXQ8hwH8360fVv64MdXMfHmylVbN+4RAPi9GWH1So3E8fTskbHyR5vTHpAxSOjt5abR5RjkZVqyw+Cm3iIg/NX23u6Tf5GZSzca049a5ldkYGHzlaTQVmfA1REqOppV0S0O+RTk0r3agohEZzpdWYinxLLRxBj0/E= 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=EhL+L7JE; arc=none smtp.client-ip=209.85.219.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="EhL+L7JE" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cbf340fccaso13636006d6.1 for ; Sat, 12 Oct 2024 16:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728777348; x=1729382148; 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=EhL+L7JEQ+HBt1tDjoWXY1aObFGcUxWBK6pVZElAX9peoi+6I6qNJ4m+9wl7hb1On1 UQZjwEEw5hjduWhTuXrGbuXnKHMAYTrY8GVE5sZQoFZdtQgsmAsLmEH6DD4g+fW4RDP/ Nb8SRsS1PCb4REIKe8O9wwx96iDr9B+Vf3o+BKlNRHzeIBYL18sTIK6YDhgiPzMyptOV zn4l+v+D6hhMDHhC+kDSL9hvcUwadUCOI6cly+gd02JHiqZPf7+CLKjT0sHqa9txulsS 96POCH/3rbIDIkcflHjUHrddddTsOg5HNMfb/z0nzVAVXNqZxf1Li8y7PMsWW7ER/Fmb pU+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728777348; x=1729382148; 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=Cv+PG1NQnwdC9QWU3BMk5cR1wpPi7EqPUt1e2RtVxymRRh7BTlCsWeC7gmPdp6ZZ9d 4t9ARQVurE7dn1cx4MsNKpHjTkyuYrYn8C74yx7nzU8zYFW57hKiBQ1MOqyyWbWotK7M 97XhGplGrHyRiN9heyEU5NmDchJWiEwwL9y2gpQF3wIPx6bTPSFWYJooz55LY14yvlxh QOZjs5QnDggZRq96kFYiKO60sAqFpnLX9VKg4d7C3avgJqFi5vXer4KtqT/W61SXJvpR ngq9aT/pnJzd9XY3TLXukS2wRdk/B1AWYbZnTcBzeLpliG9c57eCwVRUIJYGd/V61kTH XjXw== X-Forwarded-Encrypted: i=1; AJvYcCVFhpunaB6onSQHUkoH7w/RUteQUC7Y0h6ITL4FotQP/FJM/f73URjn3TgwWZApOnMBNsE7uBYpHWLt@vger.kernel.org X-Gm-Message-State: AOJu0YzOWiHwtOQ8bE/QKiU61xpuF/s1OysC67csMY27fG2X4caVGU5M U6FdGGbkpAMPxa3nNHzArIgfOmtjBv5pYKG6KqZC7oJTVw9r1CDT4fnAsSSeTg== X-Google-Smtp-Source: AGHT+IFww6d66fpSJEHWX0d5peUSOnJLyx79wkR2Jg6vZqKhHo56VWU5vk3hFYXdUntOg5rHAC7VBA== X-Received: by 2002:a05:6214:62f:b0:6cb:ee9c:7045 with SMTP id 6a1803df08f44-6cbee9c7dcfmr136861886d6.2.1728777348038; Sat, 12 Oct 2024 16:55:48 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cbe85b7772sm30477966d6.49.2024.10.12.16.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 16:55:46 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , Patrick Donnelly , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] ceph: correct ceph_mds_cap_peer field name Date: Sat, 12 Oct 2024 19:55:26 -0400 Message-ID: <20241012235529.520289-2-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241012235529.520289-1-batrick@batbytes.com> References: <20241012235529.520289-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 = ceph_inode(inode); u64 t_cap_id; unsigned mseq = le32_to_cpu(ex->migrate_seq); - unsigned t_seq, t_mseq; + unsigned t_issue_seq, t_mseq; int target, issued; int mds = session->s_mds; if (ph) { t_cap_id = le64_to_cpu(ph->cap_id); - t_seq = le32_to_cpu(ph->seq); + t_issue_seq = le32_to_cpu(ph->issue_seq); t_mseq = le32_to_cpu(ph->mseq); target = le32_to_cpu(ph->mds); } else { - t_cap_id = t_seq = t_mseq = 0; + t_cap_id = t_issue_seq = t_mseq = 0; target = -1; } @@ -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 == 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 = t_cap_id; - tcap->seq = t_seq - 1; - tcap->issue_seq = t_seq - 1; + tcap->seq = t_issue_seq - 1; + tcap->issue_seq = t_issue_seq - 1; tcap->issued |= issued; tcap->implemented |= issued; if (cap == ci->i_auth_cap) { @@ -4154,7 +4154,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0; tcap = 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); if (!list_empty(&ci->i_cap_flush_list) && ci->i_auth_cap == tcap) { @@ -4268,14 +4268,14 @@ static void handle_cap_import(struct ceph_mds_client *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 != le32_to_cpu(ph->seq) || + (ocap->seq != le32_to_cpu(ph->issue_seq) || ocap->mseq != 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 *session, struct ceph_snap_realm *realm = NULL; int op; int msg_version = 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 *session, vino.snap = CEPH_NOSNAP; seq = le32_to_cpu(h->seq); mseq = le32_to_cpu(h->migrate_seq); + issue_seq = le32_to_cpu(h->issue_seq); snaptrace = h + 1; snaptrace_len = le32_to_cpu(h->snap_trace_len); @@ -4598,7 +4599,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, cap->cap_id = le64_to_cpu(h->cap_id); cap->mseq = mseq; cap->seq = seq; - cap->issue_seq = seq; + cap->issue_seq = 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 { struct ceph_mds_cap_peer { __le64 cap_id; - __le32 seq; + __le32 issue_seq; __le32 mseq; __le32 mds; __u8 flags; From patchwork Sat Oct 12 23:55:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13833509 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.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 5CE1B19DF45 for ; Sat, 12 Oct 2024 23:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777353; cv=none; b=bzn7BfZFzgXp19QEyXU1QnY9S6FRJJettqVqr5Np//QO0sfDVgswhbwG98N9NxnRU/D3PCw0uezeGEMMw3PJ7M9IWU+JKduapx+ywUni69ap8DX+pFoZvdhWVddvnHI1h9WQQ0qdRisFdmMuINNOHKgxYF6BF1+Y2gn5QrmEJTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728777353; c=relaxed/simple; bh=4OEr5DlA2GJoYYQduLmLnz2yUHPnnHV7+HNBrHK40y8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uWXuZ1Nw4dtPmX5nlqk8tCuMiH54WSfLaPZPv4VxTkgaTzP9ahPpYBz1Kll0Qo6uUCjGB5jvxGfkaew9iEoALKjf7ueRpvFJ1xz6hYPoiKfSLHZ2SBQufnBtwy9O0qNNk07zbRQ50RZ/t64t09XmyBzi8H2WLva1Io/wLqo9XQU= 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=cYiQKSB7; arc=none smtp.client-ip=209.85.219.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="cYiQKSB7" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cbe90c7c95so28244046d6.1 for ; Sat, 12 Oct 2024 16:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728777351; x=1729382151; 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=cYiQKSB7/lbjZRvjxIQ/HlCxlzVImfgnvVIJGe3KcovQJjOWpn/ZO4Kg1qsksiwjTo gX4DCaWCdWhStZMYDtc1hXG/MTOjQ613B77of8S5iMcv+RRwwWWrkH9nppkZmvdf1uTG 4/E/Y3t2FX8A9YvnoBYa9htwZg+2rNo5I1YUS23CiFPxI7Bl9gLlPMER9lURMi1jWU5N xmTuMfVnLA45ePeVFEIrxIeYO9gSxFa4IYUS7zCDfh7fAHJY/hBnzOvY8BWCS6A19NwJ wg2TuUHR+qB/c4YwxBXmpVcypBAXt4oYNrhF/t+CTJ7uD6asSkvQ51sTHBHSDFm8SRst 74qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728777351; x=1729382151; 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=mzFt/Ni0tzJdjmG5ULosHl6R9pKVnelr6S450Ty7SAtJvn7a3H090lmYehbnlw+jvf iPLTw7us+x/4uNyaaSsFozRe4UXVY/mHmYAIPK+wFlYRYejzxSqi0F1LSJgx8qNwP+Hv +bySQqaTyf6t0xoFIeT5/NLYU7f8YmwY0zkCvCN+99Kw4HmC5KObuEwK+5GMx2t931JI LKrzdhLG8VWmWmcU9VXzXxe6qpVOZMjfCJNA9uOqp37afpgzGfUWtmaYWFdjw11vKCVC 9PAWPoUpXMZxPdCDgzWk1WmvUExkg5AVPSrw7fVRy8ZE7s/aZU41Bh8fOejNLpsY4ygY No1A== X-Forwarded-Encrypted: i=1; AJvYcCUMJgcja8Pa5hqat3j/oRft1RItsDlEMBS2FLUrEdXXd7Aig3TPrRPv8Lxp5+cospdO18O/VewPs8AO@vger.kernel.org X-Gm-Message-State: AOJu0YxfHytaIRO26DndkJKRQZHR+S/kw4ixqhWnsZLwYlb17TDOepg6 04YnqsmHSsIb2UJqgZokfuKUOi8jIMaths2NLbaE0StVB5h7BvAwvPVNAhtEZg== X-Google-Smtp-Source: AGHT+IF7xbC6RydQ84ZvpD5OcH9md/BJ2GwQbW0K+Szes013pS6ywQ9fNubuSzit+OWKUzTm+/qj4g== X-Received: by 2002:a05:6214:3c9a:b0:6cb:cedb:a37a with SMTP id 6a1803df08f44-6cbf9cb3165mr83449786d6.7.1728777351227; Sat, 12 Oct 2024 16:55:51 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cbe85b7772sm30477966d6.49.2024.10.12.16.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 16:55:50 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ceph: improve caps debugging output Date: Sat, 12 Oct 2024 19:55:27 -0400 Message-ID: <20241012235529.520289-3-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241012235529.520289-1-batrick@batbytes.com> References: <20241012235529.520289-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Patrick Donnelly This improves uniformity and exposes important sequence numbers. Now looks like: <7>[ 73.749563] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f84-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-9f84-5a195b205e9a 15290] cap 20000000000.fffffffffffffffe export to peer 1 piseq 1 pmseq 1 ... <7>[ 73.749645] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f84-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-9f84-5a195b205e9a 15290] cap 20000000000.fffffffffffffffe import from peer 2 piseq 686 pmseq 0 ... <7>[ 248.645596] ceph: caps.c:4465 : [c9653bca-110b-4f70-9f84-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, struct ceph_mds_caps *ex, struct ceph_cap *cap, *tcap, *new_cap = NULL; struct ceph_inode_info *ci = ceph_inode(inode); u64 t_cap_id; - unsigned mseq = le32_to_cpu(ex->migrate_seq); - unsigned t_issue_seq, t_mseq; + u32 t_issue_seq, t_mseq; int target, issued; int mds = session->s_mds; @@ -4100,8 +4099,8 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, target = -1; } - 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_client *mdsc, u64 realmino = le64_to_cpu(im->realm); u64 cap_id = le64_to_cpu(im->cap_id); u64 p_cap_id; + u32 piseq = 0; + u32 pmseq = 0; int peer; if (ph) { p_cap_id = le64_to_cpu(ph->cap_id); peer = le32_to_cpu(ph->mds); + piseq = le32_to_cpu(ph->issue_seq); + pmseq = le32_to_cpu(ph->mseq); } else { p_cap_id = 0; peer = -1; } - 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 = __get_cap_for_mds(ci, mds); if (!cap) { @@ -4268,15 +4271,13 @@ static void handle_cap_import(struct ceph_mds_client *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 != le32_to_cpu(ph->issue_seq) || - ocap->mseq != le32_to_cpu(ph->mseq))) { + (ocap->seq != piseq || + ocap->mseq != 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 *session, bool close_sessions = false; bool do_cap_release = false; - doutc(cl, "from mds%d\n", session->s_mds); - if (!ceph_inc_mds_stopping_blocker(mdsc, session)) return; @@ -4463,12 +4462,11 @@ void ceph_handle_caps(struct ceph_mds_session *session, /* lookup ino */ inode = 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); mutex_lock(&session->s_mutex); - doutc(cl, " mds%d seq %lld cap seq %u\n", session->s_mds, - session->s_seq, (unsigned)seq); if (!inode) { doutc(cl, " i don't have ino %llx\n", vino.ino);