Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Jan 2016 20:31:12 +0000 (12:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Jan 2016 20:31:12 +0000 (12:31 -0800)
Pull SMB3 fixes from Steve French:
 "A collection of CIFS/SMB3 fixes.

  It includes a couple bug fixes, a few for improved debugging of
  cifs.ko and some improvements to the way cifs does key generation.

  I do have some additional bug fixes I expect in the next week or two
  (to address a problem found by xfstest, and some fixes for SMB3.11
  dialect, and a couple patches that just came in yesterday that I am
  reviewing)"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
  cifs: fix race between call_async() and reconnect()
  Prepare for encryption support (first part). Add decryption and encryption key generation. Thanks to Metze for helping with this.
  cifs: Allow using O_DIRECT with cache=loose
  cifs: Make echo interval tunable
  cifs: Check uniqueid for SMB2+ and return -ESTALE if necessary
  Print IP address of unresponsive server
  cifs: Ratelimit kernel log messages

1  2 
fs/cifs/cifsfs.c

diff --combined fs/cifs/cifsfs.c
@@@ -507,6 -507,8 +507,8 @@@ cifs_show_options(struct seq_file *s, s
  
        seq_printf(s, ",rsize=%u", cifs_sb->rsize);
        seq_printf(s, ",wsize=%u", cifs_sb->wsize);
+       seq_printf(s, ",echo_interval=%lu",
+                       tcon->ses->server->echo_interval / HZ);
        /* convert actimeo and display it in seconds */
        seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);
  
@@@ -640,9 -642,9 +642,9 @@@ cifs_get_root(struct smb_vol *vol, stru
                while (*s && *s != sep)
                        s++;
  
 -              mutex_lock(&dir->i_mutex);
 +              inode_lock(dir);
                child = lookup_one_len(p, dentry, s - p);
 -              mutex_unlock(&dir->i_mutex);
 +              inode_unlock(dir);
                dput(dentry);
                dentry = child;
        } while (!IS_ERR(dentry));
@@@ -752,6 -754,9 +754,9 @@@ cifs_loose_read_iter(struct kiocb *iocb
        ssize_t rc;
        struct inode *inode = file_inode(iocb->ki_filp);
  
+       if (iocb->ki_filp->f_flags & O_DIRECT)
+               return cifs_user_readv(iocb, iter);
        rc = cifs_revalidate_mapping(inode);
        if (rc)
                return rc;
@@@ -766,6 -771,18 +771,18 @@@ static ssize_t cifs_file_write_iter(str
        ssize_t written;
        int rc;
  
+       if (iocb->ki_filp->f_flags & O_DIRECT) {
+               written = cifs_user_writev(iocb, from);
+               if (written > 0 && CIFS_CACHE_READ(cinode)) {
+                       cifs_zap_mapping(inode);
+                       cifs_dbg(FYI,
+                                "Set no oplock for inode=%p after a write operation\n",
+                                inode);
+                       cinode->oplock = 0;
+               }
+               return written;
+       }
        written = cifs_get_writer(cinode);
        if (written)
                return written;
@@@ -1092,7 -1109,7 +1109,7 @@@ cifs_init_inodecache(void
        cifs_inode_cachep = kmem_cache_create("cifs_inode_cache",
                                              sizeof(struct cifsInodeInfo),
                                              0, (SLAB_RECLAIM_ACCOUNT|
 -                                              SLAB_MEM_SPREAD),
 +                                              SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                              cifs_init_once);
        if (cifs_inode_cachep == NULL)
                return -ENOMEM;