Merge tag '4.21-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Jan 2019 20:08:29 +0000 (12:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Jan 2019 20:08:29 +0000 (12:08 -0800)
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
  ...

1  2 
fs/cifs/file.c

diff --combined fs/cifs/file.c
index 6706328ce03f89fc3eabc82f6b01779011c533c5,c23bf9da93d2bf4891bdaff01137f87a6a73f8b9..5e405164394a1c0287d8a6b7e348fe1292bccec3
@@@ -1103,10 -1103,10 +1103,10 @@@ try_again
        rc = posix_lock_file(file, flock, NULL);
        up_write(&cinode->lock_sem);
        if (rc == FILE_LOCK_DEFERRED) {
 -              rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next);
 +              rc = wait_event_interruptible(flock->fl_wait, !flock->fl_blocker);
                if (!rc)
                        goto try_again;
 -              posix_unblock_lock(flock);
 +              locks_delete_block(flock);
        }
        return rc;
  }
@@@ -2617,11 -2617,13 +2617,13 @@@ cifs_write_from_iter(loff_t offset, siz
                if (rc)
                        break;
  
+               cur_len = min_t(const size_t, len, wsize);
                if (ctx->direct_io) {
                        ssize_t result;
  
                        result = iov_iter_get_pages_alloc(
-                               from, &pagevec, wsize, &start);
+                               from, &pagevec, cur_len, &start);
                        if (result < 0) {
                                cifs_dbg(VFS,
                                        "direct_writev couldn't get user pages "
                                        result, from->type,
                                        from->iov_offset, from->count);
                                dump_stack();
+                               rc = result;
+                               add_credits_and_wake_if(server, credits, 0);
                                break;
                        }
                        cur_len = (size_t)result;
@@@ -3313,13 -3318,16 +3318,16 @@@ cifs_send_async_read(loff_t offset, siz
                                        cur_len, &start);
                        if (result < 0) {
                                cifs_dbg(VFS,
-                                       "couldn't get user pages (cur_len=%zd)"
+                                       "couldn't get user pages (rc=%zd)"
                                        " iter type %d"
                                        " iov_offset %zd count %zd\n",
                                        result, direct_iov.type,
                                        direct_iov.iov_offset,
                                        direct_iov.count);
                                dump_stack();
+                               rc = result;
+                               add_credits_and_wake_if(server, credits, 0);
                                break;
                        }
                        cur_len = (size_t)result;