From patchwork Tue Nov 19 02:27:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13879378 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 C25A713A24D for ; Tue, 19 Nov 2024 02:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983291; cv=none; b=uQi6XrbYL1V033eQg+hFvT9PwkfvM2omSSv+d6+IsNxufdBLaU5afeZCb5Xd2f9BeET4I19Lx+r7wdALVC5saeNQVABYz836ks99Podk3cn87PNsiQPMua8ODGrpxNQqItCq01YmEaqWhiJRWnudpza8vvis4t//QRLne//5H5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983291; c=relaxed/simple; bh=lFchxuWYdoChXXQRufyH2iiBvFGz6l9XBMUrcB9WM6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p3g7zRbCFBIgw/fjhKCTlcFDowRmsBC24n6m1vvKTLHKi2BsZEx9IkfBXsvrGLAwXTGOSOjWJRsMBnbqcwQxfXz1dwFoytHsgjb5+RXAbHRvtSiuhh5MD1yQXpVMiyjbONzxriTu2pf44lO0nRiyff428p/GhqhUQVKTG/MsuaI= 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=1i8Qj1aD; arc=none smtp.client-ip=209.85.222.174 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="1i8Qj1aD" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7b35b1ca0c2so467411385a.0 for ; Mon, 18 Nov 2024 18:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1731983288; x=1732588088; 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=1i8Qj1aDNF4uxJWABUlsRU+FF0C6L/RF1dPUlfAn7qIaGzW1QWQafGnWZAkCtMlbXg B+JiJ+azf9YEWyrVSjndIc8CVFgFuFuVMXxecjUSd/HpFLwtbtNGitbmdf8vYqJd6RXH CD2Kdt7Ss/oMqd8meI9zsYKLJpg5TUvFS38JY1A1YCmU2nnhnvKMOjH17Umf25B+NvqC Rh5VBnWxoEHtKcHqtkhp/VOR1I9JRZFBcBfjkrOTI8/KAOXGg5YP42ftmwrpX77EuqqT KiftiBlD3w8L3bKamDXtKo5GdLT3Pv0ZOgGB+Qj88pObGwH6Pug2zS+40RhwxVLAVv08 FKDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731983288; x=1732588088; 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=r4mMsVOjY/qVKDkw5pnyyuUmd8mbQsx7bQTJV/hcECjWIxz9ifs8XU52jyi3EDPVuu U8p/V//u7fIvBi7T2UUzreKnAoyDIjzDJh455QJsOCX+0fmJNVBT6n/rsyeZjpoGen9g 7k9cFBPCq7GQGEHtGreoDUpoCPhDyAHpWJ1gdnsym593VT+D/p6UNWqigSIDcLlEjn+x TDO2hD+URl6HBnXig3n7XZGsabepSddBVeLIpcxoErNrmkyo3+fzGEvo+EqbxcF917Vk 7nSDb4ZQaP/O5f5gBjNKeYsg606oBJPXh2Ni9/K7nQvouGY/5wXByns5Er5xpnOToSmw jlxA== X-Forwarded-Encrypted: i=1; AJvYcCXyd8EgJWkHyu0GUBdLzjiyrFUsLcnxQE4zlJviWpD/P8BkuqTvHFg32orq0wo+H6SpcVq269s9FIm4@vger.kernel.org X-Gm-Message-State: AOJu0YwiHWuoAVUixNugZiErHx65wM5MPaKkO5x2CUA365POTcIGTX/E CXXFAkMDqJ9hlHP0ao92eEcq1xoq/XJg8yTpvbBxDH1ykItKKvgnGLrBCyEi4A== X-Google-Smtp-Source: AGHT+IEg3a2lAF/vb390FhGCGjUrHn5uq6t+rXalinv1TCOWJl5FeBErqn5lQsxGjjhYGbT4Vi/OvA== X-Received: by 2002:a0c:f807:0:b0:6d4:1e3f:4367 with SMTP id 6a1803df08f44-6d42b8ff1d2mr25243446d6.16.1731983288645; Mon, 18 Nov 2024 18:28:08 -0800 (PST) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b37a8a9fdesm48293485a.124.2024.11.18.18.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 18:28:07 -0800 (PST) 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 v2 1/3] ceph: correct ceph_mds_cap_item field name Date: Mon, 18 Nov 2024 21:27:48 -0500 Message-ID: <20241119022752.1256662-2-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241119022752.1256662-1-batrick@batbytes.com> References: <20241119022752.1256662-1-batrick@batbytes.com> 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(-) 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 Tue Nov 19 02:27:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13879379 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 02EBA1459FD for ; Tue, 19 Nov 2024 02:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983293; cv=none; b=WuR7Y93DZgIAzucAOTkK5KLlZmMWNjlOVbbMbm0e7EdQ1CwjyzNs787jUuJykoRt+tiMC0JoWjN0TXex/3mxFU+Yb4C5NdUHFr9M0/A4XTVFqAGIKE1DRoobLfDgKqVTc+B3A6sCzWvEVj0JwVKyC5yx1bBFO8gRXX34jKIKm2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983293; c=relaxed/simple; bh=j5OqzA808wGEP+bKAmEuOLSp0ilqpAKOPXYB3RrPwFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uUHfqeuuPYo6INfniFoBvEauKHkDqTdtv39CwseJZSkzn3vPghttRTib3iADf3Ed7g1EppFRE5ZCDyqfec4qUNFcN1RLA7G7rIbTYYz57z9a53ALjlsDI9my4pgXZ0nwqlkSIyjUvVJw0h7GBnVqrNBavh1B65CVpdVHbEM18Sg= 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=b/IKcUX0; arc=none smtp.client-ip=209.85.222.182 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="b/IKcUX0" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7b15d7b7a32so27765685a.1 for ; Mon, 18 Nov 2024 18:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1731983291; x=1732588091; 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=LoKHGpIVEQElQT2i7Eoq44Yb2XIPlFWQJI91QoJIm0s=; b=b/IKcUX0tRAWD5TRB1/DNmfYSqO98lSamyIbrqnB0QiGTpJ8436ZoVPgEQhPGrkZ29 lKQFspam66NKrjknzL2sZniohNvFx1BSnODZJuZRPTtQoM8D5VvVLETr0vJ1vTLWBV7Q a98lspKvvWsmJk4B1nugxbi4toFRsCSJkiY20TUJ6GSwink85BAjeIvegLGEQxGG3ezH PL/+RWcnfmaxp0NumjDbwABKpBnR6h6dDNgJ15b8n1ihGQV2qOuSpcQQXcnWw8xdUJ9A wJkv/FGwIk+cz1j9+uFfRJnzYi0EFUMlGi+w6s6JroZjGhpVqHBTFsJAwNhPe9uebYS3 Jigw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731983291; x=1732588091; 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=LoKHGpIVEQElQT2i7Eoq44Yb2XIPlFWQJI91QoJIm0s=; b=c/C58wsMvV2In86ZyUsENnb/fnLn4joT7c1jMGwkTMcm1IbNneESaGQTMg6iZmMIED WNLPjOQM7BMK4ApArqh7dI7Nm4At8VLxgx3dFTMMGM3BuuwMi3guNwIyvv4Xo5pSaYKf 4qUJSu4CoDhjbxIL7wHpLKrk63UQEKMnwbkorDrcI0QNhUxwJlMKaPPn7YGqHDcOYrIM yQRhIjEmcPd36mBTqHErR1kclONnVRYplnco/6gDSRT9lcrCjkvOws6fbEviWfxU7Fqd RlWugYTKyihF2hNuoixosP3lj0LcBWHlt2a5DDN7OuUCpC3OzWH56K/UOlkAmHHJ63CT lFpQ== X-Forwarded-Encrypted: i=1; AJvYcCUX0RDtt+b6y7mZFb7mOqn0Eayho1DHqsKTL5Xog4fyk5wTHCxdD0qnd5jX6JtZsWidlliAOJYcHQJT@vger.kernel.org X-Gm-Message-State: AOJu0YxnKymcOG6JPoW1LawgcyXoCHsePYM/rHZhOzcRZfcV20yQsC3J /tnZLdnqjIvYRlc73Vg74v72eIfuEeDpkpSCT5AkKKEthQlOcH5uuQo+XpgCOQ== X-Google-Smtp-Source: AGHT+IH24L6W1WFxX10+OPV06uTEfQ35DE7BpeSJuTuXfhwSsQwDw7jOTD7+koW8z0c9fbohlEJ16w== X-Received: by 2002:a05:620a:1a18:b0:7ac:b3bf:c30b with SMTP id af79cd13be357-7b3622ce775mr2170267885a.32.1731983290965; Mon, 18 Nov 2024 18:28:10 -0800 (PST) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b37a8a9fdesm48293485a.124.2024.11.18.18.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 18:28:09 -0800 (PST) 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 v2 2/3] ceph: correct ceph_mds_cap_peer field name Date: Mon, 18 Nov 2024 21:27:49 -0500 Message-ID: <20241119022752.1256662-3-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241119022752.1256662-1-batrick@batbytes.com> References: <20241119022752.1256662-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 | 18 +++++++++--------- include/linux/ceph/ceph_fs.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index bed34fc11c91..27410bc9ce15 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)); 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 Tue Nov 19 02:27:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 13879380 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 A1C12146A71 for ; Tue, 19 Nov 2024 02:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983295; cv=none; b=alfU8qHWsxgCDbPUSiPItbquZd/FXpivtlAbbWRQQH0i/OE18QMZJY1b8ZM0zuauIxQGusC6B2+282C4Nww7Ca3YwzyNGw45cPZWNiDqSErV3mf5dgGpfaF/N1p0B7wy3qOE4GjUvHLGgVIbWecgIOVglyzu31Fps07C1YSntoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731983295; c=relaxed/simple; bh=UccQ+prik4fjQkC8oH/YJPmgnEYnbjg/FRuiAZaLDKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KcdbtSAtDjCTM48RDtALcbHj0Yjjbp8LGTdHLDTw0t66gX3BKuZJYi6KCqv0VUKY741bWXYrOb+fD5pinecYPsVXQkiVka72tQjcV3rcmZ/WuAktKzOvSjQsGQ8tiZBCdvM/wgiDKT5WmHPirEpA3jD9pK7vuvLyroGs28bauBs= 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=NzHdh1fd; arc=none smtp.client-ip=209.85.160.180 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="NzHdh1fd" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-462d8b29c14so2553401cf.1 for ; Mon, 18 Nov 2024 18:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1731983292; x=1732588092; 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=Hi9UHqDjN8Ni6rhq09eAG7OKaykNr6weeLf4m29aeTQ=; b=NzHdh1fdUPWgGcBCU2JOLeTc3LZkaARV1dJjT3KLJXHyNa4ArQ8MERYAxfY9+FfNB6 KE3BQthteZuV2mhcpkn/3qZ645kVFjALSR4AURxaeZoqngUssPvreD1Kao8IFbSSMHu/ t8Fm5sjr4sJVdNsYg4XhxYutwYbxYSuP064zqiyfVEINCTl4be4xlyR/QjVCk36RazyO bEVm1/AlOpUCCA0cEpaUvcdHhvZ04rGZ/CannL2aLmr4BRwTmAG+aAxIT/TjuF+qcC2C czKdkeUIwokIqs9Vte1fQfKtf4KM0EUqFT7ulLt1Pp2poP/JqTplH7tAkG0p6mXCt+Bl gqPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731983292; x=1732588092; 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=Hi9UHqDjN8Ni6rhq09eAG7OKaykNr6weeLf4m29aeTQ=; b=GcOnCDLY/GiBhCXo6m5RjFCVZDXJ1d7N3FDxaK6OWrwIVmSf2oncyCpu2EWkWODRXA 0tjW9fVggjfmDiftvC2Y8NtkA3gCBP16HDFViDijxmg2q7R6OvD+1t4mBXR9WSzjmSqc ckpigytFpc+gxhSPukIWIAyJhC1wKhUtZ5hMvMdyfiPjWQPhQPJViyRL1tdZFS1X+QNn /UKHgzSkp1mBl1UUhq3Rxa8v4sNHHs0li28WEPtltQLCOdxaaVwSynHX2NQfKVMc/eI9 OroI3Sezgie48xMoRNON4Rk20KCDJC2hY+nIe+GnNRr/h3tEpQjXRaNt17jU9UOEh8gg LFEg== X-Forwarded-Encrypted: i=1; AJvYcCUbPpbhA5jY+6bOnCsyqJi79kq7ahUCcmFJQrBZuwhSSY3dExeCvpZ3qN8kKvHlCWg/UcATObK0ymGV@vger.kernel.org X-Gm-Message-State: AOJu0YxEkdeATQjm4wZFA27AT+drGIwyayZoxALSLsCuTgxzScvmzPMJ yXuBHs9kAZ/tt56cEvzstDrzg2DU9rMz61pJowchpi+J3oUMK36NM66iktNHCw== X-Google-Smtp-Source: AGHT+IGWVd9s0tTOzkt/L9+H/nMMqNCNUSOHI3hwM03OUxXzbfjHm/cnEHga8/2MuOW51g+LHySeXg== X-Received: by 2002:a05:6214:2029:b0:6d4:f77:613c with SMTP id 6a1803df08f44-6d40f776480mr185856656d6.25.1731983292642; Mon, 18 Nov 2024 18:28:12 -0800 (PST) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b37a8a9fdesm48293485a.124.2024.11.18.18.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 18:28:12 -0800 (PST) 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 v2 3/3] ceph: improve caps debugging output Date: Mon, 18 Nov 2024 21:27:50 -0500 Message-ID: <20241119022752.1256662-4-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241119022752.1256662-1-batrick@batbytes.com> References: <20241119022752.1256662-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 | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 27410bc9ce15..810abf6f7d2c 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)); } @@ -4350,7 +4351,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; @@ -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; @@ -4375,6 +4374,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); @@ -4462,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);