summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-03-08 09:49:53 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-03-21 16:52:16 -0400
commit10a875f82b50adc83036368086df9c4cfff7888c (patch)
treed67c8166a09f6e973ad88fc9868f84d5d01e5cfe
parente2f0e962ac2190ab4e0d1ee4b258273d3a51e689 (diff)
downloadlinux-10a875f82b50adc83036368086df9c4cfff7888c.tar.gz
linux-10a875f82b50adc83036368086df9c4cfff7888c.tar.bz2
linux-10a875f82b50adc83036368086df9c4cfff7888c.zip
f2fs: fix the fault of calculating blkstart twice
When the zone type is BLK_ZONE_TYPE_CONVENTIONAL, the blkstart is calculated twice. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 29ef7088c558..4d7bf84dc393 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -796,6 +796,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
struct block_device *bdev, block_t blkstart, block_t blklen)
{
sector_t sector, nr_sects;
+ block_t lblkstart = blkstart;
int devi = 0;
if (sbi->s_ndevs) {
@@ -813,7 +814,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
case BLK_ZONE_TYPE_CONVENTIONAL:
if (!blk_queue_discard(bdev_get_queue(bdev)))
return 0;
- return __f2fs_issue_discard_async(sbi, bdev, blkstart, blklen);
+ return __f2fs_issue_discard_async(sbi, bdev, lblkstart, blklen);
case BLK_ZONE_TYPE_SEQWRITE_REQ:
case BLK_ZONE_TYPE_SEQWRITE_PREF:
sector = SECTOR_FROM_BLOCK(blkstart);