You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Almost always, the symlink target, which has a max size of 1024, fits within a block.
However, if the block size if 512 (default is 4k), at most three blocks are required to store the symlink target and headers. These three blocks could theoretically be distributed over multiple extents, where each extent has its own copy of the xfs_dsymlink_hdr symlink header structure.
Our implementation does not handle this edge case correctly. Do note that the probability of this happening is estimated to be very low.
To fix this, we need to
Allocate a buffer for the link target,
Iterate over the extents,
Read the header
Read xfs_dsymlink_hdr::sl_bytes of the link target and place the bytes at xfs_dsymlink_hdr::sl_offset in the allocated buffer for the link target.
To create a test case, the write command of the xfs_db tool can be used to create multiple extents:
Almost always, the symlink target, which has a max size of 1024, fits within a block.
However, if the block size if 512 (default is 4k), at most three blocks are required to store the symlink target and headers. These three blocks could theoretically be distributed over multiple extents, where each extent has its own copy of the
xfs_dsymlink_hdr
symlink header structure.Our implementation does not handle this edge case correctly.
Do note that the probability of this happening is estimated to be very low.
To fix this, we need to
xfs_dsymlink_hdr::sl_bytes
of the link target and place the bytes atxfs_dsymlink_hdr::sl_offset
in the allocated buffer for the link target.To create a test case, the
write
command of thexfs_db
tool can be used to create multiple extents:The text was updated successfully, but these errors were encountered: