Patch "f2fs: clear atomic_write_task in f2fs_abort_atomic_write()" has been added to the 6.2-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

    f2fs: clear atomic_write_task in f2fs_abort_atomic_write()

to the 6.2-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:
     f2fs-clear-atomic_write_task-in-f2fs_abort_atomic_wr.patch
and it can be found in the queue-6.2 subdirectory.

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



commit ef10de2acd726647b958fc49780897a632824d8a
Author: Chao Yu <chao@xxxxxxxxxx>
Date:   Mon Jan 9 11:44:50 2023 +0800

    f2fs: clear atomic_write_task in f2fs_abort_atomic_write()
    
    [ Upstream commit 0e8d040bfa4c476d7d2a23119527c744c7de13cd ]
    
    Otherwise, last .atomic_write_task will be remained in structure
    f2fs_inode_info, resulting in aborting atomic_write accidentally
    in race case. Meanwhile, clear original_i_size as well.
    
    Fixes: 7a10f0177e11 ("f2fs: don't give partially written atomic data from process crash")
    Signed-off-by: Chao Yu <chao@xxxxxxxxxx>
    Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index af3059236f542..cf430f34d1968 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -201,9 +201,12 @@ void f2fs_abort_atomic_write(struct inode *inode, bool clean)
 	clear_inode_flag(inode, FI_ATOMIC_FILE);
 	stat_dec_atomic_inode(inode);
 
+	F2FS_I(inode)->atomic_write_task = NULL;
+
 	if (clean) {
 		truncate_inode_pages_final(inode->i_mapping);
 		f2fs_i_size_write(inode, fi->original_i_size);
+		fi->original_i_size = 0;
 	}
 }
 



[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