Skip to content

Commit

Permalink
xfs: recognize the reflink feature bit
Browse files Browse the repository at this point in the history
Add the reflink feature flag to the set of recognized feature flags.
This enables users to write to reflink filesystems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Darrick J. Wong committed Oct 5, 2016
1 parent a35eb41 commit e54b5bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/xfs/libxfs/xfs_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ xfs_sb_has_compat_feature(
#define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /* reflinked files */
#define XFS_SB_FEAT_RO_COMPAT_ALL \
(XFS_SB_FEAT_RO_COMPAT_FINOBT | \
XFS_SB_FEAT_RO_COMPAT_RMAPBT)
XFS_SB_FEAT_RO_COMPAT_RMAPBT | \
XFS_SB_FEAT_RO_COMPAT_REFLINK)
#define XFS_SB_FEAT_RO_COMPAT_UNKNOWN ~XFS_SB_FEAT_RO_COMPAT_ALL
static inline bool
xfs_sb_has_ro_compat_feature(
Expand Down
7 changes: 7 additions & 0 deletions fs/xfs/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,9 @@ xfs_fs_fill_super(
"DAX unsupported by block device. Turning off DAX.");
mp->m_flags &= ~XFS_MOUNT_DAX;
}
if (xfs_sb_version_hasreflink(&mp->m_sb))
xfs_alert(mp,
"DAX and reflink have not been tested together!");
}

if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
Expand All @@ -1627,6 +1630,10 @@ xfs_fs_fill_super(
"EXPERIMENTAL reverse mapping btree feature enabled. Use at your own risk!");
}

if (xfs_sb_version_hasreflink(&mp->m_sb))
xfs_alert(mp,
"EXPERIMENTAL reflink feature enabled. Use at your own risk!");

error = xfs_mountfs(mp);
if (error)
goto out_filestream_unmount;
Expand Down

0 comments on commit e54b5bf

Please sign in to comment.