lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Jul 2022 06:02:41 +0000
From:   Harshad Shirwadkar <harshadshirwadkar@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     tytso@....edu, Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: [RFC PATCH v4 3/8] ext4: use extent status tree in fast commit path

This patch moves fc commit path to use extent status tree to lookup
logical to physical mappings. In order to preserve the uncommitted
entries in the es cache, this patch makes all the inodes on fast
commit list as shrinker ineligible. Making the uncommitted entries in
es cache to stick around is left as a future enhancement.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@...il.com>
---
 fs/ext4/extents_status.c | 3 ++-
 fs/ext4/fast_commit.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 9a3a8996aacf..07fb86746534 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1500,7 +1500,8 @@ static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan,
 			continue;
 		}
 
-		if (ei == locked_ei || !write_trylock(&ei->i_es_lock)) {
+		if (!list_empty(&ei->i_fc_list) || ei == locked_ei ||
+			!write_trylock(&ei->i_es_lock)) {
 			nr_skipped++;
 			continue;
 		}
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 4d2384adcbb0..916f62cfa7f7 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -951,7 +951,8 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
 	while (cur_lblk_off <= new_blk_size) {
 		map.m_lblk = cur_lblk_off;
 		map.m_len = new_blk_size - cur_lblk_off + 1;
-		ret = ext4_map_blocks(NULL, inode, &map, 0);
+		ret = ext4_map_blocks(NULL, inode, &map,
+			EXT4_GET_BLOCKS_CACHED_NOWAIT);
 		if (ret < 0)
 			return -ECANCELED;
 
-- 
2.37.0.170.g444d1eabd0-goog

Powered by blists - more mailing lists