public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Dan Carpenter <error27@gmail.com>,
	Benny Halevy <bhalevy@panasas.com>,
	Avishay Traeger <avishay@gmail.com>,
	osd-dev@open-osd.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] exofs: confusion between kmap() and kmap_atomic() api
Date: Sun, 09 May 2010 13:16:38 +0300	[thread overview]
Message-ID: <4BE68B86.50707@panasas.com> (raw)
In-Reply-To: <20100507090532.GD27064@bicker>

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);


  reply	other threads:[~2010-05-09 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07  9:05 [patch] exofs: confusion between kmap() and kmap_atomic() api Dan Carpenter
2010-05-09 10:16 ` Boaz Harrosh [this message]
2010-05-10 16:15   ` Dan Carpenter
2010-05-10 23:03   ` Andrew Morton
2010-05-11  8:05     ` Boaz Harrosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE68B86.50707@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=avishay@gmail.com \
    --cc=bhalevy@panasas.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox