LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-14-2022, 02:38 AM   #1
lolo123
LQ Newbie
 
Registered: Jun 2022
Posts: 22

Rep: Reputation: 0
Lightbulb about f2fs scan_curseg_cache


Hi dear all,
It seems that scan_curseg_cache will not update free_nid_bitmap (call add_free_nid with update==false). The consequence is that the free_nid_root might not match the free_nid_bitmap. Is this normal? Many thanks!
 
Old 07-16-2022, 10:59 PM   #2
lolo123
LQ Newbie
 
Registered: Jun 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Hi guys,
I found this really an issue, we assume that an NID==X
1. is marked as used in NAT
2. but marked as free in NAT journal
The above assumption hold when NAT cache of X was flushed to NAT journal in stead of NAT
With this assumption , at mount time , in building free NIDs, f2fs will
1. first scan NAT (scan_nat_page), found X is used
2. then scan NAT journal (scan_curseg_cache), found X is free , add it to free NIDs , BUT does not update free_nid_bitmap!

as an comparison , when NAT cache of X is flushed , the flushing code path will update free_nid_bitmap.

Last edited by lolo123; 07-16-2022 at 11:01 PM.
 
Old 07-17-2022, 12:30 AM   #3
lolo123
LQ Newbie
 
Registered: Jun 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Found the reason , at unmount time , NAT cache will not flush to NAT journal but all flush to NAT, so the NAT at the next mount time is the most up to date.

Last edited by lolo123; 07-17-2022 at 01:03 AM.
 
Old 07-17-2022, 12:46 AM   #4
lolo123
LQ Newbie
 
Registered: Jun 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lolo123 View Post
Found the reason , at unmount time , NAT cache will not flush to NAT journal but all flush to NAT, so the NAT at the next mount time is the most update to date.
if so this line should be guarded like this
Code:
if(!mount)
  scan_curseg_cache(sbi);
 
Old 07-17-2022, 01:00 AM   #5
lolo123
LQ Newbie
 
Registered: Jun 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lolo123 View Post
Found the reason , at unmount time , NAT cache will not flush to NAT journal but all flush to NAT, so the NAT at the next mount time is the most up to date.
But wait. If f2fs does not unmount normally . The scenario in post#2 still exist!!

Last edited by lolo123; 07-17-2022 at 01:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Initial F2FS File-System Results Are Impressive LXer Syndicated Linux News 0 10-21-2012 03:50 PM
LXer: Open-source Flash file system F2FS released by Samsung LXer Syndicated Linux News 0 10-09-2012 12:10 PM
LXer: Samsung contributes F2FS NAND filesystem to Linux LXer Syndicated Linux News 0 10-08-2012 12:30 PM
LXer: Samsung Introduces New Linux File-System: F2FS LXer Syndicated Linux News 0 10-05-2012 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration