[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250831123602.14037-10-pali@kernel.org>
Date: Sun, 31 Aug 2025 14:35:36 +0200
From: Pali Rohár <pali@...nel.org>
To: Steve French <sfrench@...ba.org>,
Paulo Alcantara <pc@...guebit.com>,
ronnie sahlberg <ronniesahlberg@...il.com>
Cc: linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 09/35] cifs: Improve SMB1 stat() to work also for paths in DELETE_PENDING state
Windows NT SMB server may return -EBUSY (STATUS_DELETE_PENDING) from
CIFSSMBQPathInfo() function for files which are in DELETE_PENDING state.
When this happens, it is still possible to use CIFSFindFirst() fallback.
So allow to use CIFSFindFirst() fallback also for -EBUSY error.
This change fixes stat() to work also against Windows Server 2022 for files
in DELETE_PENDING state.
Depends on "cifs: Change translation of STATUS_DELETE_PENDING to -EBUSY".
Signed-off-by: Pali Rohár <pali@...nel.org>
---
fs/smb/client/smb1ops.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c
index 55ab8a5b150c..176bc2a211bf 100644
--- a/fs/smb/client/smb1ops.c
+++ b/fs/smb/client/smb1ops.c
@@ -583,10 +583,11 @@ static int cifs_query_path_info(const unsigned int xid,
/*
* Then fallback to CIFSFindFirst() which works also with non-NT servers
- * but does not does not provide NumberOfLinks.
+ * but does not does not provide NumberOfLinks. Also it works for files
+ * in DELETE_PENDING state (CIFSSMBQPathInfo() returns -EBUSY for them).
* Can be used with backup intent flag to overcome -EACCES error.
*/
- if ((rc == -EOPNOTSUPP || rc == -EINVAL ||
+ if ((rc == -EOPNOTSUPP || rc == -EINVAL || rc == -EBUSY ||
(backup_cred(cifs_sb) && rc == -EACCES)) &&
!non_unicode_wildcard) {
if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_nt_find))
--
2.20.1
Powered by blists - more mailing lists