From patchwork Fri Aug 23 20:08:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13775939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 195B7C531DC for ; Fri, 23 Aug 2024 20:09:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A6E9C6B03A6; Fri, 23 Aug 2024 16:09:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A1E546B03A7; Fri, 23 Aug 2024 16:09:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E6F56B03A8; Fri, 23 Aug 2024 16:09:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6F09A6B03A6 for ; Fri, 23 Aug 2024 16:09:35 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 20323400FF for ; Fri, 23 Aug 2024 20:09:35 +0000 (UTC) X-FDA: 82484600310.16.DB8E9B3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 72F628001F for ; Fri, 23 Aug 2024 20:09:33 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e6AEJq46; spf=pass (imf02.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724443690; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FAmCIU0bJDpl8o1iuVK4ffMXJRGL1l5OGSxq2KqoTWQ=; b=S0rQhIAlH166d0dZuGqySL032VkjERl5Zm0LRQCgRYwA/yMea7m1r8Ur34f+VBVy6N2vGd 2o0RK++RBReLmfOo51OMDANPRlaXeNk3lIpoQIQvOpH1h/PgUjyEgb3TY0FxS9OcosXsFd aMIVBDB7UXuLubxPXD5HJqCKpx3DRjY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724443690; a=rsa-sha256; cv=none; b=jWxXd1KrDHoST95ewhlrMblvVh9rPqB48HfvXzEGS9at6pny49nVQuou7Y3CqiQrHaHWJG dmRmXNaBnlOm8G49BlI4WcWkUIewRMH4FkBXq+qpjTvbieEByubW1RdTmOIl1N78e5VyVR 365Ro0iWOSXNx9gysBK2XIUsJgHt6LY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e6AEJq46; spf=pass (imf02.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724443772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FAmCIU0bJDpl8o1iuVK4ffMXJRGL1l5OGSxq2KqoTWQ=; b=e6AEJq46BsP4iTfwepakJaujeLZPPi1MbEtv+VxXkZ1JMoy2hnpCje6jZjasvnYyw0LI1K hLEsYj3Cw9TRmWSHp82/8bNk5NpApQ1CfbnDdZeCFKEk39nB3Pe6czriEo0E8FEAOzWo4m FITHfTaQiGSyT72yNPQW8FMcSEJ0Flc= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-154-Dvwmp2x-PPyrCItiYsUPfQ-1; Fri, 23 Aug 2024 16:09:29 -0400 X-MC-Unique: Dvwmp2x-PPyrCItiYsUPfQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5AD3B19560B7; Fri, 23 Aug 2024 20:09:27 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EDBE11956053; Fri, 23 Aug 2024 20:09:17 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French Cc: David Howells , Pankaj Raghav , Paulo Alcantara , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] netfs, cifs: Improve some debugging bits Date: Fri, 23 Aug 2024 21:08:17 +0100 Message-ID: <20240823200819.532106-10-dhowells@redhat.com> In-Reply-To: <20240823200819.532106-1-dhowells@redhat.com> References: <20240823200819.532106-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Stat-Signature: gbp85ph9nak1jbk3dw1kqydq9rqcf4qs X-Rspamd-Queue-Id: 72F628001F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724443773-397595 X-HE-Meta: U2FsdGVkX18NEn8CB0e3jBl0HLKr655U2l8eGT/+NMYwjrZBoReII65fa8Q6FwMaNytxoCxt8joaTekKaV9PjA0J+bHcBte3WPfUrZqyg6ntwHAp6azrjHFQXNjV9fW13gcekENxMjz9NG/OyfdL3NGxfWb2nqx7NNF3njfFT3Xd9HHeJX/jyfOv5nMSJ5TIHTARl+dTaxDsyPg55K4aOvrE+Iqu6v6kOyvZC6hMMQkuSQVtkB5r/zlZY828cPYUJxikskAMY05pgmAIfVzE+/CNuRE7uG1CDVUnUB2fIGkmy68i8ILklK9/+sPdLWJad0qIMoZ0TGo5m6OcHCYkhhIQXuWfcjKFzHANO2fURvL6lkBCUcasv30WbxikcISs+YMsTQDl2LFNP2Dw6UMEpZi0l3+kWMaNi1eKsGpT8l42V9tETPINvEcTlMoSOLL6VpAJyGmZkrP1etpcMicZ56tl9YM/jOX1WqdLl9YI9zsEd0ozxi3OlExgoXRafV5mLyoBrZaRc2NdEiipE8mkrN5NEnfJbdqC30TSfhzNc8jnOcfJD9D0FjUwncFZIoetvJ20Sxe0a5a15k6u/JmLOhR0J8NHbqbnJsykQsb5mmbCl2UnCxtJ3uFzGwdnV4vngcauiTKgJBZhxSHpbxlUZSXoG4J1Upv02RXzDQGHEhh9CdRoeqVTFLGH6IGsvS9TOCbYtRB/E5UcfXqlPj3t/B1Brp2zsz/5lp85evVOL/WIRg+UbF9PjG4ygvk7+kqt4nKzJ6/ZuZq0TUN7QhWaMRp5I13SF0pp/S8r38sLd7oA6KIamMPD+xs2Iv8fKtqzx52npGioyrC+UGUpyNRD6sHOUHqvysBnXzo+2e4LB7kl2X6PuW9FqCrY27JeQAY9gxU4XEPcfRlRPydK1KebovzrmxXCRPdU+tdrxtNC1IV+2OCt/q0MkzUgIVeNTm3wP5kowwB3cjlc2nXzcnB fCUdbroP 125yz1x8+LDK9lDHiSYmx0tBuxpPpo7pkpPd3quHWzQsN+I7CQatWfcjXDiZ7waMz/l1NQ0W5+y/99rOpFyw6H4UCE2BRspPrl5b/rsYMVqmVQxHv1+G0q+HCe5XpocFl9X52Ge7FPe7V37osaQtJZLgbK6ylSLIgp42uNcAhJtt2d2Mz7kmd/Z0CEK547C1MGpBWS2CfmT0ERVu+ckYL+NTT0VtxdrdRRhfzXLabWTsvD53h7CLM63Rx6xKJZDagJ8adlaqs8d35pVaqprisgraTc0+zMt5I1z0/RTl7t+5ycD5yUKWnlE3gem759epzkXpwrqvl4h6YZ1Dk9c04LE3NKeKMy6Ormkr1ExpFCK3qSrc1Dop8pox8j3iS97B7KKUIUcwThxC5sxyj+GU4vSSBU9/cZJtBKdHfDv83DXPVy26fXLyQ9RPlbKPUlqF9+io4PuywGz6R6Fa2gcUbl4bj+tqOdQ0M4Sn1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Improve some debugging bits: (1) The netfslib _debug() macro doesn't need a newline in its format string. (2) Display the request debug ID and subrequest index in messages emitted in smb2_adjust_credits() to make it easier to reference in traces. Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/io.c | 2 +- fs/smb/client/smb2ops.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 943128507af5..d6ada4eba744 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -270,7 +270,7 @@ static void netfs_reset_subreq_iter(struct netfs_io_request *rreq, if (count == remaining) return; - _debug("R=%08x[%u] ITER RESUB-MISMATCH %zx != %zx-%zx-%llx %x\n", + _debug("R=%08x[%u] ITER RESUB-MISMATCH %zx != %zx-%zx-%llx %x", rreq->debug_id, subreq->debug_index, iov_iter_count(&subreq->io_iter), subreq->transferred, subreq->len, rreq->i_size, diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 8fb68c47c218..2741f7d63fe7 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -316,7 +316,8 @@ smb2_adjust_credits(struct TCP_Server_Info *server, cifs_trace_rw_credits_no_adjust_up); trace_smb3_too_many_credits(server->CurrentMid, server->conn_id, server->hostname, 0, credits->value - new_val, 0); - cifs_server_dbg(VFS, "request has less credits (%d) than required (%d)", + cifs_server_dbg(VFS, "R=%x[%x] request has less credits (%d) than required (%d)", + subreq->rreq->debug_id, subreq->subreq.debug_index, credits->value, new_val); return -EOPNOTSUPP; @@ -338,8 +339,9 @@ smb2_adjust_credits(struct TCP_Server_Info *server, trace_smb3_reconnect_detected(server->CurrentMid, server->conn_id, server->hostname, scredits, credits->value - new_val, in_flight); - cifs_server_dbg(VFS, "trying to return %d credits to old session\n", - credits->value - new_val); + cifs_server_dbg(VFS, "R=%x[%x] trying to return %d credits to old session\n", + subreq->rreq->debug_id, subreq->subreq.debug_index, + credits->value - new_val); return -EAGAIN; }