From patchwork Sun Oct 13 01:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 835116 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 8F21617C9 for ; Sun, 13 Oct 2024 01:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782211; cv=none; b=mCFaYRQ1J2YEdnPoXb59WZNott+DDopcWkTa0ZlbmlrxCjGiygxN53eggF1WVpGNB1iGb6ioa7djh+WQ40O2bO0BNjeUNvk9vAj5u/abRKqrjypSeDS0sUgUyKjUTVadchj0KisQuux4mpSbtmEN0BkkeWvFxUKrZrlAPrRuj0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782211; c=relaxed/simple; bh=Rs0WhVYlqwQ9GIF9wqpRbWP2+E5Qn796AkiW/OgXwcI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mwaQXJ1+8Zz3CX+dpnpoo5cYF6Qh4fa64IbM9IFBRzpKdW1yzq3JCgkUYBN6dnSnVgYJrkWgjytDZ4KVNDK4oug2Q04sFLxgMeuQUfkf4iRtntPyV6LkGGHe/7VpFNbue84zD8TViq3E2PptTQYtR9I8xqx847u584XZYZLJYaQ= 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=lXSXnZ2o; arc=none smtp.client-ip=209.85.222.171 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="lXSXnZ2o" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7b11692cbcfso220532185a.0 for ; Sat, 12 Oct 2024 18:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728782208; x=1729387008; 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=lXSXnZ2oS7w0xrt7652xlz9ebLAnqDITGQe1ymKSSx6HzDMyuITsS6HMdMaHEYoHGr usDy6s0nC+LRzSOogPKpn3/aCFRBeFdOjUCtBE3k75JPRpnnowoGWjrRhk5QeTKsOFna cUrLeGFrcQ5Ud3weqtZn8ZGAoiWC4CewJvyGyYCp3IiVRxvhFsA4CCO/am5oko+K/b1C YI8+PS/0nScNip2+Oj7bC/nCl58fGrD/GTTZVu5vpwvQnbpjdcM8K8W/bIrr5AhPGsZX HzGhAqvjKnTQuKsUxNdbrNBd7MLU6nnvgS9wPeVyKa8eS9IzVwixGBIPSyyCFb/aeqRE r9BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728782208; x=1729387008; 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=MQ/EkVIF+OD1C++Msb6Ly7bPs4TNH2Ji9XeTNsxoTWKcp6X4fnjiC7dDCoAItETiD1 FxBzlHgf6rMKYo9d2W1IwYon6oUydZZOQBtZop8y2Y3gz1CSdnCLy7ZlxFYpiKNgZwJn BUkkFhdHP02y4lK3l9sgm6jLPCPxwnqDsmDT5ITJiq8w0/JlWChCyW2+zV78i7LYgZGL lz/v3q/L7rxiSbeJlRuVpbgkmTMeGG3hFWcVnOJ0t3iqw/AVXfOdZJm0yy8vnIgQHaln zoCwfe7oTroOQ82oVWwQL6JKxownuPfIWQ2+Oght3nL0N2e2SZSBQvLRl6EaUKpsY5m7 erZg== X-Forwarded-Encrypted: i=1; AJvYcCUV7y5I9KDDkD2arGrltIoczZHHquZEqKwE4+PJOtvM2yK4VlsRQCHRtVI5SIcoI1saSghTeZNZULEk@vger.kernel.org X-Gm-Message-State: AOJu0YyrOkljR/t+u1TMrGopw/0ME0xth9ITnOpe/K4lJE6mfthN3Wgj PHbV48wCWc5OhSRi58MClheU/1Q5dO12mufZKz5vlYzTjjcs0It/8aXzXRMhxw== X-Google-Smtp-Source: AGHT+IGTmQ1sCNGvxvKC+B7rM8+rg2NN9YCFVlNQ5vOIyaUhlkwDzZptdz/WbPjvm/E9Ssohsb2QKQ== X-Received: by 2002:a05:620a:2950:b0:7a9:db7d:11f5 with SMTP id af79cd13be357-7b11a36f4d9mr1209601585a.25.1728782208407; Sat, 12 Oct 2024 18:16:48 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b11497704dsm273414185a.101.2024.10.12.18.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 18:16:47 -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 21:16:36 -0400 Message-ID: <20241013011642.555987-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 Sun Oct 13 01:16:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 835115 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 2C3B7DDA1 for ; Sun, 13 Oct 2024 01:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782214; cv=none; b=imN1bYxuDhIySpVOSn1lCxmQXy2WkAWkFEFljCeIUIKUKgYrTxJvZz8vuBig7wKb1zhi4JG3fa7jWn4/y8I+ux4PBUgSMV4qN2dYMeq3hnzrQvCLfiWSf5Zzt5KkMEYP6Aw3puE6a413SI4f2UDlPJjyeyVGBQW5hRjgjIqyzx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782214; c=relaxed/simple; bh=B4/JBdGM31QVKWtGy9/jYiS1rDqbLwKvIygE6O9yYRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NMz3ezTg7fh9mFN957mICvGKUirBUkx5Ag0V0/pXYyNbMuKPDOQGw16Z742wJAlfYgva3MzSvNHZLTTl4pNTWZFnPNOlW1jauZfBvtlWZpb4zaWRQEPne5EmcOvGleurfqWSmj5jwnAc/bTPpI8QdxdnOJS1zHnA51JBoU9ggB0= 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=X0K+zrKf; arc=none smtp.client-ip=209.85.222.171 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="X0K+zrKf" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7a9c3a4e809so255568085a.2 for ; Sat, 12 Oct 2024 18:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728782212; x=1729387012; 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=X0K+zrKfXGi1TlKJuF2Amy1NExFrSdeWEgHwpwqC4vSdbIDSgeplEtLIQOxLMA625p YruaZ/vqO5H6f369aIyfxVeN1zTFPb2U+gYJJgZ40ntdvvF0TlY6q1doQTy40ag08MYn S5/NijBeTR3Y7HLMssRC5/kpvw1JL4QF0PJRx75awhg8BAH69xeHHuPc4FWQuwiB0PRk p+H6utGmJqMXMnvLYrp4lSixJVCyouMUq3CIlgXLauVRG/ubfCTo2jYd1WOa2puatULM hy4CBIJq31YkJBJ/vcp5q/JoBZ/YP1xMJoDPiSTqcdlNVcZ3I8na77uOg169YD3xYGdc k1Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728782212; x=1729387012; 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=WqdrJU0P5SGUFwbx+vUwmtms/8xhLwXqghmqELEOoeXd7kGwPghkyBkg5j5TEwUWUy 4/iVn5//aMH/NvyQhF+ylLizJ3xmuPlm0D6/sO0kh6aqw8ToWuwE2brj+v2CHlGE1let mPw/ajazlmsybJAIzY5r6pO7iTBriVjQE2L1FZxTb1poY5ePcGEbwhqd4KtyUONuDmaQ 0wqjbuiUYt5zaK/D5JlbHG8K3W4gw8omFwhFyj8FdPDigYsFHGjA3qTfSrDdcontOxoc CTOXJ2B+txxLkVFb/EgO+QXcEjwQ8+JKhxxlrQZj9ffKg60bcRKu3ESVvOVxocIlPQtL y0vw== X-Forwarded-Encrypted: i=1; AJvYcCV5U8C8jNSchb6unsq+zLQowjk86cgvQwiMZ9yg9i4aRjbItzJdf8NaDQq4xlWc50gal5L+ateiykxM@vger.kernel.org X-Gm-Message-State: AOJu0YyTlwMckoA987ilQbC6ZMyG63zggqdElIpJXdhoAP1E44y73xV4 baSEOpCXVHITd9iEn2xzW01jyEhy/cS9SARXeeJQBQ96xYluHsyl4dUI15c5Kg== X-Google-Smtp-Source: AGHT+IFJEb+9QlegsG9tlU60TN/xXY4vaGD3+cebeFjdCh6B+MYUYbiA8cyUAOY4hpAseLavrfwDww== X-Received: by 2002:a05:620a:46a8:b0:7a9:a7aa:4bb8 with SMTP id af79cd13be357-7b12101b4fdmr803680985a.55.1728782212065; Sat, 12 Oct 2024 18:16:52 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b11497704dsm273414185a.101.2024.10.12.18.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 18:16:51 -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 21:16:38 -0400 Message-ID: <20241013011642.555987-3-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241013011642.555987-1-batrick@batbytes.com> References: <20241013011642.555987-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 Sun Oct 13 01:16:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 835114 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 65C5B1BC2F for ; Sun, 13 Oct 2024 01:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782218; cv=none; b=nGzm7WKqfME7/CJIjfMpaxfr1/NTcBWOYzp/XOanOoEcUOtISOxQ+992OIRkudJ7e16B9I36JAkWKrQx9ZdVlow26rQdEGMBFSWQsbh44bvMtlCwjNKV4qtIP/pDabiixmRKYCkyGwiAT5gfcBHHRbHY7L0FpVGORUm1SJSje6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728782218; c=relaxed/simple; bh=4OEr5DlA2GJoYYQduLmLnz2yUHPnnHV7+HNBrHK40y8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZWemkHo6wRPQ8gkfqukE4fB8E0ZbPR7n55Fi8rrZIM03CRrNHHg0xww/0F0FcGfgFtqrOG1o0jfugb6LSQDi60Yo60SqwMBPDs1tOv3IFZP4MA6ga3irJla4OO7V44FGmPih0xwjIf7uWKlBdOcpbLoXEwfkLqTmDNIXR5RglIY= 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=g6qGtfNg; arc=none smtp.client-ip=209.85.160.177 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="g6qGtfNg" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-46042895816so38726811cf.0 for ; Sat, 12 Oct 2024 18:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728782216; x=1729387016; 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=g6qGtfNg2h30KOtWd51z0o+unIz7SjRbY9xp/akVt01wu97vD6V4m8YKi96mZ1+lOr lJDrrZeCY1zKeLgn1oxTJtKH5cS5Rk57mZa7xcRcYLd5bjCoM8G1z7Dh/mPsVS5EvFtq xlLdYgFI/S+sacQbvDDpgOkRw/ouOxKS6ReWjxa16efQyH9SfyVVK3RkT7BtAaueEHGq hGfDMRT7r+OO9TbSj5G43reqoIuPTjT+nkuamPZqj0RdvObWLdKDNQysfXC+5R5vwfq3 1kG1a47N123ra84GcpK/YdT6hisP+bLJ+U2qSrjzAQBowYzWb1uWzYZspSGDcjLt/5RR a+5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728782216; x=1729387016; 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=Iwkja4XRx75JFArOp2bjdMSb0+sHIbvcBsnERaejMkjWyZr0aUXeF9nvfwAn+fHxJN 3mO4dvkGKfeXBjnfg+4v1jHV6f/JeLQmUutf8o7OaNGMj1AVba4H5b8DCLrtOAwXgPo7 Em4W8wGPYlnJ07ldREQpnGBfsGYFmArLOuvkE1hBX2FgYmD6q1dyqAc8XZgSMllqRsqr jQ/q6w3CRajHFGpmDN9knbfGXfFtvS+ETLjeIf3oF/c3rN8HgTUMAHAeMJ1E5T45PxiI t/gHGhPmcCg+aUcSIi4fb6OCf0jKzUmls+tbXUIkosnCMLMgsrkxcXBc7uzM9jtT3xIn cmpQ== X-Forwarded-Encrypted: i=1; AJvYcCXQQ99a40W6A/hiMsgCPDUKRtFDEM2kCpGfd7YD2NAi52xf6NXUGoCsrzCeL9W4pIIMZvjCu3xxdQGW@vger.kernel.org X-Gm-Message-State: AOJu0YyzH9ylejjtMp/wuk3YlbvkixJnQ8YuPXk4oakHcKLl722rj/p9 QBmsLRk6ZIq6roN9ljWZBgBQjK6RjohGR9uTmAYPP/4crOcDff4C6P80rD2DsA== X-Google-Smtp-Source: AGHT+IHn4LCLgxo14mU0Up+yvCPuFH04RlZj1o65iOO7Ykv1NsrbROwX+W4sfFnTSPqmfXiG303lWQ== X-Received: by 2002:a05:622a:d2:b0:458:34df:1e5c with SMTP id d75a77b69052e-460583e8b4amr84213601cf.12.1728782216149; Sat, 12 Oct 2024 18:16:56 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b11497704dsm273414185a.101.2024.10.12.18.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 18:16:55 -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 21:16:40 -0400 Message-ID: <20241013011642.555987-5-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241013011642.555987-1-batrick@batbytes.com> References: <20241013011642.555987-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);