Skip to content

Commit a86d27d

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: compress: add sanity check during compressed cluster read
In f2fs_read_multi_pages(), we don't have to check cluster's type again, since overwrite or partial truncation need page lock in cluster which has already been held by reader, so cluster's type is stable, let's change check condition to sanity check. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 8fa4101 commit a86d27d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/f2fs/data.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,9 +2170,7 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
21702170
if (ret)
21712171
goto out;
21722172

2173-
/* cluster was overwritten as normal cluster */
2174-
if (dn.data_blkaddr != COMPRESS_ADDR)
2175-
goto out;
2173+
f2fs_bug_on(sbi, dn.data_blkaddr != COMPRESS_ADDR);
21762174

21772175
for (i = 1; i < cc->cluster_size; i++) {
21782176
block_t blkaddr;

0 commit comments

Comments
 (0)