Commit 121dd68a authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into hostme.bitkeeper.com:/ua/repos/c/cifs/linux-2.5cifs
parents 13d67773 6b29b7bc
......@@ -393,7 +393,7 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
{
struct address_space *mapping = page->mapping;
loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
char * write_data = kmap(page);
char * write_data;
int rc = -EFAULT;
int bytes_written = 0;
struct cifs_sb_info *cifs_sb;
......@@ -411,6 +411,7 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
/* figure out which file struct to use
if (file->private_data == NULL) {
kunmap(page);
FreeXid(xid);
return -EBADF;
}
......@@ -424,9 +425,11 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
}
offset += (loff_t)from;
write_data = kmap(page);
write_data += from;
if((to > PAGE_CACHE_SIZE) || (from > to) || (offset > mapping->host->i_size)) {
kunmap(page);
FreeXid(xid);
return -EIO;
}
......@@ -459,6 +462,7 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
rc = -EIO;
}
kunmap(page);
FreeXid(xid);
return rc;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment