Patch "f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"" 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: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"

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-revert-f2fs-truncate-blocks-in-batch-in-__complete_revoke_list.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.


>From c7dbc06688292db34c1bb9c715e29ac4935af994 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
Date: Tue, 14 Feb 2023 15:53:52 -0800
Subject: f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"

From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

commit c7dbc06688292db34c1bb9c715e29ac4935af994 upstream.

We should not truncate replaced blocks, and were supposed to truncate the first
part as well.

This reverts commit 78a99fe6254cad4be310cd84af39f6c46b668c72.

Cc: stable@xxxxxxxxxxxxxxx
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/f2fs/segment.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -262,19 +262,24 @@ static void __complete_revoke_list(struc
 					bool revoke)
 {
 	struct revoke_entry *cur, *tmp;
+	pgoff_t start_index = 0;
 	bool truncate = is_inode_flag_set(inode, FI_ATOMIC_REPLACE);
 
 	list_for_each_entry_safe(cur, tmp, head, list) {
-		if (revoke)
+		if (revoke) {
 			__replace_atomic_write_block(inode, cur->index,
 						cur->old_addr, NULL, true);
+		} else if (truncate) {
+			f2fs_truncate_hole(inode, start_index, cur->index);
+			start_index = cur->index + 1;
+		}
 
 		list_del(&cur->list);
 		kmem_cache_free(revoke_entry_slab, cur);
 	}
 
 	if (!revoke && truncate)
-		f2fs_do_truncate_blocks(inode, 0, false);
+		f2fs_do_truncate_blocks(inode, start_index * PAGE_SIZE, false);
 }
 
 static int __f2fs_commit_atomic_write(struct inode *inode)


Patches currently in stable-queue which might be from jaegeuk@xxxxxxxxxx are

queue-6.2/f2fs-fix-kernel-crash-due-to-null-io-bio.patch
queue-6.2/f2fs-fix-cgroup-writeback-accounting-with-fs-layer-encryption.patch
queue-6.2/f2fs-retry-to-update-the-inode-page-given-data-corruption.patch
queue-6.2/f2fs-fix-information-leak-in-f2fs_move_inline_dirents.patch
queue-6.2/f2fs-revert-f2fs-truncate-blocks-in-batch-in-__complete_revoke_list.patch



[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