From: Nitin Gupta <ngupta@vflare.org>
To: Jerome Marchand <jmarchan@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Linux Kernel List <linux-kernel@vger.kernel.org>,
Robert Jennings <rcj@linux.vnet.ibm.com>,
Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH 1/4] Staging: zram: Remove useless offset calculation in handle_uncompressed_page()
Date: Fri, 10 Jun 2011 09:38:00 -0700 [thread overview]
Message-ID: <4DF24868.3040900@vflare.org> (raw)
In-Reply-To: <1307712529-9757-1-git-send-email-jmarchan@redhat.com>
On 06/10/2011 06:28 AM, Jerome Marchand wrote:
> The offset of uncompressed page is always zero: handle_uncompressed_page()
> doesn't have to care about it.
>
> Signed-off-by: Jerome Marchand<jmarchan@redhat.com>
> ---
> drivers/staging/zram/zram_drv.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index aab4ec4..3305e1a 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -194,8 +194,7 @@ static void handle_uncompressed_page(struct zram *zram,
> unsigned char *user_mem, *cmem;
>
> user_mem = kmap_atomic(page, KM_USER0);
> - cmem = kmap_atomic(zram->table[index].page, KM_USER1) +
> - zram->table[index].offset;
> + cmem = kmap_atomic(zram->table[index].page, KM_USER1);
>
> memcpy(user_mem, cmem, PAGE_SIZE);
> kunmap_atomic(user_mem, KM_USER0);
kmap/kunmap requests needs to be strictly nested, so here kunmap(...,
KM_USER1) must be done before kunmap(..., KM_USER0). This needs to be
fixed in zram_bvec_read() also. Though these bugs are not introduced
by your patches, it would be nice to have them include them in your
patch series only.
Thanks for the fixes.
Nitin
prev parent reply other threads:[~2011-06-10 16:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 13:28 [PATCH 1/4] Staging: zram: Remove useless offset calculation in handle_uncompressed_page() Jerome Marchand
2011-06-10 13:28 ` [PATCH 2/4] Staging: zram: Refactor zram_read/write() functions Jerome Marchand
2011-06-10 13:28 ` [PATCH 3/4] Staging: zram: allow partial page operations Jerome Marchand
2011-06-10 13:28 ` [PATCH 4/4] Staging: zram: Replace mutex lock by a R/W semaphore Jerome Marchand
2011-06-10 16:46 ` Nitin Gupta
2011-06-10 16:41 ` [PATCH 3/4] Staging: zram: allow partial page operations Nitin Gupta
2011-06-13 9:42 ` Jerome Marchand
2011-06-14 14:49 ` Jeff Moyer
2011-06-14 16:36 ` Martin K. Petersen
2011-07-01 9:47 ` Jerome Marchand
2011-07-14 3:19 ` Nitin Gupta
2011-07-14 3:25 ` Nitin Gupta
2011-07-14 3:24 ` [PATCH 2/4] Staging: zram: Refactor zram_read/write() functions Nitin Gupta
2011-06-10 16:38 ` Nitin Gupta [this message]
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=4DF24868.3040900@vflare.org \
--to=ngupta@vflare.org \
--cc=gregkh@suse.de \
--cc=jmarchan@redhat.com \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rcj@linux.vnet.ibm.com \
/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