lkml.org 
[lkml]   [2018]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] fs/ext2/inode: Fix a type cast error for fsdax
Date
From: Huaisheng Ye <yehs1@lenovo.com>

The type of offset within struct iomap is loff_t, which represents
file offset of mapping.

In ext2_iomap_begin, iomap->offset shall be given a type cast as
loff_t instead of u64.

Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
---
fs/ext2/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 7163590..ca211bd 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -816,7 +816,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,

iomap->flags = 0;
iomap->bdev = inode->i_sb->s_bdev;
- iomap->offset = (u64)first_block << blkbits;
+ iomap->offset = (loff_t)first_block << blkbits;
iomap->dax_dev = sbi->s_daxdev;

if (ret == 0) {
--
1.8.3.1

\
 
 \ /
  Last update: 2018-07-01 08:36    [W:0.049 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site