Skip to content

Commit

Permalink
f2fs: fix passing relative address when discard zones
Browse files Browse the repository at this point in the history
We should not pass relative address in a zone to
__f2fs_issue_discard_zone().

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Daeho Jeong authored and Jaegeuk Kim committed Apr 13, 2023
1 parent d947721 commit 1ac3d03
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -4942,9 +4942,8 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
"New zone for curseg[%d] is not yet discarded. "
"Reset the zone: curseg[0x%x,0x%x]",
type, cs->segno, cs->next_blkoff);
err = __f2fs_issue_discard_zone(sbi, zbd->bdev,
zone_sector >> log_sectors_per_block,
zone.len >> log_sectors_per_block);
err = __f2fs_issue_discard_zone(sbi, zbd->bdev, cs_zone_block,
zone.len >> log_sectors_per_block);
if (err) {
f2fs_err(sbi, "Discard zone failed: %s (errno=%d)",
zbd->path, err);
Expand Down

0 comments on commit 1ac3d03

Please sign in to comment.