CIFS: remove endian related sparse warning
authorSteve French <smfrench@gmail.com>
Sun, 27 Aug 2017 21:56:08 +0000 (16:56 -0500)
committerSteve French <smfrench@gmail.com>
Wed, 30 Aug 2017 19:43:11 +0000 (14:43 -0500)
Recent patch had an endian warning ie
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()

Signed-off-by: Steve French <smfrench@gmail.com>
CC: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
Acked-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/dir.c

index 569d3fb736be070d2693f600f867bd836aeb1dc4..e702d48bd023411f3bbed69c6cc6a571f2fc059c 100644 (file)
@@ -205,7 +205,7 @@ check_name(struct dentry *direntry, struct cifs_tcon *tcon)
        int i;
 
        if (unlikely(direntry->d_name.len >
-                    tcon->fsAttrInfo.MaxPathNameComponentLength))
+                    le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength)))
                return -ENAMETOOLONG;
 
        if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {