Commit fda94a99 authored by Eric Sandeen's avatar Eric Sandeen Committed by Namjae Jeon
Browse files

exfat: short-circuit zero-byte writes in exfat_file_write_iter



When generic_write_checks() returns zero, it means that
iov_iter_count() is zero, and there is no work to do.

Simply return success like all other filesystems do, rather than
proceeding down the write path, which today yields an -EFAULT in
generic_perform_write() via the
(fault_in_iov_iter_readable(i, bytes) == bytes) check when bytes
== 0.

Fixes: 11a347fb ("exfat: change to get file size from DataLength")
Reported-by: default avatarNoah <kernel-org-10@maxgrass.eu>
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Reviewed-by: default avatarYuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
parent 9da33619
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment