Merge branch 'sendmsg.cifs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[platform/kernel/linux-rpi.git] / fs / cifs / connect.c
index e33c5e0..66736f5 100644 (file)
@@ -1139,8 +1139,12 @@ cifs_parse_devname(const char *devname, struct smb_vol *vol)
 
        convert_delimiter(vol->UNC, '\\');
 
-       /* If pos is NULL, or is a bogus trailing delimiter then no prepath */
-       if (!*pos++ || !*pos)
+       /* skip any delimiter */
+       if (*pos == '/' || *pos == '\\')
+               pos++;
+
+       /* If pos is NULL then no prepath */
+       if (!*pos)
                return 0;
 
        vol->prepath = kstrdup(pos, GFP_KERNEL);
@@ -2861,7 +2865,7 @@ static inline void
 cifs_reclassify_socket4(struct socket *sock)
 {
        struct sock *sk = sock->sk;
-       BUG_ON(sock_owned_by_user(sk));
+       BUG_ON(!sock_allow_reclassification(sk));
        sock_lock_init_class_and_name(sk, "slock-AF_INET-CIFS",
                &cifs_slock_key[0], "sk_lock-AF_INET-CIFS", &cifs_key[0]);
 }
@@ -2870,7 +2874,7 @@ static inline void
 cifs_reclassify_socket6(struct socket *sock)
 {
        struct sock *sk = sock->sk;
-       BUG_ON(sock_owned_by_user(sk));
+       BUG_ON(!sock_allow_reclassification(sk));
        sock_lock_init_class_and_name(sk, "slock-AF_INET6-CIFS",
                &cifs_slock_key[1], "sk_lock-AF_INET6-CIFS", &cifs_key[1]);
 }
@@ -3573,7 +3577,7 @@ try_mount_again:
        cifs_sb->rsize = server->ops->negotiate_rsize(tcon, volume_info);
 
        /* tune readahead according to rsize */
-       cifs_sb->bdi.ra_pages = cifs_sb->rsize / PAGE_CACHE_SIZE;
+       cifs_sb->bdi.ra_pages = cifs_sb->rsize / PAGE_SIZE;
 
 remote_path_check:
 #ifdef CONFIG_CIFS_DFS_UPCALL