mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 22:24:11 +08:00
xfs: reinstate delalloc for RT inodes (if sb_rextsize == 1)
Commit aff3a9edb7
("xfs: Use preallocation for inodes with extsz
hints") disabled delayed allocation for all inodes with extent size
hints due a data exposure problem. It turns out we fixed this data
exposure problem since by always creating unwritten extents for
delalloc conversions due to more data exposure problems, but the
writeback path doesn't actually support extent size hints when
converting delalloc these days, which probably isn't a problem given
that people using the hints know what they get.
However due to the way how xfs_get_extsz_hint is implemented, it
always claims an extent size hint for RT inodes even if the RT
extent size is a single FSB. Due to that the above commit effectively
disabled delalloc support for RT inodes.
Switch xfs_get_extsz_hint to return 0 for this case and work around
that in a few places to reinstate delalloc support for RT inodes on
file systems with an sb_rextsize of 1.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
This commit is contained in:
parent
bd1753d8c4
commit
6a94b1acda
@ -58,7 +58,8 @@ xfs_get_extsz_hint(
|
||||
return 0;
|
||||
if ((ip->i_diflags & XFS_DIFLAG_EXTSIZE) && ip->i_extsize)
|
||||
return ip->i_extsize;
|
||||
if (XFS_IS_REALTIME_INODE(ip))
|
||||
if (XFS_IS_REALTIME_INODE(ip) &&
|
||||
ip->i_mount->m_sb.sb_rextsize > 1)
|
||||
return ip->i_mount->m_sb.sb_rextsize;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1001,8 +1001,6 @@ xfs_buffered_write_iomap_begin(
|
||||
return xfs_direct_write_iomap_begin(inode, offset, count,
|
||||
flags, iomap, srcmap);
|
||||
|
||||
ASSERT(!XFS_IS_REALTIME_INODE(ip));
|
||||
|
||||
error = xfs_qm_dqattach(ip);
|
||||
if (error)
|
||||
return error;
|
||||
|
@ -525,7 +525,7 @@ xfs_stat_blksize(
|
||||
* always return the realtime extent size.
|
||||
*/
|
||||
if (XFS_IS_REALTIME_INODE(ip))
|
||||
return XFS_FSB_TO_B(mp, xfs_get_extsz_hint(ip));
|
||||
return XFS_FSB_TO_B(mp, xfs_get_extsz_hint(ip) ? : 1);
|
||||
|
||||
/*
|
||||
* Allow large block sizes to be reported to userspace programs if the
|
||||
|
@ -1341,6 +1341,8 @@ xfs_bmap_rtalloc(
|
||||
int error;
|
||||
|
||||
align = xfs_get_extsz_hint(ap->ip);
|
||||
if (!align)
|
||||
align = 1;
|
||||
retry:
|
||||
error = xfs_bmap_extsize_align(mp, &ap->got, &ap->prev,
|
||||
align, 1, ap->eof, 0,
|
||||
|
Loading…
Reference in New Issue
Block a user