Skip to content

Commit

Permalink
CIFS: Fix error handling in cifs_readv_complete
Browse files Browse the repository at this point in the history
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@etersoft.ru>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
  • Loading branch information
Pavel Shilovsky authored and Steve French committed Oct 21, 2011
1 parent b957ae9 commit a2d6b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,9 +1619,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);
}
Expand Down

0 comments on commit a2d6b6c

Please sign in to comment.