lkml.org 
[lkml]   [2010]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] exofs: confusion between kmap() and kmap_atomic() api
On 05/07/2010 12:05 PM, Dan Carpenter wrote:
> For kmap_atomic() we call kunmap_atomic() on the returned pointer.
> That's different from kmap() and kunmap() and so it's easy to get them
> backwards.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>

Thank you Dan, I'll push it ASAP.

Looks like a bad bug. So this is actually a leak, right? kunmap_atomic
would detect the bad pointer and do nothing?

Thanks again
Boaz

> diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c
> index 4cfab1c..d91e9d8 100644
> --- a/fs/exofs/dir.c
> +++ b/fs/exofs/dir.c
> @@ -608,7 +608,7 @@ int exofs_make_empty(struct inode *inode, struct inode *parent)
> de->inode_no = cpu_to_le64(parent->i_ino);
> memcpy(de->name, PARENT_DIR, sizeof(PARENT_DIR));
> exofs_set_de_type(de, inode);
> - kunmap_atomic(page, KM_USER0);
> + kunmap_atomic(kaddr, KM_USER0);
> err = exofs_commit_chunk(page, 0, chunk_size);
> fail:
> page_cache_release(page);



\
 
 \ /
  Last update: 2010-05-09 12:19    [W:0.449 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site