• Yadan Fan's avatar
    Fix cifs_uniqueid_to_ino_t() function for s390x · bbb3c507
    Yadan Fan authored
    commit 1ee9f4bd upstream.
    
    This issue is caused by commit 02323db1 ("cifs: fix
    cifs_uniqueid_to_ino_t not to ever return 0"), when BITS_PER_LONG
    is 64 on s390x, the corresponding cifs_uniqueid_to_ino_t()
    function will cast 64-bit fileid to 32-bit by using (ino_t)fileid,
    because ino_t (typdefed __kernel_ino_t) is int type.
    
    It's defined in arch/s390/include/uapi/asm/posix_types.h
    
        #ifndef __s390x__
    
        typedef unsigned long   __kernel_ino_t;
        ...
        #else /* __s390x__ */
    
        typedef unsigned int    __kernel_ino_t;
    
    So the #ifdef condition is wrong for s390x, we can just still use
    one cifs_uniqueid_to_ino_t() function with comparing sizeof(ino_t)
    and sizeof(u64) to choose the correct execution accordingly.
    Signed-off-by: default avatarYadan Fan <ydfan@suse.com>
    Signed-off-by: default avatarSteve French <smfrench@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    bbb3c507
cifsfs.h 5.86 KB