From patchwork Tue Oct 22 14:48:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Donnelly X-Patchwork-Id: 837573 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 CC13B1A304A for ; Tue, 22 Oct 2024 14:49:20 +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=1729608563; cv=none; b=LkE3RBg0YriQiOX0Fln1OhrkaLVFoEoAqdh0Xf+XyXTsWys0JrVgWmJZOFbhQe02cO2ISBfStkNAxUhCudhn3oF/mURjQYFkWMN044c2gObn42EjbrqRMhfBMR2p94pYRQu+U1VzwOm66tYIy3/bwdtnT3O/7mzVSLpvK9po+sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729608563; c=relaxed/simple; bh=4OEr5DlA2GJoYYQduLmLnz2yUHPnnHV7+HNBrHK40y8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LN/9PQDc+Jn+8etbYZ3CrRuC0rR9lzXpyLBixhUoOPBD9FOj1KLkOLSbm+Cd8X+eUEZHMdxHcOfNGZ8uh+batOSOPVb0qYG3eycGvISUVtwn3Ht888iMbw5lq9C2ZLqjt+xAWOQ5COMUiwCfWcRl1fhdL0/+xLfib6/jfSDSxKM= 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.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="t7FFmX+K" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6cbcc2bd7fcso32269686d6.1 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=HrkyxQfrhVRcH9QgfeZgsWZtarBCTRSsB7iTdK3WCM3G8TsY0KLdhJjIjjitkJD1UU VFf2341B6S73kTXRfoYwsfh5Udi3bXVe1v7tNHN+PEmAcvuXITbLetFY1+0ylerS9bcb BZrGwqso0tCkEBvo5LkN2+vbKpCYavvWevY+IqyxzUb1yLtIaRNxwOEsmr93DgFtIacc gYR2Wp22tT4+MhuyEpqWMECOEe1tumpb5vC0J9BjhSoHOm7V4zYBMcH0rVrWQ/GFKbUs FtvpT9FJG2izsI6U2T8XxxmwBBzGqJ2YTMKts9CWMGnWUlAxxtm+o/91qaQpDF3XwHrz 7K6w== X-Forwarded-Encrypted: i=1; AJvYcCUzAlex2QvW/XpXqndX6tvsk6hdJOz2XFc4FJoXxkUJYmhzh0qRVNAs2MFMPyhPyct8p5gwBqQgaFWc@vger.kernel.org X-Gm-Message-State: AOJu0YzjdmfsklMQs1AQKnJIwXYc9nXZDLwhxX7rK5wr0krYUFuE2xMm qM8YlW4kURIj/L1pPLjV2eJ06b1x9s3eRbI2DTBbU/L1mLjCnsE4aDqgQB/uyQ== 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: 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);