diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8a49b2e77d37..e9dcf5ee29a2 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1146,7 +1146,7 @@ static int cifs_writepages(struct address_space *mapping, | |||
1146 | pgoff_t end; | 1146 | pgoff_t end; |
1147 | pgoff_t index; | 1147 | pgoff_t index; |
1148 | int range_whole = 0; | 1148 | int range_whole = 0; |
1149 | struct kvec iov[32]; | 1149 | struct kvec * iov; |
1150 | int len; | 1150 | int len; |
1151 | int n_iov = 0; | 1151 | int n_iov = 0; |
1152 | pgoff_t next; | 1152 | pgoff_t next; |
@@ -1171,15 +1171,21 @@ static int cifs_writepages(struct address_space *mapping, | |||
1171 | if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) | 1171 | if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) |
1172 | if(cifs_sb->tcon->ses->server->secMode & | 1172 | if(cifs_sb->tcon->ses->server->secMode & |
1173 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | 1173 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) |
1174 | if(!experimEnabled) | 1174 | if(!experimEnabled) |
1175 | return generic_writepages(mapping, wbc); | 1175 | return generic_writepages(mapping, wbc); |
1176 | 1176 | ||
1177 | iov = kmalloc(32 * sizeof(struct kvec), GFP_KERNEL); | ||
1178 | if(iov == NULL) | ||
1179 | return generic_writepages(mapping, wbc); | ||
1180 | |||
1181 | |||
1177 | /* | 1182 | /* |
1178 | * BB: Is this meaningful for a non-block-device file system? | 1183 | * BB: Is this meaningful for a non-block-device file system? |
1179 | * If it is, we should test it again after we do I/O | 1184 | * If it is, we should test it again after we do I/O |
1180 | */ | 1185 | */ |
1181 | if (wbc->nonblocking && bdi_write_congested(bdi)) { | 1186 | if (wbc->nonblocking && bdi_write_congested(bdi)) { |
1182 | wbc->encountered_congestion = 1; | 1187 | wbc->encountered_congestion = 1; |
1188 | kfree(iov); | ||
1183 | return 0; | 1189 | return 0; |
1184 | } | 1190 | } |
1185 | 1191 | ||
@@ -1345,7 +1351,7 @@ retry: | |||
1345 | mapping->writeback_index = index; | 1351 | mapping->writeback_index = index; |
1346 | 1352 | ||
1347 | FreeXid(xid); | 1353 | FreeXid(xid); |
1348 | 1354 | kfree(iov); | |
1349 | return rc; | 1355 | return rc; |
1350 | } | 1356 | } |
1351 | 1357 | ||