Patch "netfs: Fix interaction of streaming writes with zero-point tracker" has been added to the 6.10-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

    netfs: Fix interaction of streaming writes with zero-point tracker

to the 6.10-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:
     netfs-fix-interaction-of-streaming-writes-with-zero-.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 4fa4adae73f68de2b6d02daf30b7c9a39aefa77e
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Sat Aug 24 12:56:53 2024 +0100

    netfs: Fix interaction of streaming writes with zero-point tracker
    
    [ Upstream commit e00e99ba6c6b8e5239e75cd6684a6827d93c39a2 ]
    
    When a folio that is marked for streaming write (dirty, but not uptodate,
    with partial content specified in the private data) is written back, the
    folio is effectively switched to the blank state upon completion of the
    write.  This means that if we want to read it in future, we need to reread
    the whole folio.
    
    However, if the folio is above the zero_point position, when it is read
    back, it will just be cleared and the read skipped, leading to apparent
    local corruption.
    
    Fix this by increasing the zero_point to the end of the dirty data in the
    folio when clearing the folio state after writeback.  This is analogous to
    the folio having ->release_folio() called upon it.
    
    This was causing the config.log generated by configuring a cpython tree on
    a cifs share to get corrupted because the scripts involved were appending
    text to the file in small pieces.
    
    Fixes: 288ace2f57c9 ("netfs: New writeback implementation")
    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/563286.1724500613@xxxxxxxxxxxxxxxxxxxxxx
    cc: Steve French <sfrench@xxxxxxxxx>
    cc: Paulo Alcantara <pc@xxxxxxxxxxxxx>
    cc: Jeff Layton <jlayton@xxxxxxxxxx>
    cc: linux-cifs@xxxxxxxxxxxxxxx
    cc: netfs@xxxxxxxxxxxxxxx
    cc: linux-fsdevel@xxxxxxxxxxxxxxx
    Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c
index 488147439fe0f..a2b697b4aa401 100644
--- a/fs/netfs/write_collect.c
+++ b/fs/netfs/write_collect.c
@@ -33,6 +33,7 @@
 int netfs_folio_written_back(struct folio *folio)
 {
 	enum netfs_folio_trace why = netfs_folio_trace_clear;
+	struct netfs_inode *ictx = netfs_inode(folio->mapping->host);
 	struct netfs_folio *finfo;
 	struct netfs_group *group = NULL;
 	int gcount = 0;
@@ -41,6 +42,12 @@ int netfs_folio_written_back(struct folio *folio)
 		/* Streaming writes cannot be redirtied whilst under writeback,
 		 * so discard the streaming record.
 		 */
+		unsigned long long fend;
+
+		fend = folio_pos(folio) + finfo->dirty_offset + finfo->dirty_len;
+		if (fend > ictx->zero_point)
+			ictx->zero_point = fend;
+
 		folio_detach_private(folio);
 		group = finfo->netfs_group;
 		gcount++;




[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