]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Fix cifs_uniqueid_to_ino_t() function for s390x
authorYadan Fan <ydfan@novell.com>
Mon, 29 Feb 2016 06:44:57 +0000 (14:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Mar 2016 23:34:50 +0000 (15:34 -0800)
commitbbb3c5076be5c932609524db605e7911ecb95b47
tree988cdd721e58d6eec59f39f39a2e34ed4db7b949
parentb52a395883fa5b793137d57d90e1fd980e42748f
Fix cifs_uniqueid_to_ino_t() function for s390x

commit 1ee9f4bd1a97026a7b2d7ae9f1f74b45680d0003 upstream.

This issue is caused by commit 02323db17e3a7 ("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: Yadan Fan <ydfan@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifsfs.h