Commit 4973a2c8 authored by Eric Sandeen's avatar Eric Sandeen Committed by Lee Jones
Browse files

UPSTREAM: 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>
(cherry picked from commit fda94a99)
Change-Id: I5686d6d1029a6563d5a45541735e6de6291b3645
Bug: 397325648
Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
Signed-off-by: default avatarLee Jones <joneslee@google.com>
parent 1b29a5ea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment