Re: [PATCH] btrfs: replace a wrong memset() with memzero_page()

Christoph Hellwig
2022-03-25T16:38:22Z

On Fri, Mar 25, 2022 at 05:37:59PM +0800, Qu Wenruo wrote:
> - u32 len = fs_info->sectorsize;
> + const u32 len = fs_info->sectorsize;

Why the spurious and rather pointless const annotation that is unrelated
to the rest of the patch?

> BTRFS_DEV_STAT_CORRUPTION_ERRS);
> - memset(kaddr + pgoff, 1, len);
> + memzero_page(page, pgoff, len);
> flush_dcache_page(page);

memzero_page already takes care of the flush_dcache_page.