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

Johannes Thumshirn
2022-03-25T10:12:31Z

On 25/03/2022 10:38, Qu Wenruo wrote:
> The original code is not really setting the memory to 0x00 but 0x01.
>
> To prevent such problem from happening, use memzero_page() instead.
>
> Since we're here, also make @len const since it's just sectorsize.

Any idea why we're setting it to 1? It's been this way since 07157aacb1ec
("Btrfs: Add file data csums back in via hooks in the extent map code")
which landed in v2.6.29. So basically since the dawn of time.