summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsmap.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-05 09:54:49 +0200
committerIngo Molnar <mingo@kernel.org>2017-06-05 09:54:49 +0200
commit4241119eeb14f762e2d7f6e7c52afd22cea1de37 (patch)
tree655a153ca0517acb93b1eea776bad49ce5d8b050 /fs/xfs/xfs_fsmap.c
parentmm, x86/mm: Make the batched unmap TLB flush API more generic (diff)
parentLinux 4.12-rc4 (diff)
downloadlinux-4241119eeb14f762e2d7f6e7c52afd22cea1de37.tar.xz
linux-4241119eeb14f762e2d7f6e7c52afd22cea1de37.zip
Merge tag 'v4.12-rc4' into x86/mm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/xfs/xfs_fsmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
index 3683819887a5..814ed729881d 100644
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -828,6 +828,7 @@ xfs_getfsmap(
struct xfs_fsmap dkeys[2]; /* per-dev keys */
struct xfs_getfsmap_dev handlers[XFS_GETFSMAP_DEVS];
struct xfs_getfsmap_info info = { NULL };
+ bool use_rmap;
int i;
int error = 0;
@@ -837,12 +838,14 @@ xfs_getfsmap(
!xfs_getfsmap_is_valid_device(mp, &head->fmh_keys[1]))
return -EINVAL;
+ use_rmap = capable(CAP_SYS_ADMIN) &&
+ xfs_sb_version_hasrmapbt(&mp->m_sb);
head->fmh_entries = 0;
/* Set up our device handlers. */
memset(handlers, 0, sizeof(handlers));
handlers[0].dev = new_encode_dev(mp->m_ddev_targp->bt_dev);
- if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+ if (use_rmap)
handlers[0].fn = xfs_getfsmap_datadev_rmapbt;
else
handlers[0].fn = xfs_getfsmap_datadev_bnobt;