Re: [f2fs-dev] [PATCH 1/3] f2fs: call flush_dcache_page when the page was updated
From: Jaegeuk Kim
Date: Thu Nov 20 2014 - 01:45:39 EST
On Thu, Nov 20, 2014 at 03:04:10PM +0900, Changman Lee wrote:
> Hi Jaegeuk,
>
> We should call flush_dcache_page before kunmap because the purpose of the cache flush is to address aliasing problem related to virtual address.
Oh, I just followed zero_user_segments below.
static inline void zero_user_segments(struct page *page,
unsigned start1, unsigned end1,
unsigned start2, unsigned end2)
{
void *kaddr = kmap_atomic(page);
BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE);
if (end1 > start1)
memset(kaddr + start1, 0, end1 - start1);
if (end2 > start2)
memset(kaddr + start2, 0, end2 - start2);
kunmap_atomic(kaddr);
flush_dcache_page(page);
}
Is this a wrong reference? Or, a bug?
Anyway I modified as below.
Thanks,