summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/tempfile.c
AgeCommit message (Collapse)Author
2021-12-15xfs: convert symlink repair to use swapextrepair-symlink-swapext_2021-12-15Darrick J. Wong
Convert the symlink repair code to use extent swapping. This means we can eliminate the problem of symlinks with crosslinked blocks. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: disable the agi rotor for metadata inodesDarrick J. Wong
Ideally, we'd put all the metadata inodes in one place if we could, so that the metadata all stay reasonably close together instead of spreading out over the disk. Furthermore, if the log is internal we'd probably prefer to keep the metadata near the log. Therefore, disable AGI rotoring for metadata inode allocations. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: wrap inode creation dqalloc callsDarrick J. Wong
Create a helper that calls dqalloc to allocate and grab a reference to dquots for the user, group, and project ids listed in an icreate structure. This simplifies the creat-related dqalloc callsites scattered around the code base. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: pack icreate initialization parameters into a separate structureDarrick J. Wong
Callers that want to create an inode currently pass all possible file attribute values for the new inode into xfs_init_new_inode as ten separate parameters. This causes two code maintenance issues: first, we have large multi-line call sites which programmers must read carefully to make sure they did not accidentally invert a value. Second, all three file id parameters must be passed separately to the quota functions; any discrepancy results in quota count errors. Clean this up by creating a new icreate_args structure to hold all this information, some helpers to initialize them properly, and make the callers pass this structure through to the creation function, whose name we shorten to xfs_icreate. This eliminates the issues, enables us to keep the inode init code in sync with userspace via libxfs, and is needed for future metadata directory tree management. (A subsequent cleanup will also fix the quota alloc calls.) Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: repair extended attributesDarrick J. Wong
If the extended attributes look bad, try to sift through the rubble to find whatever keys/values we can, stage a new attribute structure in a temporary file and use the atomic extent swapping mechanism to commit the results in bulk. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: online repair of realtime summariesrepair-rtsummary_2021-12-15Darrick J. Wong
Repair the realtime summary data by constructing a new rtsummary file in the scrub temporary file, then atomically swapping the contents. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-12-15xfs: create temporary files and directories for online repairDarrick J. Wong
Teach the online repair code how to create temporary files or directories. These temporary files can be used to stage reconstructed information until we're ready to perform an atomic extent swap to commit the new metadata. Signed-off-by: Darrick J. Wong <djwong@kernel.org>