From patchwork Fri Aug 11 02:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13350029 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63D79C001B0 for ; Fri, 11 Aug 2023 02:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjHKC4N (ORCPT ); Thu, 10 Aug 2023 22:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjHKC4M (ORCPT ); Thu, 10 Aug 2023 22:56:12 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86032D60; Thu, 10 Aug 2023 19:56:11 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b9f0b7af65so23579531fa.1; Thu, 10 Aug 2023 19:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691722570; x=1692327370; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=LgNyfiqMR8MSjMTyVJ2fWh3nxzqMezQIw1Nb6XC5XxQ=; b=OI9gHZ5O9PdIJr9euYd5uuAtF0FtS1uXyqHx4dZXhFykRTIb1mo76GjhVlVTcW3UgA 9yxB8luzywDd7mOQ7wRnPiaoD3kUmglMMz3VyIykcHKrHzBTMbiQ7HBEaf12PvrTKJ8R I1hXaRYlGwEZzch+uXsmi4A2UNWEnIDq8dJO09I4YynqDtwN8xF0ruMcMo3WQigPu9QB QzhUbF4VuOXixLDspEnF+HwKhftsjQbgqp1MuBt7HP66IA5wO6TIr8u4OCvCx0XqNoNu rgVKJvS9OpP5EODin0Ws4+Blgo/TjKUofmaxdlfE7HfZwZGViw7IaenDKN7NlXuK4Fcs e/4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691722570; x=1692327370; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LgNyfiqMR8MSjMTyVJ2fWh3nxzqMezQIw1Nb6XC5XxQ=; b=E7iY5AgJrNFOKw0CQ+FKzChUujx7Bm3fSzMWgTQOGakszgMolYtE2u7paj+szLf8ql nKFAP05fE0VhJhw3XkFfvDt8ohLYeQtox4x/yLyDA1KdMz4TGrEz8aGL0f3PnqQc/xAj fkPw9e3p+bhGH6MC0ffFS87lYmuZkukWoAmp7DSK9hX8w6ysgQpNDxxcD+bWGpLoi3q7 Xu04Z9Lkt2SQRNExMmdta6xBZ6SC/a8VbVxD/fdHJ/PFt6wtN9NeRggP7tq4MRZXt0ul llAVWFnJWQRNRehQKF3Uhs//lGSG5wlkIeZ8zbp51jyDg8NhHIWwuQKXGzU9Z4YgcRil ZvOQ== X-Gm-Message-State: AOJu0YzDB2Z6qWWt3+XgLJxcd/abZRxXJikQG5MQma0S75nbu/KRbcvf +llyb39yTQaGOrwuRGTHv8jKkMJ0b+wN+93NfTw3S0+He1irEQ== X-Google-Smtp-Source: AGHT+IFtm/b41SnZd2MkRipNs43n/4c27YfQuT26DpS3yH4CuiuP9Mjf7GYuhQFfS44sIi1s0Fq7iYKUZa50GinlesY= X-Received: by 2002:a2e:a287:0:b0:2b6:e7ff:4b2e with SMTP id k7-20020a2ea287000000b002b6e7ff4b2emr590843lja.33.1691722569407; Thu, 10 Aug 2023 19:56:09 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Thu, 10 Aug 2023 21:55:57 -0500 Message-ID: Subject: [PATCH][SMB3] display network namespace in debug information To: CIFS Cc: linux-fsdevel Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We recently had problems where a network namespace was deleted causing problems for reconnect. To help deal with problems like this it is useful to dump the network namespace to debug what happened. Add this to information displayed in /proc/fs/cifs/DebugData for the server (and channels if mounted if multichannel). For example: Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0 Net namespace: 4026531840 This can be easily compared with what is displayed for the processes on the system. For example /proc/1/ns/net in this case showed and we can see that the namespace is still valid. 'net:[4026531840]' Signed-off-by: Steve French static inline const char *smb_speed_to_str(size_t bps) @@ -430,10 +435,15 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) server->reconnect_instance, server->srv_count, server->sec_mode, in_flight(server)); +#ifdef CONFIG_NET_NS + if (server->net) + seq_printf(m, " Net namespace: %u ", server->net->ns.inum); +#endif /* NET_NS */ seq_printf(m, "\nIn Send: %d In MaxReq Wait: %d", atomic_read(&server->in_send), atomic_read(&server->num_waiters)); + if (server->leaf_fullpath) { seq_printf(m, "\nDFS leaf full path: %s", server->leaf_fullpath); --- Thanks, Steve diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index fb4162a52844..aec6e9137474 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -153,6 +153,11 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) in_flight(server), atomic_read(&server->in_send), atomic_read(&server->num_waiters)); +#ifdef CONFIG_NET_NS + if (server->net) + seq_printf(m, " Net namespace: %u ", server->net->ns.inum); +#endif /* NET_NS */ + }