[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241231223642.15722-7-pali@kernel.org>
Date: Tue, 31 Dec 2024 23:36:37 +0100
From: Pali Rohár <pali@...nel.org>
To: Steve French <sfrench@...ba.org>,
Paulo Alcantara <pc@...guebit.com>
Cc: linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 07/12] 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 fixed stat() to work also against Windows Server 2022 for files
in DELETE_PENDING state.
Signed-off-by: Pali Rohár <pali@...nel.org>
---
fs/smb/client/smb1ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c
index b0813106df16..a7a846260736 100644
--- a/fs/smb/client/smb1ops.c
+++ b/fs/smb/client/smb1ops.c
@@ -578,7 +578,7 @@ static int cifs_query_path_info(const unsigned int xid,
* so they cannot be used for querying paths with wildcard characters.
* Therefore for such paths returns -ENOENT as they cannot exist.
*/
- if ((rc == -EOPNOTSUPP || rc == -EINVAL) &&
+ if ((rc == -EOPNOTSUPP || rc == -EINVAL || rc == -EBUSY) &&
!(tcon->ses->capabilities & CAP_UNICODE) &&
strpbrk(full_path, "*?\"><"))
rc = -ENOENT;
@@ -587,7 +587,7 @@ 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.
*/
- if (rc == -EOPNOTSUPP || rc == -EINVAL) {
+ if (rc == -EOPNOTSUPP || rc == -EINVAL || rc == -EBUSY) {
search_info.info_level = SMB_FIND_FILE_FULL_DIRECTORY_INFO;
rc = CIFSFindFirst(xid, tcon, full_path, cifs_sb, NULL,
CIFS_SEARCH_CLOSE_ALWAYS | CIFS_SEARCH_CLOSE_AT_END,
--
2.20.1
Powered by blists - more mailing lists