diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-08-10 17:00:31 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-08-18 18:46:00 -0700 |
commit | 7e1826e05ba62e85fe110939a181c8f0d58c14cf (patch) | |
tree | 682ea2002ee359e5d9605625342023c10579aa6e /fs/xfs/xfs_trace.h | |
parent | 9ab72f22277487d2a3ffc8dd20fc918e186bb2b3 (diff) | |
download | linux-7e1826e05ba62e85fe110939a181c8f0d58c14cf.tar.bz2 |
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/xfs_trace.h')
0 files changed, 0 insertions, 0 deletions