f2fs-tools: set segment_count in super block correctly
PATCH v2 1/1 f2fs-tools: set segment_count in super block correctly
Now f2fs will check statistics recorded in super block in sanity_check_area_boundary() during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section, mount will fail due to following condition:
main_blkaddr + (segment_count_main << log_blocks_per_seg) !=
segment0_blkaddr + (segment_count << log_blocks_per_seg)
this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to segment_count_main, but add it to segment_count.
Here align segment_count with section size first to prevent such problem.
--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mkfs/f2fs_format.c +2 -1
@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
Signature · 9 lines
1.7.9.5 ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
Quoted 3 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,
Hi Fan, Hi Kim:
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should segment_count in superblock be aligned with zone rather than section?
Thanks,
Junling
Quoted 21 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c +0
-0
mkfs/f2fs_format.c static int f2fs_prepare_super_block(void) · line 181
Quoted 9 lines
mkfs/f2fs_format.c +2
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Quoted 17 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
Quoted 7 lines
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?
I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 33 lines
Thanks,
Junling
Quoted 28 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);
Quoted 4 lines
mkfs/f2fs_format.c static int f2fs_prepare_super_block(void) · line 181
Quoted 3 lines
mkfs/f2fs_format.c +0
-0set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Quoted 19 lines · Fan Li
Quoted 19 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
I'm uncertain about which unit the disk space should be aligned with? section or zone?
Quoted 9 lines
Quoted 5 lines
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Yeah, this patch is contained on dev branch, not yet on master:)
Quoted 36 lines
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 33 lines
Thanks,
Junling
Quoted 28 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);
Quoted 9 lines
Quoted 4 lines
mkfs/f2fs_format.c static int f2fs_prepare_super_block(void) · line 181
Quoted 3 lines
mkfs/f2fs_format.c +0
-0set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Hi Fan,
Could you resubmit the final patch?
I'll remove the previous patch merged into dev branch.
Thanks,
Quoted 23 lines · Fan Li
Quoted 23 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
Quoted 46 lines
Quoted 1 line
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 37 lines
Thanks,
Junling
Quoted 31 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Quoted 9 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Saturday, February 06, 2016 12:08 PM
To: Fan Li
Cc: 'Junling Zheng'; [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctly
Quoted 4 lines
Hi Fan,
Could you resubmit the final patch?
I'll remove the previous patch merged into dev branch.
I think removing the patch would be sufficient enough.
Sorry for the trouble. It's my first time to acquire the code of f2fs-tools, There seems to be a mistake.
Quoted 75 lines
Thanks,
Quoted 71 lines · Fan Li
Quoted 18 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
Quoted 8 lines
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 37 lines
Thanks,
Junling
Quoted 31 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Hi, Fan,
Quoted 9 lines · Fan Li
Quoted 9 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Saturday, February 06, 2016 12:08 PM
To: Fan Li
Cc: 'Junling Zheng'; [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctly
Quoted 9 lines
Quoted 4 lines
Hi Fan,
Could you resubmit the final patch?
I'll remove the previous patch merged into dev branch.I think removing the patch would be sufficient enough.
Sorry for the trouble. It's my first time to acquire the code of f2fs-tools, There seems to be a mistake.
However, it seems that the problem you mentioned before still exists.
Now, segment_count_main is aligned with zone size, but segment_count not, which may cause:
main_blkaddr + (segment_count_main << log_blocks_per_seg) !=
segment0_blkaddr + (segment_count << log_blocks_per_seg)
then, mount will fail.
So, we still need to align segment_count with zone size:)
Thanks,
Quoted 70 lines
Quoted 70 lines
Thanks,
Quoted 66 lines · Fan Li
Quoted 18 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
Quoted 8 lines
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 33 lines
Thanks,
Junling
Quoted 28 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
mkfs/f2fs_format.c static int f2fs_prepare_super_block(void) · line 181
Quoted 3 lines
mkfs/f2fs_format.c +0
-0set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Quoted 35 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Wednesday, February 24, 2016 4:34 PM
To: Fan Li; 'Jaegeuk Kim'
Cc: [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyHi, Fan,
Quoted 11 lines · Fan Li
Quoted 11 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Saturday, February 06, 2016 12:08 PM
To: Fan Li
Cc: 'Junling Zheng'; [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 9 lines
Quoted 4 lines
Hi Fan,
Could you resubmit the final patch?
I'll remove the previous patch merged into dev branch.I think removing the patch would be sufficient enough. Sorry for the trouble. It's my first time to acquire the code of f2fs-tools, There seems to be a mistake.
However, it seems that the problem you mentioned before still exists.
Quoted 8 lines
Now,
segment_count_mainis aligned with zone size, butsegment_countnot, which may cause:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)then, mount will fail.
So, we still need to align
segment_countwith zone size:)
According to new mkfs codes, segment_count has already been aligned with zone:
set_sb(segment_count, (config.total_sectors * config.sector_size -
zone_align_start_offset) / segment_size_bytes / config.segs_per_zone * config.segs_per_zone);
It seems to be OK. What's your test parameters?
Quoted 83 lines
Thanks,
Quoted 79 lines
Quoted 75 lines
Thanks,
Quoted 71 lines · Fan Li
Quoted 18 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
Quoted 8 lines
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 37 lines
Thanks,
Junling
Quoted 31 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Hi, Fan,
Quoted 42 lines · Fan Li
Quoted 42 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Wednesday, February 24, 2016 4:34 PM
To: Fan Li; 'Jaegeuk Kim'
Cc: [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyHi, Fan,
Quoted 11 lines · Fan Li
Quoted 11 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Saturday, February 06, 2016 12:08 PM
To: Fan Li
Cc: 'Junling Zheng'; [email protected]; [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 9 lines
Quoted 4 lines
Hi Fan,
Could you resubmit the final patch?
I'll remove the previous patch merged into dev branch.I think removing the patch would be sufficient enough. Sorry for the trouble. It's my first time to acquire the code of f2fs-tools, There seems to be a mistake.
However, it seems that the problem you mentioned before still exists.
Now,
segment_count_mainis aligned with zone size, butsegment_countnot, which may cause:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)then, mount will fail.
Quoted 9 lines
Quoted 1 line
So, we still need to align
segment_countwith zone size:)According to new mkfs codes,
segment_counthas already been aligned with zone:
set_sb(segment_count, (config.total_sectors * config.sector_size -
zone_align_start_offset) /segment_size_bytes/ config.segs_per_zone * config.segs_per_zone);It seems to be OK. What's your test parameters?
Sorry, there was a misunderstanding in my words and I also misunderstood your previous reply:(
Currently in the latest code, segment_count has not been aligned with zone yet:
set_sb(segment_count, (config.total_sectors * config.sector_size -
zone_align_start_offset) / segment_size_bytes);
The patch Kim removed was your previous patch, which aligned segment_count with section size,
so I mean that you should resubmit the final patch, which aligns segment_count with zone size:)
Thanks,
Quoted 80 lines
Quoted 80 lines
Thanks,
Quoted 77 lines
Quoted 75 lines
Thanks,
Quoted 71 lines · Fan Li
Quoted 18 lines
-----Original Message-----
From: Junling Zheng [mailto:[email protected]]
Sent: Thursday, February 04, 2016 10:52 AM
To: Fan Li; 'Jaegeuk Kim'; [email protected]
Cc: [email protected]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs-tools: setsegment_countin super block correctlyQuoted 4 lines · Fan Li
Now f2fs will check statistics recorded in super block in
sanity_check_area_boundary()during mount,if number of segments per section is greater than 1, and the disk space isn't aligned with section,Hi Fan, Hi Kim:
Quoted 8 lines
I'm uncertain about which unit the disk space should be aligned with? section or zone?
It looks like commit "e9dfbbb"(mkfs.f2fs: introduce zone align for main area)
from Yunlei had changed the aligning unit from section to zone.
So, should
segment_countin superblock be aligned with zone rather than section?I'm afraid that my codes of mkfs is too old, it doesn't contain this patch, and it still uses section size to align main area.
Of course if main area should be aligned with zone, the following patch should be modified accordingly.
Quoted 37 lines
Thanks,
Junling
Quoted 31 lines
mount will fail due to following condition:
main_blkaddr+ (segment_count_main<<log_blocks_per_seg) !=
segment0_blkaddr+ (segment_count<<log_blocks_per_seg)this is because when the length of main area isn't aligned with section, mkfs didn't add the number of excess segments to
segment_count_main, but add it tosegment_count.
Here alignsegment_countwith section size first to prevent such problem.Signed-off-by Fan Li <[email protected]>--- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mkfs/f2fs_format.c index renamed from mkfs/f2fs_format.c +0
-066d7342..3366302 100644
mkfs/f2fs_format.c +3
-1@@ -174,7 +174,8 @@ static int f2fs_prepare_super_block(void) }set_sb (segment_count, (config.total_sectors * config.sector_size - - zone_align_start_offset) / segment_size_bytes); + zone_align_start_offset) / segment_size_bytes / + config.segs_per_sec * + config.segs_per_sec);set_sb (segment0_blkaddr, zone_align_start_offset / blk_size_bytes); sb->cp_blkaddr = sb->segment0_blkaddr;
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
.
.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140