CIFS: remove endian related sparse warning
authorSteve French <smfrench@gmail.com>
Sun, 27 Aug 2017 21:56:08 +0000 (16:56 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:36 +0000 (13:34 +0000)
commit 6e3c1529c39e92ed64ca41d53abadabbaa1d5393 upstream.

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>
Acked-by: Pavel Shilovsky <pshilov@microsoft.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/dir.c

index 1c4b50f..a1c99c4 100644 (file)
@@ -522,7 +522,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 
        /* Don't allow path components longer than the server max. */
        if (unlikely(direntry->d_name.len >
-                    pTcon->fsAttrInfo.MaxPathNameComponentLength)) {
+                    le32_to_cpu(pTcon->fsAttrInfo.MaxPathNameComponentLength))) {
                rc = -ENAMETOOLONG;
                goto lookup_out;
        }