]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: Remove intermediate object of failed create SFU call
authorPali Rohár <pali@kernel.org>
Wed, 25 Dec 2024 13:00:39 +0000 (14:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:03 +0000 (10:05 +0100)
commit843bd0089c06fe7ddaad3b8eb678dc3d083b932f
treecf75b4bf35ef61527a36a2bb92256035892e8e06
parent0a2beaa95f7423174eb3cb61f507f6bf7581bc04
cifs: Remove intermediate object of failed create SFU call

commit 25f6184e24b3991eae977a29ecf27d537cc930b2 upstream.

Check if the server honored ATTR_SYSTEM flag by CREATE_OPTION_SPECIAL
option. If not then server does not support ATTR_SYSTEM and newly
created file is not SFU compatible, which means that the call failed.

If CREATE was successful but either setting ATTR_SYSTEM failed or
writing type/data information failed then remove the intermediate
object created by CREATE. Otherwise intermediate empty object stay
on the server.

This ensures that if the creating of SFU files with system attribute is
unsupported by the server then no empty file stay on the server as a result
of unsupported operation.

This is for example case with Samba server and Linux tmpfs storage without
enabled xattr support (where Samba stores ATTR_SYSTEM bit).

Cc: stable@vger.kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/smb2ops.c