diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-02 15:08:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-02 15:08:29 -0500 |
commit | cacf02df4b84d261d76db3d290ccb6b951df28c0 (patch) | |
tree | 5f0655ff89210626854c747566b934e2e562830a /fs/cifs/file.c | |
parent | 74673fc50babc9be22b32c4ce697fceb51c7671a (diff) | |
parent | fea170804b4dc44cd79f8cb1ce236f3a824951cd (diff) |
Merge tag '4.21-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs updates from Steve French:
- four fixes for stable
- improvements to DFS including allowing failover to alternate targets
- some small performance improvements
* tag '4.21-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: (39 commits)
cifs: update internal module version number
cifs: we can not use small padding iovs together with encryption
cifs: Minor Kconfig clarification
cifs: Always resolve hostname before reconnecting
cifs: Add support for failover in cifs_reconnect_tcon()
cifs: Add support for failover in smb2_reconnect()
cifs: Only free DFS target list if we actually got one
cifs: start DFS cache refresher in cifs_mount()
cifs: Use GFP_ATOMIC when a lock is held in cifs_mount()
cifs: Add support for failover in cifs_reconnect()
cifs: Add support for failover in cifs_mount()
cifs: remove set but not used variable 'sep'
cifs: Make use of DFS cache to get new DFS referrals
cifs: minor updates to documentation
cifs: check kzalloc return
cifs: remove set but not used variable 'server'
cifs: Use kzfree() to free password
cifs: Fix to use kmem_cache_free() instead of kfree()
cifs: update for current_kernel_time64() removal
cifs: Add DFS cache routines
...
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 6706328ce03f..5e405164394a 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -2617,11 +2617,13 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, | |||
2617 | if (rc) | 2617 | if (rc) |
2618 | break; | 2618 | break; |
2619 | 2619 | ||
2620 | cur_len = min_t(const size_t, len, wsize); | ||
2621 | |||
2620 | if (ctx->direct_io) { | 2622 | if (ctx->direct_io) { |
2621 | ssize_t result; | 2623 | ssize_t result; |
2622 | 2624 | ||
2623 | result = iov_iter_get_pages_alloc( | 2625 | result = iov_iter_get_pages_alloc( |
2624 | from, &pagevec, wsize, &start); | 2626 | from, &pagevec, cur_len, &start); |
2625 | if (result < 0) { | 2627 | if (result < 0) { |
2626 | cifs_dbg(VFS, | 2628 | cifs_dbg(VFS, |
2627 | "direct_writev couldn't get user pages " | 2629 | "direct_writev couldn't get user pages " |
@@ -2630,6 +2632,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, | |||
2630 | result, from->type, | 2632 | result, from->type, |
2631 | from->iov_offset, from->count); | 2633 | from->iov_offset, from->count); |
2632 | dump_stack(); | 2634 | dump_stack(); |
2635 | |||
2636 | rc = result; | ||
2637 | add_credits_and_wake_if(server, credits, 0); | ||
2633 | break; | 2638 | break; |
2634 | } | 2639 | } |
2635 | cur_len = (size_t)result; | 2640 | cur_len = (size_t)result; |
@@ -3313,13 +3318,16 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file, | |||
3313 | cur_len, &start); | 3318 | cur_len, &start); |
3314 | if (result < 0) { | 3319 | if (result < 0) { |
3315 | cifs_dbg(VFS, | 3320 | cifs_dbg(VFS, |
3316 | "couldn't get user pages (cur_len=%zd)" | 3321 | "couldn't get user pages (rc=%zd)" |
3317 | " iter type %d" | 3322 | " iter type %d" |
3318 | " iov_offset %zd count %zd\n", | 3323 | " iov_offset %zd count %zd\n", |
3319 | result, direct_iov.type, | 3324 | result, direct_iov.type, |
3320 | direct_iov.iov_offset, | 3325 | direct_iov.iov_offset, |
3321 | direct_iov.count); | 3326 | direct_iov.count); |
3322 | dump_stack(); | 3327 | dump_stack(); |
3328 | |||
3329 | rc = result; | ||
3330 | add_credits_and_wake_if(server, credits, 0); | ||
3323 | break; | 3331 | break; |
3324 | } | 3332 | } |
3325 | cur_len = (size_t)result; | 3333 | cur_len = (size_t)result; |