summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenXiaoSong <chenxiaosong@kylinos.cn>2026-08-07 08:58:06 +0000
committerPaulo Alcantara <pc@manguebit.org>2026-08-19 12:29:47 -0300
commita2f9fb451c68adf2b3f7cae1bb66fb5801769ac6 (patch)
tree5cda873d6ab76bbc1783f1237654264cfad929a4
parentdb2ddb87143519e20a95aa36c60b36107b736a58 (diff)
downloadlinux-a2f9fb451c68adf2b3f7cae1bb66fb5801769ac6.tar.gz
linux-a2f9fb451c68adf2b3f7cae1bb66fb5801769ac6.zip
smb/client: return EOPNOTSUPP for unsupported O_TMPFILE
Some SMB servers return STATUS_OBJECT_NAME_NOT_FOUND or STATUS_DELETE_PENDING when creating an O_TMPFILE. The SMB client maps them to ENOENT. The ENOENT error is supposed to be returned when the path (a target directory in this case) does not exist, while a lack of support of O_TMPFILE by the target file system should be indicated by EOPNOTSUPP. Reported-by: Mikhail Stefantsev <mikhail@mstefan99.com> Fixes: 3e7d63037a2b ("smb: client: add support for O_TMPFILE") Closes: https://lore.kernel.org/linux-cifs/75fb5359-b268-492d-8d4a-504d1af60f2a@app.fastmail.com/ Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Paulo Alcantara <pc@manguebit.org>
-rw-r--r--fs/smb/client/dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index 88a4a1787ff0..b0ddcaa2d815 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -1138,6 +1138,8 @@ int cifs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
} while (unlikely(rc == -EEXIST) && ++retries < max_retries);
if (rc) {
+ if (rc == -ENOENT)
+ rc = -EOPNOTSUPP;
cifs_del_pending_open(&open);
goto out;
}