提交 a62e82b3 编写于 作者: C Christoph Hellwig 提交者: Dave Chinner

xfs: fix the same_inode check in xfs_file_share_range

The VFS i_ino is an unsigned long, while XFS inode numbers are 64-bit
wide, so checking i_ino for equality could lead to rate false positives
on 32-bit architectures.  Just compare the inode pointers themselves
to be safe.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 4fbc2c65
......@@ -965,7 +965,7 @@ xfs_file_share_range(
IS_SWAPFILE(inode_out))
return -ETXTBSY;
same_inode = (inode_in->i_ino == inode_out->i_ino);
same_inode = (inode_in == inode_out);
/* Don't reflink dirs, pipes, sockets... */
if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册