Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1585130

[PATCH] f2fs: put allocate_segment after refresh_sit_entry

From Yunlong Song <yunlong.song@huawei.com>
Newsgroups linux.kernel
Subject [PATCH] f2fs: put allocate_segment after refresh_sit_entry
Date 2017-02-21 09:50 +0100
Message-ID <tdeiZ-6w-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


SIT information should be updated before segment allocation, since SSR needs
latest valid block information. Current code does not update the old_blkaddr
info in sit_entry, so adjust the allocate_segment to its proper location. Commit
5e443818fa0b2a2845561ee25bec181424fb2889 ("f2fs: handle dirty segments inside
refresh_sit_entry") puts it into wrong location.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/segment.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index df2ff5c..89052df 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1743,14 +1743,15 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
 
 	stat_inc_block_count(sbi, curseg);
 
-	if (!__has_curseg_space(sbi, type))
-		sit_i->s_ops->allocate_segment(sbi, type, false);
 	/*
 	 * SIT information should be updated before segment allocation,
 	 * since SSR needs latest valid block information.
 	 */
 	refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr);
 
+	if (!__has_curseg_space(sbi, type))
+		sit_i->s_ops->allocate_segment(sbi, type, false);
+
 	mutex_unlock(&sit_i->sentry_lock);
 
 	if (page && IS_NODESEG(type))
-- 
1.8.5.2

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] f2fs: put allocate_segment after refresh_sit_entry Yunlong Song <yunlong.song@huawei.com> - 2017-02-21 09:50 +0100
  Re: [PATCH] f2fs: put allocate_segment after refresh_sit_entry Chao Yu <yuchao0@huawei.com> - 2017-02-24 02:40 +0100

csiph-web