Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12074
b: refs/heads/master
c: 84d2f07
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Oct 12, 2005
1 parent fdcdefb commit 7571046
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47c786e79b46ef478a1123cb57c711ecb481cbfa
refs/heads/master: 84d2f07e8e5e2424eec0f5acfef6792c924a0549
15 changes: 13 additions & 2 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ static int cifs_writepages(struct address_space *mapping,
pgoff_t index;
int is_range = 0;
struct kvec iov[32];
int len;
int n_iov = 0;
pgoff_t next;
int nr_pages;
Expand Down Expand Up @@ -1124,16 +1125,26 @@ static int cifs_writepages(struct address_space *mapping,
unlock_page(page);
break;
}

if (page_offset(page) >= mapping->host->i_size) {
done = 1;
unlock_page(page);
break;
}

/*
* BB can we get rid of this? pages are held by pvec
*/
page_cache_get(page);

len = min(mapping->host->i_size - page_offset(page),
(loff_t)PAGE_CACHE_SIZE);

/* reserve iov[0] for the smb header */
n_iov++;
iov[n_iov].iov_base = kmap(page);
iov[n_iov].iov_len = PAGE_CACHE_SIZE;
bytes_to_write += PAGE_CACHE_SIZE;
iov[n_iov].iov_len = len;
bytes_to_write += len;

if (first < 0) {
first = i;
Expand Down

0 comments on commit 7571046

Please sign in to comment.