* [PATCH] smb/client: return EOPNOTSUPP for unsupported O_TMPFILE
@ 2026-08-07 8:58 ChenXiaoSong
2026-08-07 13:32 ` Paulo Alcantara
0 siblings, 1 reply; 2+ messages in thread
From: ChenXiaoSong @ 2026-08-07 8:58 UTC (permalink / raw)
To: smfrench, linkinjeon, pc, tom, senozhatsky, slow, mikhail
Cc: linux-cifs, samba-technical, ChenXiaoSong
From: ChenXiaoSong <chenxiaosong@kylinos.cn>
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>
---
fs/smb/client/dir.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] smb/client: return EOPNOTSUPP for unsupported O_TMPFILE
2026-08-07 8:58 [PATCH] smb/client: return EOPNOTSUPP for unsupported O_TMPFILE ChenXiaoSong
@ 2026-08-07 13:32 ` Paulo Alcantara
0 siblings, 0 replies; 2+ messages in thread
From: Paulo Alcantara @ 2026-08-07 13:32 UTC (permalink / raw)
To: ChenXiaoSong, smfrench, linkinjeon, tom, senozhatsky, slow,
mikhail
Cc: linux-cifs, samba-technical, ChenXiaoSong
ChenXiaoSong <chenxiaosong@chenxiaosong.com> writes:
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>
> 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>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-07 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 8:58 [PATCH] smb/client: return EOPNOTSUPP for unsupported O_TMPFILE ChenXiaoSong
2026-08-07 13:32 ` Paulo Alcantara
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.