Value too large for defined data type

问题引入:

linux编程出错: Value too large for defined data type

本地硬盘没问题,挂载的盘报此错

# mount 

挂载的盘属性是inode64类型

理论依据

man xfs

 

inode32|inode64

       When inode32 is specified, it indicates that XFS limits inode creation to locations which will not result in inode numbers with more than 32 bits of  signifi‐

       cance.

 

       When  inode64  is  specified,  it indicates that XFS is allowed to create inodes at any location in the filesystem, including those which will result in inode

       numbers occupying more than 32 bits of significance.

 

       inode32 is provided for backwards compatibility with older systems and applications, since 64 bits inode numbers might cause problems  for  some  applications

       that cannot handle large inode numbers.  If applications are in use which do not handle inode numbers bigger than 32 bits, the inode32 option should be speci‐

       fied.

 

       For kernel v3.7 and later, inode64 is the default.
  • inode32最多能表达数字是4294967295,如果文件属性中的inode超过这个上限,就说明是inode64的。

  • 比较老的交叉编译器,只支持32位inode的文件访问,当遇到超过4294967295的文件,就会编译出错并提示:Value too large for defined data type

解决方案

  • 升级交叉编译器版本,让其支持inode64的源文件。

  • 交叉编译器版本不变,将文件系统挂载属性从inode64改为inode32。

参考文章:

https://blog.csdn.net/benkaoya/article/details/47260731

你可能感兴趣的:(Value too large for defined data type)