lkml.org 
[lkml]   [2015]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] SQUASHME: Streamline pmem.c
From
Date
On Thu, 2015-03-26 at 19:02 +0200, Boaz Harrosh wrote:
> static void pmem_do_bvec(struct pmem_device *pmem, struct page *page,
> unsigned int len, unsigned int off, int rw,
> sector_t sector)
> {
> void *mem = kmap_atomic(page);
> + size_t pmem_off = sector << 9;
> +
> + BUG_ON(pmem_off >= pmem->size);

This check should take 'len' into account so we don't copy off the end of our
PMEM space.

We should also just return -EIO back up to pmem_make_request() and have that
fail the bio, as opposed to doing the drastic BUG_ON.




\
 
 \ /
  Last update: 2015-03-27 00:01    [W:0.273 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site