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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
禁止转载,如需转载请通过简信或评论联系作者。

相关阅读更多精彩内容

友情链接更多精彩内容