From patchwork Sat Nov 23 01:14:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique Carvalho X-Patchwork-Id: 13883732 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 906BB154BEE for ; Sat, 23 Nov 2024 01:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324536; cv=none; b=gCXeCcYVKFaQ0qmH1t5KazNZ9qij5DdPe53WitP9rEzLiYf9ekqSA7uzGuuUyMlG+NvqqB2B4uGUJjr9NvdLIzBNz20iIGXn9SPqwMedxuD6O0BZ+aZnfxf6DmEBo3212WLeu63/R+3PF4tGY93N12YkZY/bPay5xbC/qfojRW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324536; c=relaxed/simple; bh=HPgrpK/tlEaYLDaYDgs5sN7h9Md3m6ZXUSrLb+doXvg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F7jlgSACnnr6eG/1/v27eROajnyuxu7HRg5H/4W3b5vixDtERXPIMH8qPY8m8q+VRm2MJcDIIkhmzW2Kb4cTS3dofBAI7m0p4BlAoqz3AotwCJnGpt+1QYnnoUWtDdnuZwLnNdJebGQmjSCkW7w8JEZM++y79mD7mY4DwaE4j5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=aOszUXpy; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="aOszUXpy" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-382411ea5eeso1567890f8f.0 for ; Fri, 22 Nov 2024 17:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1732324532; x=1732929332; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Uxebx9p93hw+pnwK9rW+njV3dr2vF90svG/VIvLtRTs=; b=aOszUXpyMPAhDgQAEE8ZMGmgQIbw1OGPfd0YerG0M8IzV2aksFkS1Nr2COKrR+SDeU e6ePqTHmRKiVx8finw7isgQJP8gLAfwAdfyB15Qa30UpsqslbnZLLTRRZx794sfdxqc2 fpnxpl5xogYGgRtJ3Dk2H9xkvIorJ+LX6ouGMzPAVfKeRNY054Z2acqyLcKXCJRcA8uS dk9kTnSMNiV/YpUBrZ/sOPYuOglqGwJGwv1QKR1RE+/LtLjyfKOAzEmLy2QF/O2Jb2ze mghxeJOORCu5f/m3E60XBYz68fuj7Pss86944MJqPFQZRcq3RDR34n9sMfmgFnGt4n3t nv/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732324532; x=1732929332; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Uxebx9p93hw+pnwK9rW+njV3dr2vF90svG/VIvLtRTs=; b=aEePbDPZJlS2JLsELPLNG+VQuyCWpPdbYqKsyy2D0W8b5Pdi/+V7EFcw+Ii5FfkVEB r8NEdWCVmpCk5zLpRbLfMQv/QmLKNlnTadUWDDLdNNrI9uWRu2pRaTivWjv4mjpq7z3j J1N/IJYb5SJRLykQAWVPgwS4RyVnzEEvk760sBlE9K70/Xy8lBQ4KTSt5z+EVXSxPURb WYNulsY/USXS5zktYF0pbEjSgVGy88/QDbco+fHEhpDylhTpJ/+P+9RC3sb2fE06SHzO tsuKqXt+AYZXwtaPB5nbmzHcTHUzHvTpJ+tAe7B3JlS2pryktHB5ADfnT96P0hTf9qSS 4UhA== X-Forwarded-Encrypted: i=1; AJvYcCUqIMGxO2X6IL+6hQnkS+b2fBt6FQo2pF25DIHxkmbTC2aQbrnwGhv7QTTJZkDln8r1UO7H4eB4p1CK@vger.kernel.org X-Gm-Message-State: AOJu0YzNB6p2lhh4OUkKdV8q09xYfJJNkL/DiCIGkyOsEcsZz+0KXyTW Te3nOtGidDkis+hCPb85LbGMVICMRocVvvRFW4MBZFQMYEvAKNsOIu30UEMtm9Q= X-Gm-Gg: ASbGncsCU/2FVBVmBAiRQoK9LsnuVv+NoZykDsY5v+XDhbHQ23XOsaj7A8EeDgErf/3 wffW8cDYYq4eps6q54/EG9Iswwfhg0e1nk71A7OGkA8tMzgWHxWFI4URBbKHLxSoXKdsNWcD3WV oCEub0vt4o4x/CTskV7N7tZKVUKrc3nRnpUweX+CTPqsu+LWBU36avh8tkln62Vv/vAs0hUXAST K3HmkhT8wNIsUMKo4GFQOdH4XxR1qqALVMY0QO/1M/to2vCwbpQlZxoFPVDq2J9XL4xyA== X-Google-Smtp-Source: AGHT+IF3s8Mz/D/2xIAhC/CBpXNM3r1h5Ra3mLbPEansa+Y19QqhFZPSdNmAo5H9LWuFwgNunvNGrw== X-Received: by 2002:a5d:64af:0:b0:382:47d0:64b9 with SMTP id ffacd0b85a97d-38259cb7f85mr7326863f8f.3.1732324531846; Fri, 22 Nov 2024 17:15:31 -0800 (PST) Received: from localhost.localdomain ([2800:810:5e9:f3c:e019:b39:5a90:cfe]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2eaca70371dsm4043040a91.1.2024.11.22.17.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 17:15:31 -0800 (PST) From: Henrique Carvalho To: sfrench@samba.org Cc: ematsumiya@suse.de, pc@manguebit.com, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, linux-cifs@vger.kernel.org, Henrique Carvalho Subject: [PATCH v2 1/3] smb: client: disable directory caching when dir_cache_timeout is zero Date: Fri, 22 Nov 2024 22:14:35 -0300 Message-ID: <20241123011437.375637-1-henrique.carvalho@suse.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Setting dir_cache_timeout to zero should disable the caching of directory contents. Currently, even when dir_cache_timeout is zero, some caching related functions are still invoked, which is unintended behavior. Fix the issue by setting tcon->nohandlecache to true when dir_cache_timeout is zero, ensuring that directory handle caching is properly disabled. Fixes: 238b351d0935 ("smb3: allow controlling length of time directory entries are cached with dir leases") Signed-off-by: Henrique Carvalho --- V1 -> V2: Split patch and addressed review comments fs/smb/client/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index b227d61a6f205..62a29183c655c 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -2614,7 +2614,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx) if (ses->server->dialect >= SMB20_PROT_ID && (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING)) - nohandlecache = ctx->nohandlecache; + nohandlecache = ctx->nohandlecache || !dir_cache_timeout; else nohandlecache = true; tcon = tcon_info_alloc(!nohandlecache, netfs_trace_tcon_ref_new); From patchwork Sat Nov 23 01:14:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique Carvalho X-Patchwork-Id: 13883733 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 727B415C144 for ; Sat, 23 Nov 2024 01:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324539; cv=none; b=sVWMIwhazjeoHKa6+Tj0uwIWWbXjGQdkOtQIapudjz4ggavEHJL9Cc2t7cs8HWf2ralQSDr1EQrOmv3vS3T4KwltEwtoOvfqR8Y2FwkDJNQmzCOkm6Z+0G+uCWmYvu/EItWsL2rQu3ryj7v9Ds1mRa5Pc+Sw2cH9HWChTIi1vDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324539; c=relaxed/simple; bh=xc3f/+WMRuftca7H/fbNXJP180/9fQjadJNguZQKfk8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LW96/+W8vQn+8bRki7yv5tXpHsw2TVpnr5cDVvQS98V3Q+4Ofv+hAgdCVDCpwueRDsumiIClzjeN3atTUA51jJ50gZm7zdA5C0419tvtmfAYv4LWuVQ1r4it1RTt66+JTaGT6OXH/54DPPRtl6OMyfMEDDV7ruExNIFUvCz5WVk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=F2+R3F8E; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="F2+R3F8E" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-382456c6597so1948414f8f.2 for ; Fri, 22 Nov 2024 17:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1732324535; x=1732929335; 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=WkjfLSciC1FZ4S0ADfaOv6fCir9oXRhjff/U8YYLuz0=; b=F2+R3F8EEmByZfusHmrG87SQqDbd3+w3IxrG4drZQSEqKMcGZD3DPCxYhatQ7n2ZdM g6n/b6aKELsPij+BENgRQ4AEcENtISVBN6SRkXPMnIaksfYOFKup5g1bRW3KmVV+Ig0/ UooWy8WZKPxZGppclKgSWfSUqSBwVefAjaLJTqOHkTK4qCx2qwYhfFZjDhCZ51IEeKJl Ve3PiOLCfGFKSZ623hRPiIwjZHDPk3yS9OPxrh+ehYIVOL7owCu2Ae+2E9flDEgWjsO0 tL6tVm5olZgj8CWowbr1Zy69rE/0XyATROVYAANXYG7dHaaFbNN2eLjoxHRuHtNa2tMi 4N6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732324535; x=1732929335; 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=WkjfLSciC1FZ4S0ADfaOv6fCir9oXRhjff/U8YYLuz0=; b=nba86jlAqohNZd1X0n52p2oWk6LsLHBRdT9aK7L2VEqQQg8tg102nV7XSab+yfLVdo b1c3J+iivWpFYDTpvbjoE8B64DQ4HxpTkImOGe2D8RQ1l9axzkvNdwKh/jNyXj+bXnYj 3uVtyTDJ+CSq2/TXsgReCYSOozMJZYfPSSIpltOKLu08c5Ed/ClESkEmh9v0MoWTf7ef tIKB3CYw7F7OJJ8Qag6nTDPDVjJSmS+niCdaTGmIdvcBU51LBBTzvcGlhjzxCC0VW8ls 9gGmtxsDDQEgCVkRiMucjxL5BfSwMSJNl9nIWVrzJOTpvRXb5ftewxutNTuojzqqY9VB i9kA== X-Forwarded-Encrypted: i=1; AJvYcCUUQ7zjlUP6+aybP9d0326n0NxIuc7kWKK8vE/jdZH7r7HdbTFzfoMuRqA7Fhk3FfwVJ7USG7c2p1Dy@vger.kernel.org X-Gm-Message-State: AOJu0Yx9EMlKfauXgGrLQRTGHS8/x72Ffj5+jVsmynPha3QJZcRDdrY0 JCsa1rPaxT9XyIjOi4m9n3tLn4m2BxDqpSmedCYwXIFnLnz/lZyrWSpnX1j/lGM= X-Gm-Gg: ASbGncuwMbO6iZGB9d5q1wUiJSCPusaL0AZ+zyXs/mdd3RJhq6mhU2gx+K1oMYqhQcf ycxUDkEXc4Dqz1YxK5R2Eqt4Pn5HqXoh3eT3m3/e7atHXU0r9V8ikRISlzY6sUpoLgWH5Q/+wuH PfmsAVsiEIIsCFXjssz6Tpr57F1QSiq/AtCIfj4nfs1xujxxc5Th2YGemLpADJkffwqrzwdqqgM +3Aym1KamyydzvgAVOsFmjkW2vkp4HExBv9S1qcGmGVALuTub6Gk9xDTLuorU+MyRnjtg== X-Google-Smtp-Source: AGHT+IH1kTXtvYl2g+VDvKR7AulQZOfHzMSdnCu73MuC3VdcIHMZ0HPQqRozbab2/r6cX2vyLU9w8g== X-Received: by 2002:a05:6000:178b:b0:382:4b2f:f755 with SMTP id ffacd0b85a97d-38260be3c7dmr3971790f8f.54.1732324534766; Fri, 22 Nov 2024 17:15:34 -0800 (PST) Received: from localhost.localdomain ([2800:810:5e9:f3c:e019:b39:5a90:cfe]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2eaca70371dsm4043040a91.1.2024.11.22.17.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 17:15:34 -0800 (PST) From: Henrique Carvalho To: sfrench@samba.org Cc: ematsumiya@suse.de, pc@manguebit.com, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, linux-cifs@vger.kernel.org, Henrique Carvalho Subject: [PATCH v2 2/3] smb: client: remove unnecessary checks in open_cached_dir() Date: Fri, 22 Nov 2024 22:14:36 -0300 Message-ID: <20241123011437.375637-2-henrique.carvalho@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241123011437.375637-1-henrique.carvalho@suse.com> References: <20241123011437.375637-1-henrique.carvalho@suse.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Checks inside open_cached_dir() can be removed because if dir caching is disabled then tcon->cfids is necessarily NULL. Therefore, all other checks are redundant. Signed-off-by: Henrique Carvalho --- V1 -> V2: Split patch and addressed review comments fs/smb/client/cached_dir.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index 8b510c858f4ff..85a8cc04e2c81 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -162,15 +162,17 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, const char *npath; int retries = 0, cur_sleep = 1; - if (tcon == NULL || tcon->cfids == NULL || tcon->nohandlecache || - is_smb1_server(tcon->ses->server) || (dir_cache_timeout == 0)) + if (cifs_sb->root == NULL) + return -ENOENT; + + if (tcon == NULL) return -EOPNOTSUPP; ses = tcon->ses; cfids = tcon->cfids; - if (cifs_sb->root == NULL) - return -ENOENT; + if (cfids == NULL) + return -EOPNOTSUPP; replay_again: /* reinitialize for possible replay */ From patchwork Sat Nov 23 01:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique Carvalho X-Patchwork-Id: 13883734 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 2D98D22EEF for ; Sat, 23 Nov 2024 01:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324541; cv=none; b=L3cFVlOIjbexTEa8kJY80yYDkSOolP35ohalx9HM05x24v6vXWYhsq1vUJxWEluVfa7v/skby3TllemMW447sqW1+QF3RuZIRklQNFAmQ8nRFehq8Nb7hRiXsNOoEzNbIjGLaFqN7FYMMbigWdBYRY3Xpvr1H+fuRlPostcYnhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732324541; c=relaxed/simple; bh=//BJwjnRDoaHJifWg5x7JC3yCdSUWaA6DjlMhEQ4yNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZcoHu1UCcDf0tTbUgVZdKldkYwCOFU2xbq5Y6LHFinkC1Mnak/cVTffxbz3xrUQOe9EWzieqxXb6S4uyhwW1Pf9qUhQ0wbY7Jy9TZyZoEejXVTJXNSRYVNKA/2V/4d/E295fr0bzMLB8WxvtCojkzKs7WRWN3SJHi2AIovQ9+/o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=VXfyFGn1; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="VXfyFGn1" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-382378f359dso1812999f8f.1 for ; Fri, 22 Nov 2024 17:15:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1732324537; x=1732929337; 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=KEn2rjj3s87nZuDyW8085na2MCPjKtNREiV9c9/HAn8=; b=VXfyFGn140+kioy5QBgM0VUzzVcUrmPep+UG0zab6xnFNqdUDeYD+Y0IyHtwDlcLKw CpghApTrXoa3fgIw9/00VV5Y15NqPGrNC2jrPdLJv/OZjsShNX9Xap1LMSmuXs0o+Bnj rcFptDcAlcc/Ry4tp+/RkfIcxZ4LrBgBwCSgTUWT/fQ1b5YDNx95muPTsXm66tBI9/oj Q/CAR7eHLBp83XMT0NNsr2qFnFlYwBUaT/ZUma3La1619WuVkoC/yhLj4VSSCOK0LwCq 6V+gzhEz6+4QujweuXYnCC61PZGWJFRjBET9cT9yeSP1KqDYWUFlA9YOsEOpEzcvJusR ihVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732324537; x=1732929337; 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=KEn2rjj3s87nZuDyW8085na2MCPjKtNREiV9c9/HAn8=; b=CTu2bWGvxJL90e/qa2AgytzmTpY//R+v/YWen84O3yJxR5jNrNouglqkQdjVEgGFFS +HZ+iBdgjqMwFe1iYBcEF9S0kH2arrSbmJwsfLAciltV6plmnAiIDW0fc5GwznoDbRgw GCtsYldQ7uCD9byoMMRtQHGrCuoRU2fLIUnSWXN+9gEfjz/S/rTrGXDwj4HeQBblgJXf ClFreC632XHMgg9kA9RlBEVzG4q/Y5wbIpfA4UwpLOp0q8ADxzyDa8DvCHUWEdAy7rkh 6MUJHU9w9Y4Bp5GGlBVLQDiDXh/tscpLcC4mdvaClIycFVTYxxAozEBkW/bASTSCPEv+ VIBw== X-Forwarded-Encrypted: i=1; AJvYcCWA58T9ojktJ8P8wDzbV1NaTgKKDS0E66I+kvQGFod3SfDtc7Hel/CG+xnpHHb8TnJ09ZTTDPddCVuR@vger.kernel.org X-Gm-Message-State: AOJu0YzuJWCFlXNzSe//kKuIF6TwBEGC7qoJvUw8E5Lc8bnwzuplU1p/ rf99pOZ4rxwqpXFmc6j409XtDroOVoj4W6ALCwSduLUFOnqLypZfk+maoMtegu0= X-Gm-Gg: ASbGncu6FZPFnneHZgQb5KkkdwGLH9vI+vLEpYJdXeYuVvkewazIX/O7h5THLI7I3+U L8d2tSzCJlHWIqnDSsHDNn+vQPdK1pBXMmAIrO93jOcBGKKoRDcxbRkjEf1fRXOf/bvLcyxW5K2 0CjF0XzbllScW9/Qq6mWhozuLn5TAA6DxDamsRrakEr4HsjX4ZtSypkznLBQ2kNOxncrnoEqZH+ AGs09ntXGeRZfy5OL7MS+90LJijydS2SMxmUvbUoq2Xv5n03aI1Z2C6m3QmFu0fLOoljQ== X-Google-Smtp-Source: AGHT+IExRtuU8aZvJasVVGL+kQ/pCYfspDDu1A2VLP7eJ7bdf1cG9KkT82iNYnJ5WzkgW71Mq+8rQw== X-Received: by 2002:a5d:47a8:0:b0:382:4a84:67c with SMTP id ffacd0b85a97d-38260b8be1bmr3805786f8f.32.1732324537632; Fri, 22 Nov 2024 17:15:37 -0800 (PST) Received: from localhost.localdomain ([2800:810:5e9:f3c:e019:b39:5a90:cfe]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2eaca70371dsm4043040a91.1.2024.11.22.17.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 17:15:37 -0800 (PST) From: Henrique Carvalho To: sfrench@samba.org Cc: ematsumiya@suse.de, pc@manguebit.com, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, linux-cifs@vger.kernel.org, Henrique Carvalho Subject: [PATCH v2 3/3] smb: client: change return value in open_cached_dir_by_dentry() if !cfids Date: Fri, 22 Nov 2024 22:14:37 -0300 Message-ID: <20241123011437.375637-3-henrique.carvalho@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241123011437.375637-1-henrique.carvalho@suse.com> References: <20241123011437.375637-1-henrique.carvalho@suse.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Change return value from -ENOENT to -EOPNOTSUPP to maintain consistency with the return value of open_cached_dir() for the same case. This change is safe as the only calling function does not differentiate between these return values. Signed-off-by: Henrique Carvalho --- V1 -> V2: Split patch and addressed review comments fs/smb/client/cached_dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index 85a8cc04e2c81..d8b1cf1043c35 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -396,7 +396,7 @@ int open_cached_dir_by_dentry(struct cifs_tcon *tcon, struct cached_fids *cfids = tcon->cfids; if (cfids == NULL) - return -ENOENT; + return -EOPNOTSUPP; spin_lock(&cfids->cfid_list_lock); list_for_each_entry(cfid, &cfids->entries, entry) {