smb/client: return EOPNOTSUPP for unsupported O_TMPFILE
Subsystems (2)
ChenXiaoSong
reviewerPATCH 1/1 smb/client: return EOPNOTSUPP for unsupported O_TMPFILE
From: ChenXiaoSong <[email protected]>
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.
--- fs/smb/client/dir.c | 2 ++ 1 file changed, 2 insertions(+)
fs/smb/client/dir.c +2 -0
@@ -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; }
Signature · 1 line
2.54.0
Quoted 11 lines · ChenXiaoSong
From: ChenXiaoSong <[email protected]>
Some SMB servers return
STATUS_OBJECT_NAME_NOT_FOUNDorSTATUS_DELETE_PENDINGwhen creating anO_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_TMPFILEby the target file system should be indicated by EOPNOTSUPP.
Quoted 4 lines
Reported-by Mikhail Stefantsev <[email protected]>Fixes 3e7d63037a2b ("smb: client: add support for O_TMPFILE")Signed-off-by ChenXiaoSong <[email protected]>
Quoted 12 lines · ChenXiaoSong
From: ChenXiaoSong <[email protected]>
Some SMB servers return
STATUS_OBJECT_NAME_NOT_FOUNDorSTATUS_DELETE_PENDINGwhen creating anO_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_TMPFILEby the target file system should be indicated by EOPNOTSUPP.
Quoted 4 lines
Reported-by Mikhail Stefantsev <[email protected]>Fixes 3e7d63037a2b ("smb: client: add support for O_TMPFILE")Signed-off-by ChenXiaoSong <[email protected]>
Applied it to #for-next with Paulo's acked-by tag. Thanks!