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:Noah <kernel-org-10@maxgrass.eu> Signed-off-by:
Eric Sandeen <sandeen@redhat.com> Reviewed-by:
Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by:
Namjae Jeon <linkinjeon@kernel.org> (cherry picked from commit fda94a99) Change-Id: I5686d6d1029a6563d5a45541735e6de6291b3645 Bug: 397325648 Signed-off-by:
Daniel Rosenberg <drosen@google.com> Signed-off-by:
Lee Jones <joneslee@google.com>
Loading
Please sign in to comment