summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/agheader_repair.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-08-11 03:00:31 +0300
committerDarrick J. Wong <djwong@kernel.org>2021-08-19 04:46:00 +0300
commit7e1826e05ba62e85fe110939a181c8f0d58c14cf (patch)
tree682ea2002ee359e5d9605625342023c10579aa6e /fs/xfs/scrub/agheader_repair.c
parent9ab72f22277487d2a3ffc8dd20fc918e186bb2b3 (diff)
downloadlinux-7e1826e05ba62e85fe110939a181c8f0d58c14cf.tar.xz
xfs: make fsmap backend function key parameters const
There are several GETFSMAP backend functions for XFS to cover the three devices and various feature support. Each of these functions are passed pointers to the low and high keys for the dataset that userspace requested, and a pointer to scratchpad variables that are used to control the iteration and fill out records. The scratchpad data can be changed arbitrarily, but the keys are supposed to remain unchanged (and under the control of the outermost loop in xfs_getfsmap). Unfortunately, the data and rt backends modify the keys that are passed in from the main control loop, which causes subsequent calls to return incorrect query results. Specifically, each of those two functions set the block number in the high key to the size of their respective device. Since fsmap results are sorted in device number order, if the lower numbered device is smaller than the higher numbered device, the first function will set the high key to the small size, and the key remains unchanged as it is passed into the function for the higher numbered device. The second function will then fail to return all of the results for the dataset that userspace is asking for because the keyspace is incorrectly constrained. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Diffstat (limited to 'fs/xfs/scrub/agheader_repair.c')
0 files changed, 0 insertions, 0 deletions