From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH 1/3] fsck.f2fs: fix alignment on multi-partition support
Date: Fri, 18 Dec 2020 08:17:06 -0800 [thread overview]
Message-ID: <20201218161708.927900-1-jaegeuk@kernel.org> (raw)
- mkfs.f2fs -s 4 -c second_dev first_dev
- fsck.f2fs first
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 69668488 (34017 MB)
Segment count (19128) mismatch with total segments from devices (19130) Can't find a valid F2FS superblock at 0x0
Segment count (19128) mismatch with total segments from devices (19130) Can't find a valid F2FS superblock at 0x1
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/mount.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index fc3ecb959737..6b2f17ebe8f3 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -793,7 +793,7 @@ static int verify_sb_chksum(struct f2fs_super_block *sb)
int sanity_check_raw_super(struct f2fs_super_block *sb, enum SB_ADDR sb_addr)
{
unsigned int blocksize;
- unsigned int segment_count, segs_per_sec, secs_per_zone;
+ unsigned int segment_count, segs_per_sec, secs_per_zone, segs_per_zone;
unsigned int total_sections, blocks_per_seg;
if ((get_sb(feature) & F2FS_FEATURE_SB_CHKSUM) &&
@@ -845,6 +845,7 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, enum SB_ADDR sb_addr)
segs_per_sec = get_sb(segs_per_sec);
secs_per_zone = get_sb(secs_per_zone);
total_sections = get_sb(section_count);
+ segs_per_zone = segs_per_sec * secs_per_zone;
/* blocks_per_seg should be 512, given the above check */
blocks_per_seg = 1 << get_sb(log_blocks_per_seg);
@@ -883,7 +884,7 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, enum SB_ADDR sb_addr)
dev_segs += le32_to_cpu(sb->devs[i].total_segments);
i++;
}
- if (segment_count != dev_segs) {
+ if (segment_count != dev_segs / segs_per_zone * segs_per_zone) {
MSG(0, "Segment count (%u) mismatch with total segments from devices (%u)",
segment_count, dev_segs);
return 1;
--
2.29.2.729.g45daf8777d-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2020-12-18 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 16:17 Jaegeuk Kim [this message]
2020-12-18 16:17 ` [f2fs-dev] [PATCH 2/3] mkfs.f2fs: adjust zone alignment when using multi-partitions Jaegeuk Kim
2020-12-18 16:17 ` [f2fs-dev] [PATCH 3/3] mkfs.f2fs: allocate zones together to avoid random access Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201218161708.927900-1-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).