| To: | david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH 41/71] xfs: don't allow realtime and reflinked files to mix |
| From: | "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> |
| Date: | Thu, 25 Aug 2016 16:50:57 -0700 |
| Cc: | linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <147216879156.4420.2446767701729565218.stgit@xxxxxxxxxxxxxxxx> |
| References: | <147216879156.4420.2446767701729565218.stgit@xxxxxxxxxxxxxxxx> |
| User-agent: | StGit/0.17.1-dirty |
We don't support sharing blocks on the realtime device.
Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
libxfs/xfs_inode_buf.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 8a804e2..2966d54 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -384,6 +384,9 @@ xfs_dinode_verify(
xfs_ino_t ino,
struct xfs_dinode *dip)
{
+ uint16_t flags;
+ uint64_t flags2;
+
if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC))
return false;
@@ -400,6 +403,19 @@ xfs_dinode_verify(
return false;
if (!uuid_equal(&dip->di_uuid, &mp->m_sb.sb_meta_uuid))
return false;
+
+ flags = be16_to_cpu(dip->di_flags);
+ flags2 = be64_to_cpu(dip->di_flags2);
+
+ /* don't allow reflink/cowextsize if we don't have reflink */
+ if ((flags2 & (XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE)) &&
+ !xfs_sb_version_hasreflink(&mp->m_sb))
+ return false;
+
+ /* don't let reflink and realtime mix */
+ if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags & XFS_DIFLAG_REALTIME))
+ return false;
+
return true;
}
|
| Previous by Date: | [PATCH 40/71] xfs: convert unwritten status of shared-extent reverse mappings on shared files, Darrick J. Wong |
|---|---|
| Next by Date: | [PATCH 42/71] xfs: don't mix reflink and DAX mode for now, Darrick J. Wong |
| Previous by Thread: | [PATCH 40/71] xfs: convert unwritten status of shared-extent reverse mappings on shared files, Darrick J. Wong |
| Next by Thread: | [PATCH 42/71] xfs: don't mix reflink and DAX mode for now, Darrick J. Wong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |