diff options
author | Qu Wenruo <wqu@suse.com> | 2021-09-27 15:21:59 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 19:08:04 +0200 |
commit | 4c162778d63eb8822492f715dbe06970d242b4fd (patch) | |
tree | 2edb2d1741531a2a6b7d106ce7f7cc7d912c9ee2 /fs/btrfs/inode.c | |
parent | btrfs: cleanup for extent_write_locked_range() (diff) | |
download | linux-dev-4c162778d63eb8822492f715dbe06970d242b4fd.tar.xz linux-dev-4c162778d63eb8822492f715dbe06970d242b4fd.zip |
btrfs: subpage: make compress_file_range() compatible
In function compress_file_range(), when the compression is finished, the
function just rounds up @total_in to PAGE_SIZE. This is fine for
regular sectorsize == PAGE_SIZE case, but not for subpage.
Just change the ALIGN(, PAGE_SIZE) to round_up(, sectorsize) so that
both regular sectorsize and subpage sectorsize will be happy.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index aaeb2192b24d..dd91f4e60fb6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -758,7 +758,7 @@ cont: * win, compare the page count read with the blocks on disk, * compression must free at least one sector size */ - total_in = ALIGN(total_in, PAGE_SIZE); + total_in = round_up(total_in, fs_info->sectorsize); if (total_compressed + blocksize <= total_in) { compressed_extents++; |