Skip to content
Snippets Groups Projects
  • Frank Zago's avatar
    86d26552
    LU-9468 llite: fix for stat under kthread and X86_X32 · 86d26552
    Frank Zago authored
    
    Under the following conditions, ll_getattr will flatten the inode
    number when it shouldn't:
    
      - the X86_X32 architecture is defined CONFIG_X86_X32, and not even
        used,
      - ll_getattr is called from a kernel thread (though vfs_getattr for
        instance.)
    
    This has the result that inode numbers are different whether the same
    file is stat'ed from a kernel thread, or from a syscall. For instance,
    4198401 vs. 144115205272502273.
    
    ll_getattr calls ll_need_32bit_api to determine whether the task is 32
    bits. When the combination is kthread+X86_X32, that function returns
    that the task is 32 bits, which is incorrect, as the kernel is 64
    bits.
    
    The solution is to check whether the call is from a kernel thread
    (which is 64 bits) and act consequently.
    
    Added test_410 to test the condition. A failed run will have a message like this:
    
      lustre_kinode_54354: CONFIG_X86_X32 is set
      lustre_kinode_54354: inode is 144115205272502273
      lustre_kinode_54354: inode is 4198401
      lustre_kinode_54354: inode numbers are different: 144115205272502273 4198401
    
    while a successfull one will be:
    
      lustre_kinode_10519: CONFIG_X86_X32 is set
      lustre_kinode_10519: inode is 144115205272502275
      lustre_kinode_10519: inode is 144115205272502275
      lustre_kinode_10519: inode numbers are identical: 144115205272502275
    
    Signed-off-by: default avatarFrank Zago <fzago@cray.com>
    Change-Id: Ib8f07de47eaa29046a61c488368d466f9096a994
    Reviewed-on: https://review.whamcloud.com/26992
    
    
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    86d26552
    History
    LU-9468 llite: fix for stat under kthread and X86_X32
    Frank Zago authored
    
    Under the following conditions, ll_getattr will flatten the inode
    number when it shouldn't:
    
      - the X86_X32 architecture is defined CONFIG_X86_X32, and not even
        used,
      - ll_getattr is called from a kernel thread (though vfs_getattr for
        instance.)
    
    This has the result that inode numbers are different whether the same
    file is stat'ed from a kernel thread, or from a syscall. For instance,
    4198401 vs. 144115205272502273.
    
    ll_getattr calls ll_need_32bit_api to determine whether the task is 32
    bits. When the combination is kthread+X86_X32, that function returns
    that the task is 32 bits, which is incorrect, as the kernel is 64
    bits.
    
    The solution is to check whether the call is from a kernel thread
    (which is 64 bits) and act consequently.
    
    Added test_410 to test the condition. A failed run will have a message like this:
    
      lustre_kinode_54354: CONFIG_X86_X32 is set
      lustre_kinode_54354: inode is 144115205272502273
      lustre_kinode_54354: inode is 4198401
      lustre_kinode_54354: inode numbers are different: 144115205272502273 4198401
    
    while a successfull one will be:
    
      lustre_kinode_10519: CONFIG_X86_X32 is set
      lustre_kinode_10519: inode is 144115205272502275
      lustre_kinode_10519: inode is 144115205272502275
      lustre_kinode_10519: inode numbers are identical: 144115205272502275
    
    Signed-off-by: default avatarFrank Zago <fzago@cray.com>
    Change-Id: Ib8f07de47eaa29046a61c488368d466f9096a994
    Reviewed-on: https://review.whamcloud.com/26992
    
    
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>