]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: ignore extent size hints for always COW inodes
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Oct 2019 17:07:21 +0000 (10:07 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 21 Oct 2019 16:04:58 +0000 (09:04 -0700)
There is no point in applying extent size hints for always COW inodes,
as we would just have to COW any extra allocation beyond the data
actually written.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_inode.c

index 18f4b262e61cee569c9e0ee06e7645c509e1b341..2e94deb4610aad7be06fce63765949961f9e8b69 100644 (file)
@@ -55,6 +55,12 @@ xfs_extlen_t
 xfs_get_extsz_hint(
        struct xfs_inode        *ip)
 {
+       /*
+        * No point in aligning allocations if we need to COW to actually
+        * write to them.
+        */
+       if (xfs_is_always_cow_inode(ip))
+               return 0;
        if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
                return ip->i_d.di_extsize;
        if (XFS_IS_REALTIME_INODE(ip))