]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb/server: map SET_INFO ENOSPC to disk full
authorHuiwen He <hehuiwen@kylinos.cn>
Wed, 1 Jul 2026 15:21:57 +0000 (23:21 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 6 Jul 2026 12:55:41 +0000 (07:55 -0500)
FILE_ALLOCATION_INFORMATION can call vfs_fallocate(). If the allocation
cannot be satisfied, vfs_fallocate() returns -ENOSPC.

smb2_set_info() did not map -ENOSPC, so ksmbd returned a generic SMB error
and the client reported EIO instead of ENOSPC. This makes the ENOSPC step
in xfstests generic/213 fail.

Map -ENOSPC and -EFBIG to STATUS_DISK_FULL in the SET_INFO error path.

Tested with xfstests generic/213 on ksmbd.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb2pdu.c

index b1204d1d3cddb6d03d71e2572a9483b30543fc02..af4c3ad2673c7b875aa2fc2540fd7205237bb66f 100644 (file)
@@ -7129,6 +7129,8 @@ err_out:
                rsp->hdr.Status = STATUS_INVALID_PARAMETER;
        else if (rc == -EMSGSIZE)
                rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
+       else if (rc == -ENOSPC || rc == -EFBIG)
+               rsp->hdr.Status = STATUS_DISK_FULL;
        else if (rc == -ESHARE)
                rsp->hdr.Status = STATUS_SHARING_VIOLATION;
        else if (rc == -ENOENT)