On Fri, 21 Oct 2011 10:14:04 +0400 Pavel Shilovsky <piastry@xxxxxxxxxxx> wrote: > In cifs_readv_receive we don't update rdata->result to error value > after kmap'ing a page. We should kunmap the page in the no error > case only. > > Signed-off-by: Pavel Shilovsky <piastry@xxxxxxxxxxx> > --- > fs/cifs/cifssmb.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c > index 949e121..5c81cd4 100644 > --- a/fs/cifs/cifssmb.c > +++ b/fs/cifs/cifssmb.c > @@ -1667,9 +1667,9 @@ cifs_readv_complete(struct work_struct *work) > list_for_each_entry_safe(page, tpage, &rdata->pages, lru) { > list_del(&page->lru); > lru_cache_add_file(page); > - kunmap(page); > > if (rdata->result == 0) { > + kunmap(page); > flush_dcache_page(page); > SetPageUptodate(page); > } Forehead slap... Correct. We only kmap the page if the rdata->result == 0. We do need to unconditionally unlock the page though. Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html