mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, kernel-team@android.com
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 3/4] f2fs: fix wrong block count instead of bytes
Date: Wed, 25 Nov 2020 18:24:15 -0800	[thread overview]
Message-ID: <20201126022416.3068426-3-jaegeuk@kernel.org> (raw)
In-Reply-To: <20201126022416.3068426-1-jaegeuk@kernel.org>

We should convert cur_lblock, a block count, to bytes for len.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/data.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a84e5bc09337..e49c14ccfafe 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3893,7 +3893,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
 	sector_t highest_pblock = 0;
 	int nr_extents = 0;
 	unsigned long nr_pblocks;
-	unsigned long len;
+	u64 len;
 	int ret;
 
 	/*
@@ -3911,7 +3911,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
 		cond_resched();
 
 		memset(&map_bh, 0, sizeof(struct buffer_head));
-		map_bh.b_size = len - cur_lblock;
+		map_bh.b_size = len - blks_to_bytes(inode, cur_lblock);
 
 		ret = get_data_block(inode, cur_lblock, &map_bh, 0,
 					F2FS_GET_BLOCK_FIEMAP, &next_pgofs);
-- 
2.29.2.454.gaff20da3a2-goog


  parent reply	other threads:[~2020-11-26  2:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  2:24 [PATCH 1/4] f2fs: rename logical_to_blk and blk_to_logical Jaegeuk Kim
2020-11-26  2:24 ` [PATCH 2/4] f2fs: use new conversion functions between blks and bytes Jaegeuk Kim
2020-12-01  4:09   ` Jaegeuk Kim
2020-12-01  9:00     ` [f2fs-dev] " Chao Yu
2020-11-26  2:24 ` Jaegeuk Kim [this message]
2020-12-01  4:09   ` [PATCH 3/4] f2fs: fix wrong block count instead of bytes Jaegeuk Kim
2020-12-01  9:03     ` [f2fs-dev] " Chao Yu
2020-11-26  2:24 ` [PATCH 4/4] f2fs: remove buffer_head which has 32bits limit Jaegeuk Kim
2020-12-01  4:09   ` Jaegeuk Kim
2020-12-02  1:47     ` [f2fs-dev] " Chao Yu
2020-12-01  4:09 ` [PATCH 1/4] f2fs: rename logical_to_blk and blk_to_logical Jaegeuk Kim
2020-12-01  8:55   ` [f2fs-dev] " Chao Yu

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=20201126022416.3068426-3-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome