Patch "exfat: short-circuit zero-byte writes in exfat_file_write_iter" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    exfat: short-circuit zero-byte writes in exfat_file_write_iter

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     exfat-short-circuit-zero-byte-writes-in-exfat_file_w.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9c9fab59b353d3e6da6c31c029aaa282137626e9
Author: Eric Sandeen <sandeen@xxxxxxxxxx>
Date:   Tue Feb 11 14:14:21 2025 -0600

    exfat: short-circuit zero-byte writes in exfat_file_write_iter
    
    [ Upstream commit fda94a9919fd632033979ad7765a99ae3cab9289 ]
    
    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: 11a347fb6cef ("exfat: change to get file size from DataLength")
    Reported-by: Noah <kernel-org-10@xxxxxxxxxxx>
    Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
    Reviewed-by: Yuezhang Mo <Yuezhang.Mo@xxxxxxxx>
    Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index 05b51e7217838..807349d8ea050 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -587,7 +587,7 @@ static ssize_t exfat_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
 	valid_size = ei->valid_size;
 
 	ret = generic_write_checks(iocb, iter);
-	if (ret < 0)
+	if (ret <= 0)
 		goto unlock;
 
 	if (iocb->ki_flags & IOCB_DIRECT) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux