lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] f2fs: fix to check f2fs_compressed_file() in f2fs_bmap()
Date
Otherwise, for compressed inode, returned physical block address
may be wrong.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fs/f2fs/data.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 24643680489b..f22f3ba10a48 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3591,6 +3591,8 @@ static sector_t f2fs_bmap(struct address_space *mapping, sector_t block)

if (f2fs_has_inline_data(inode))
return 0;
+ if (f2fs_compressed_file(inode))
+ return 0;

/* make sure allocating whole blocks */
if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
--
2.18.0.rc1
\
 
 \ /
  Last update: 2020-03-27 11:31    [W:0.103 / U:8.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site