{"id":2229714,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229714/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260428160804.281745-14-sprasad@microsoft.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.1/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260428160804.281745-14-sprasad@microsoft.com>","date":"2026-04-28T16:07:59","name":"[v3,14/19] cifs: option to set unlimited number of cached dirs","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"021301991d8a9da154e4716779cc497ee017d143","submitter":{"id":79368,"url":"http://patchwork.ozlabs.org/api/1.1/people/79368/?format=json","name":"Shyam Prasad N","email":"nspmangalore@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260428160804.281745-14-sprasad@microsoft.com/mbox/","series":[{"id":501896,"url":"http://patchwork.ozlabs.org/api/1.1/series/501896/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=501896","date":"2026-04-28T16:07:57","name":"[v3,01/19] cifs: change_conf needs to be called for session setup","version":3,"mbox":"http://patchwork.ozlabs.org/series/501896/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229714/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229714/checks/","tags":{},"headers":{"Return-Path":"\n <linux-cifs+bounces-11251-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Yor6jWkc;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11251-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"Yor6jWkc\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.45","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4m1t29Qmz1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 02:22:58 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 1856F3078CA6\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 16:14:42 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D892C44A715;\n\tTue, 28 Apr 2026 16:08:34 +0000 (UTC)","from mail-pj1-f45.google.com (mail-pj1-f45.google.com\n [209.85.216.45])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 5815644CF25\n\tfor <linux-cifs@vger.kernel.org>; Tue, 28 Apr 2026 16:08:33 +0000 (UTC)","by mail-pj1-f45.google.com with SMTP id\n 98e67ed59e1d1-35da1af3e10so10762846a91.3\n        for <linux-cifs@vger.kernel.org>;\n Tue, 28 Apr 2026 09:08:33 -0700 (PDT)","from sprasad-dev1.corp.microsoft.com ([167.220.110.216])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b97ac7894csm30864465ad.50.2026.04.28.09.08.31\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 28 Apr 2026 09:08:31 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777392514; cv=none;\n b=U4/jQn1Rw5EalAPKnIag4u92qNAmABn05O2G1xqgcLnSPQjaudStQs5KhrdUrAQVvVcI4OoPCYy6JTQNMnpJ0NMvXYaSWAGwlzaX/btsJi7gUkBUB8gszJc4Sl1EAb/ucQHGXkUZT6h5WdFw00TfaIPgT24eYYr4+atRtoB7jHI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777392514; c=relaxed/simple;\n\tbh=2VOV5tqwf3NFwCRY4AHpMHJQv246kLMl9Cpe8yfdGyM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=mwGww7xKQDbgDVlKhBVvWMRQL6DVl/kbqHBJjHIooyyBqnHde34b/f1MnLumRV+fAk1ZGUdkcc3a9/IGO2fSE7x22MTUhTgfyBzGvblwOKnVttIbeWnXp5fuAkY7eGuF2Ie+VSW0Xs3dIuz3yjYynYx0YKjRNaVF2fLibLcyPaE=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=Yor6jWkc; arc=none smtp.client-ip=209.85.216.45","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777392512; x=1777997312;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=9o5H0O8dBnbcBaUn3Ic/j16+H1InseCGstPTG4iokWY=;\n        b=Yor6jWkcQUZ5D/VYMILdXxfsU3LmTvrPP5zL9lWkh0IOYh23cwf4137kqYvn3T8WL3\n         nsyRW+iM+wV9u+7w7rs/IluyhARPEUb8FhND8Uq+/dfFeGRVk7H04XYe5rsSJno/NZ/f\n         mlgAHttD876S4FjqWvcNN9+UuqxGLOYGQRVRbABGl748Q5q5gvWPEByUtQdHb6EvQZN0\n         kQkIYjiBwQs5Qfbx22RJaqeJApst6+HK49BDWaYu+MviW8b0mNuIvqSIGZ01/ObUM6nm\n         obhD8BUppnRyTxOW83LCCRe6K6EPZVD3f+d/sCI90MvFAJfV2QpU8X3aTu1UILu2fhFj\n         e1gA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777392512; x=1777997312;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=9o5H0O8dBnbcBaUn3Ic/j16+H1InseCGstPTG4iokWY=;\n        b=sMSieCDxCdCJDVnKL5NV6qhk5Xd5rNFmMEgmQf+rFCY379DkwE6q+oa4rW/1asgax5\n         KKQT4Fdn4hAtFFJxQNDIOkUHKivq655Mlklg9ahCteqECYc23uw52NC0arhPjJr2HHl4\n         ar9QZ6KUMyxZnF+H3qO6o041nzp8E34jOx73iqBpYhKUWFnRuxH8T1OHAMQYWU63TqDF\n         HXwzu8QPk/QaMy6p6drGBRlMoG5HkVAucWWbD45xngoRnKu/nbCs8/cVT35weiajq9PT\n         Fl2uL0DwLSNIsNTngPHU7EpglB0aOgFQmEtcW3/WnqMC0LRzW/8LHGMMtbZfvUvqUllV\n         lDSQ==","X-Gm-Message-State":"AOJu0YwhFZuZaZweEV3+ybYe50NhUVSD6YNYgXHMZEyVjz626ecL/Sef\n\t7/UO6Cb3/elpLMnd9NqwGMwmkxJKxwhQpl7FBOZRde0f32lFRv4vwuGX2X3RHgG8Nrk=","X-Gm-Gg":"AeBDieuWeTeMl2RmVSQKBH+LjdXZe2ab+0n1QDPg52hWV2W1KXtarWYqJ+7xy9bPea8\n\thCD+cNxUusDnHC7H6/Hdz5QcVFmpjecu6pQ+HKFjcpoXW0CHpe5/ITjLrTnvUu0EIdgYQMd8cqf\n\tojeerOOkSUa1zw+z9bAW36KYfdqIK+BzcMWjqZPEAZFuIZz9l1ojeUI1CVdpwavEFVyEnbfLIq/\n\tVngJyukBKeIEGJpbzp3wErV88+Drdf1NG6VoVG9uogzDAJ7LBZKCU/qYkgrP98uyWqwQkYmBCq7\n\tC3mWW5+SD+9owy5HseyWQAocsQFYr69XhykxULJgncaE+oucWUYFVcurrptT0Ra4Laxl6dNBsq7\n\tiDv5rKG3tNoczZs0P7d5ShkFLzVcmFY1F9M6Dfm3ErJ12kYYMwhtlQ3w9U6LStbvBsxmKKsNqIO\n\tKLInDjSWunZ+gq2YyF8bdI6CjXrTmzHiXBWsLABhBjpLB5tIaZ8T9Xosg0+A3FUktT5lhvMPgz3\n\tAo=","X-Received":"by 2002:a17:90b:3b4a:b0:35d:93ff:284f with SMTP id\n 98e67ed59e1d1-364920415a4mr3871540a91.15.1777392512012;\n        Tue, 28 Apr 2026 09:08:32 -0700 (PDT)","From":"nspmangalore@gmail.com","X-Google-Original-From":"sprasad@microsoft.com","To":"linux-cifs@vger.kernel.org,\n\tsmfrench@gmail.com,\n\tpc@manguebit.org,\n\tbharathsm@microsoft.com,\n\tdhowells@redhat.com,\n\thenrique.carvalho@suse.com,\n\tematsumiya@suse.de","Cc":"Shyam Prasad N <sprasad@microsoft.com>","Subject":"[PATCH v3 14/19] cifs: option to set unlimited number of cached dirs","Date":"Tue, 28 Apr 2026 21:37:59 +0530","Message-ID":"<20260428160804.281745-14-sprasad@microsoft.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260428160804.281745-1-sprasad@microsoft.com>","References":"<20260428160804.281745-1-sprasad@microsoft.com>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"From: Shyam Prasad N <sprasad@microsoft.com>\n\nToday we can control the number of cached dirs on the system using\nthe mount option max_cached_dirs. The default value is 16.\n\nThis change allows setting this option to a special value of 0,\nwhich means unlimited number of cached dirs. Shrinker can still\nevict the cached dirs.\n\nSigned-off-by: Shyam Prasad N <sprasad@microsoft.com>\n---\n fs/smb/client/cached_dir.c |  2 +-\n fs/smb/client/fs_context.c | 10 +++++-----\n 2 files changed, 6 insertions(+), 6 deletions(-)","diff":"diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c\nindex 7cfbe50db66f5..863b8d666ea95 100644\n--- a/fs/smb/client/cached_dir.c\n+++ b/fs/smb/client/cached_dir.c\n@@ -1256,7 +1256,7 @@ static struct cached_fid *find_or_create_cached_dir(struct cached_fids *cfids,\n \tif (lookup_only) {\n \t\treturn NULL;\n \t}\n-\tif (cfids->num_entries >= max_cached_dirs) {\n+\tif (max_cached_dirs && cfids->num_entries >= max_cached_dirs) {\n \t\treturn NULL;\n \t}\n \tcfid = init_cached_dir(path);\ndiff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c\nindex a46764c247107..3eff94df70d45 100644\n--- a/fs/smb/client/fs_context.c\n+++ b/fs/smb/client/fs_context.c\n@@ -1493,12 +1493,12 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,\n \t\tctx->max_channels = result.uint_32;\n \t\tbreak;\n \tcase Opt_max_cached_dirs:\n-\t\tif (result.uint_32 < 1) {\n-\t\t\tcifs_errorf(fc, \"%s: Invalid max_cached_dirs, needs to be 1 or more\\n\",\n-\t\t\t\t    __func__);\n-\t\t\tgoto cifs_parse_mount_err;\n+\t\tif (result.uint_32 > 0) {\n+\t\t\tctx->max_cached_dirs = result.uint_32;\n+\t\t} else {\n+\t\t\t/* 0 means unlimited */\n+\t\t\tctx->max_cached_dirs = 0;\n \t\t}\n-\t\tctx->max_cached_dirs = result.uint_32;\n \t\tbreak;\n \tcase Opt_handletimeout:\n \t\tctx->handle_timeout = result.uint_32;\n","prefixes":["v3","14/19"]}