UPSTREAM: f2fs: include non-compressed blocks in compr_written_block

Need to include non-compressed blocks in compr_written_block to
estimate average compression ratio more accurately.

Bug: 254441685
Fixes: 5ac443e26a09 ("f2fs: add sysfs nodes to get runtime compression stat")
Cc: stable@vger.kernel.org
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 09631cf3234d32156e7cae32275f5a4144c683c5)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I6d241fbac3b03f4083457da8c4f079a59c80b42e
This commit is contained in:
Daeho Jeong 2021-10-06 10:49:10 -07:00 committed by Lee Jones
parent 8599a67e73
commit b3609875ce

View File

@ -1469,6 +1469,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
if (cluster_may_compress(cc)) {
err = f2fs_compress_pages(cc);
if (err == -EAGAIN) {
add_compr_block_stat(cc->inode, cc->cluster_size);
goto write;
} else if (err) {
f2fs_put_rpages_wbc(cc, wbc, true, 1);