summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsmap.c
Commit message (Collapse)AuthorAgeFilesLines
* xfs: only return detailed fsmap info if the caller has CAP_SYS_ADMINDarrick J. Wong2017-05-161-1/+4
| | | | | | | | | | | | | | | There were a number of handwaving complaints that one could "possibly" use inode numbers and extent maps to fingerprint a filesystem hosting multiple containers and somehow use the information to guess at the contents of other containers and attack them. Despite the total lack of any demonstration that this is actually possible, it's easier to restrict access now and broaden it later, so use the rmapbt fsmap backends only if the caller has CAP_SYS_ADMIN. Unprivileged users will just have to make do with only getting the free space and static metadata placement information. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
* xfs: use NULL instead of 0 to initialize a pointer in xfs_getfsmapChristoph Hellwig2017-04-251-1/+1
| | | | | | | | Found by sparse. 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>
* xfs: report realtime space information via the rtbitmapDarrick J. Wong2017-04-041-1/+119
| | | | | | | | Use the realtime bitmap to return free space information via getfsmap. Eventually this will be superseded by the realtime rmapbt code. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
* xfs: have getfsmap fall back to the freesp btrees when rmap is not presentDarrick J. Wong2017-04-041-3/+69
| | | | | | | | | | If the reverse-mapping btree isn't available, fall back to the free space btrees to provide partial reverse mapping information. The online scrub tool can make use of even partial information to speed up the data block scan. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
* xfs: implement the GETFSMAP ioctlDarrick J. Wong2017-04-041-0/+756
Introduce a new ioctl that uses the reverse mapping btree to return information about the physical layout of the filesystem. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>