fs/ntfs3: Check new size for limits
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 25 Oct 2021 15:34:06 +0000 (18:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:28 +0000 (10:22 +0200)
commitf45bd2922d66b8195c7c22f19d918eb353cc05ef
treea0a4e5f34b14965125380f728a6fe895c778e541
parentdc05aa14d311aa8fd0d265d042b86dd277a411f7
fs/ntfs3: Check new size for limits

commit 114346978cf61de02832cc3cc68432a3de70fb38 upstream.

We must check size before trying to allocate.
Size can be set for example by "ulimit -f".
Fixes xfstest generic/228
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/file.c