Re: [PATCH RFC 8/8] xfs: skip local format inode for reflinking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2018年07月06日 11:26, Darrick J. Wong wrote:
On Fri, Jul 06, 2018 at 11:12:29AM +0800, Shan Hai wrote:
The local format inode holds the data inline in its data fork and
has no extents at all, so skip the inode for reflinking.

Signed-off-by: Shan Hai <shan.hai@xxxxxxxxxx>
---
  fs/xfs/xfs_reflink.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 592fb2071a03..dfb3a85ec0e6 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -1507,6 +1507,12 @@ xfs_reflink_inode_has_shared_extents(
  	int				error;
ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
+
+	if (ifp->if_flags & XFS_IFINLINE) {
+		*has_shared = false;
+		return 0;
+	}
What happens if someone tries to reflink and either src or dest are an
inline file?

I have to re-check this, thanks for the suggestion.

Thanks
Shan Hai
--D

+
  	if (!(ifp->if_flags & XFS_IFEXTENTS)) {
  		error = xfs_iread_extents(tp, ip, XFS_DATA_FORK);
  		if (error)
--
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux