xfs: fix xfs_get_extsz_hint for a zero extent size hint
We can easily set the extsize flag without setting an extent size hint, or one that evaluates to zero. Historically the di_extsize field was only used when it was non-zero, but the commit "Cleanup inode extent size hint extraction" broke this. Restore the old behaviour, thus fixing xfsqa 090 with a debug kernel. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
parent
04e99455ea
commit
0d8b30ad19
@ -173,17 +173,9 @@ xfs_extlen_t
|
|||||||
xfs_get_extsz_hint(
|
xfs_get_extsz_hint(
|
||||||
struct xfs_inode *ip)
|
struct xfs_inode *ip)
|
||||||
{
|
{
|
||||||
xfs_extlen_t extsz;
|
if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
|
||||||
|
return ip->i_d.di_extsize;
|
||||||
if (unlikely(XFS_IS_REALTIME_INODE(ip))) {
|
if (XFS_IS_REALTIME_INODE(ip))
|
||||||
extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
|
return ip->i_mount->m_sb.sb_rextsize;
|
||||||
? ip->i_d.di_extsize
|
return 0;
|
||||||
: ip->i_mount->m_sb.sb_rextsize;
|
|
||||||
ASSERT(extsz);
|
|
||||||
} else {
|
|
||||||
extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
|
|
||||||
? ip->i_d.di_extsize : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return extsz;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user