Skip to content

Commit 7487856

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to avoid double unlock
On image that has verity and compression feature, if compressed pages and non-compressed pages are mixed in one bio, we may double unlock non-compressed page in below flow: - f2fs_post_read_work - f2fs_decompress_work - f2fs_decompress_bio - __read_end_io - unlock_page - fsverity_enqueue_verify_work - f2fs_verity_work - f2fs_verify_bio - unlock_page So it should skip handling non-compressed page in f2fs_decompress_work() if verity is on. Besides, add missing dec_page_count() in f2fs_verify_bio(). Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 7653b9d commit 7487856

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/f2fs/data.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ static void __read_end_io(struct bio *bio, bool compr, bool verity)
139139
f2fs_decompress_pages(bio, page, verity);
140140
continue;
141141
}
142+
if (verity)
143+
continue;
142144
#endif
143145

144146
/* PG_error was set if any post_read step failed */
@@ -216,6 +218,7 @@ static void f2fs_verify_bio(struct bio *bio)
216218
ClearPageUptodate(page);
217219
ClearPageError(page);
218220
unlock:
221+
dec_page_count(F2FS_P_SB(page), __read_io_type(page));
219222
unlock_page(page);
220223
}
221224
}

0 commit comments

Comments
 (0)