* [PATCH 1/2] xfs/122: update for the getfsrefs ioctl
2023-12-31 20:02 ` [PATCHSET 1/2] fstests: functional test for refcount reporting Darrick J. Wong
@ 2023-12-27 14:06 ` Darrick J. Wong
2023-12-27 14:06 ` [PATCH 2/2] xfs: test output of new FSREFCOUNTS ioctl Darrick J. Wong
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-27 14:06 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
From: Darrick J. Wong <djwong@kernel.org>
Add this new ioctl here too.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
tests/xfs/122.out | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/xfs/122.out b/tests/xfs/122.out
index 9c2d2fffb4..4d7e6c1eb4 100644
--- a/tests/xfs/122.out
+++ b/tests/xfs/122.out
@@ -101,6 +101,8 @@ sizeof(struct xfs_fsop_ag_resblks) = 64
sizeof(struct xfs_fsop_geom) = 256
sizeof(struct xfs_fsop_geom_v1) = 112
sizeof(struct xfs_fsop_geom_v4) = 112
+sizeof(struct xfs_getfsrefs) = 64
+sizeof(struct xfs_getfsrefs_head) = 192
sizeof(struct xfs_getparents) = 96
sizeof(struct xfs_getparents_rec) = 24
sizeof(struct xfs_icreate_log) = 28
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] xfs: test output of new FSREFCOUNTS ioctl
2023-12-31 20:02 ` [PATCHSET 1/2] fstests: functional test for refcount reporting Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for the getfsrefs ioctl Darrick J. Wong
@ 2023-12-27 14:06 ` Darrick J. Wong
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-27 14:06 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
From: Darrick J. Wong <djwong@kernel.org>
Make sure the cursors work properly and that refcounts are correct.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
common/rc | 4 +
doc/group-names.txt | 1
tests/xfs/1921 | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/1921.out | 4 +
4 files changed, 175 insertions(+), 2 deletions(-)
create mode 100755 tests/xfs/1921
create mode 100644 tests/xfs/1921.out
diff --git a/common/rc b/common/rc
index 2d67f7dff1..84e509e49b 100644
--- a/common/rc
+++ b/common/rc
@@ -2640,8 +2640,8 @@ _require_xfs_io_command()
echo $testio | grep -q "Operation not supported" && \
_notrun "O_TMPFILE is not supported"
;;
- "fsmap")
- testio=`$XFS_IO_PROG -f -c "fsmap" $testfile 2>&1`
+ "fsmap"|"fsrefcounts")
+ testio=`$XFS_IO_PROG -f -c "$command" $testfile 2>&1`
echo $testio | grep -q "Inappropriate ioctl" && \
_notrun "xfs_io $command support is missing"
;;
diff --git a/doc/group-names.txt b/doc/group-names.txt
index 4676825faf..9aec4a4ff8 100644
--- a/doc/group-names.txt
+++ b/doc/group-names.txt
@@ -57,6 +57,7 @@ freeze filesystem freeze tests
fsck general fsck tests
fsmap FS_IOC_GETFSMAP ioctl
fsr XFS free space reorganizer
+fsrefcounts FS_IOC_GETFSREFCOUNTS ioctl
fuzzers filesystem fuzz tests
growfs increasing the size of a filesystem
hardlink hardlinks
diff --git a/tests/xfs/1921 b/tests/xfs/1921
new file mode 100755
index 0000000000..28c05e16c7
--- /dev/null
+++ b/tests/xfs/1921
@@ -0,0 +1,168 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2021-2024 Oracle. All Rights Reserved.
+#
+# FS QA Test No. 1921
+#
+# Populate filesystem, check that fsrefcounts -n10000 matches fsrefcounts -n1,
+# then verify that the refcount information is consistent with the fsmap info.
+#
+. ./common/preamble
+_begin_fstest auto clone fsrefcounts fsmap
+
+# Override the default cleanup function.
+_cleanup()
+{
+ cd /
+ rm -rf $tmp.* $TEST_DIR/a $TEST_DIR/b
+}
+
+# Import common functions.
+. ./common/filter
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_xfs_io_command "fsmap"
+_require_xfs_io_command "fsrefcounts"
+
+echo "Format and mount"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+
+cpus=$(( $(src/feature -o) * 4))
+
+# Use fsstress to create a directory tree with some variability
+FSSTRESS_ARGS=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 4000 $FSSTRESS_AVOID)
+$FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full
+
+echo "Compare fsrefcounts" | tee -a $seqres.full
+$XFS_IO_PROG -c 'fsrefcounts -m -n 65536' $SCRATCH_MNT | grep -v 'EXT:' > $TEST_DIR/a
+$XFS_IO_PROG -c 'fsrefcounts -m -n 1' $SCRATCH_MNT | grep -v 'EXT:' > $TEST_DIR/b
+cat $TEST_DIR/a $TEST_DIR/b >> $seqres.full
+
+diff -uw $TEST_DIR/a $TEST_DIR/b
+
+echo "Compare fsrefcounts to fsmap" | tee -a $seqres.full
+$XFS_IO_PROG -c 'fsmap -m -n 65536' $SCRATCH_MNT | grep -v 'EXT:' > $TEST_DIR/b
+cat $TEST_DIR/b >> $seqres.full
+
+while IFS=',' read ext major minor pstart pend owners length crap; do
+ test "$ext" = "EXT" && continue
+
+ awk_args=(-'F' ',' '-v' "major=$major" '-v' "minor=$minor" \
+ '-v' "pstart=$pstart" '-v' "pend=$pend" '-v' "owners=$owners")
+
+ if [ "$owners" -eq 1 ]; then
+ $AWK_PROG "${awk_args[@]}" \
+'
+BEGIN {
+ printf("Q:%s:%s:%s:%s:%s:\n", major, minor, pstart, pend, owners) > "/dev/stderr";
+ next_map = -1;
+}
+{
+ if ($2 != major || $3 != minor) {
+ next;
+ }
+ if ($5 <= pstart) {
+ next;
+ }
+
+ printf(" A:%s:%s:%s:%s\n", $2, $3, $4, $5) > "/dev/stderr";
+ if (next_map < 0) {
+ if ($4 > pstart) {
+ exit 1
+ }
+ next_map = $5 + 1;
+ } else {
+ if ($4 != next_map) {
+ exit 1
+ }
+ next_map = $5 + 1;
+ }
+ if (next_map >= pend) {
+ nextfile;
+ }
+}
+END {
+ exit 0;
+}
+' $TEST_DIR/b 2> $tmp.debug
+ res=$?
+ else
+ $AWK_PROG "${awk_args[@]}" \
+'
+function max(a, b) {
+ return a > b ? a : b;
+}
+function min(a, b) {
+ return a < b ? a : b;
+}
+BEGIN {
+ printf("Q:%s:%s:%s:%s:%s:\n", major, minor, pstart, pend, owners) > "/dev/stderr";
+ refcount_whole = 0;
+ aborted = 0;
+}
+{
+ if ($2 != major || $3 != minor) {
+ next;
+ }
+ if ($4 >= pend) {
+ nextfile;
+ }
+ if ($5 <= pstart) {
+ next;
+ }
+ if ($6 == "special_0:2") {
+ /* unknown owner means we cannot distinguish separate owners */
+ aborted = 1;
+ exit 0;
+ }
+
+ printf(" A:%s:%s:%s:%s -> %d\n", $2, $3, $4, $5, refcount_whole) > "/dev/stderr";
+ if ($4 <= pstart && $5 >= pend) {
+ /* Account for extents that span the whole range */
+ refcount_whole++;
+ } else {
+ /* Otherwise track refcounts per-block as we find them */
+ for (block = max($4, pstart); block <= min($5, pend); block++) {
+ refcounts[block]++;
+ }
+ }
+}
+END {
+ if (aborted) {
+ exit 0;
+ }
+ deficit = owners - refcount_whole;
+ printf(" W:%d:%d\n", owners, refcount_whole, deficit) > "/dev/stderr";
+ if (deficit == 0) {
+ exit 0;
+ }
+
+ refcount_slivers = 0;
+ for (block in refcounts) {
+ printf(" X:%s:%d\n", block, refcounts[block]) > "/dev/stderr";
+ if (refcounts[block] == deficit) {
+ refcount_slivers = deficit;
+ } else {
+ exit 1;
+ }
+ }
+
+ refcount_whole += refcount_slivers;
+ exit owners == refcount_whole ? 0 : 1;
+}
+' $TEST_DIR/b 2> $tmp.debug
+ res=$?
+ fi
+ if [ $res -ne 0 ]; then
+ echo "$major,$minor,$pstart,$pend,$owners not found in fsmap"
+ cat $tmp.debug >> $seqres.full
+ break
+ fi
+done < $TEST_DIR/a
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/1921.out b/tests/xfs/1921.out
new file mode 100644
index 0000000000..f5ea660379
--- /dev/null
+++ b/tests/xfs/1921.out
@@ -0,0 +1,4 @@
+QA output created by 1921
+Format and mount
+Compare fsrefcounts
+Compare fsrefcounts to fsmap
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/2] xfs/122: update for XFS_IOC_MAP_FREESP
2023-12-31 20:02 ` [PATCHSET 2/2] fstests: defragment free space Darrick J. Wong
@ 2023-12-27 14:06 ` Darrick J. Wong
2023-12-27 14:07 ` [PATCH 2/2] xfs: test clearing of free space Darrick J. Wong
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-27 14:06 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
From: Darrick J. Wong <djwong@kernel.org>
Update this test to include the new free space mapping ioctl.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
tests/xfs/122.out | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/xfs/122.out b/tests/xfs/122.out
index 4d7e6c1eb4..3134cf1619 100644
--- a/tests/xfs/122.out
+++ b/tests/xfs/122.out
@@ -114,6 +114,7 @@ sizeof(struct xfs_legacy_timestamp) = 8
sizeof(struct xfs_log_dinode) = 176
sizeof(struct xfs_log_legacy_timestamp) = 8
sizeof(struct xfs_map_extent) = 32
+sizeof(struct xfs_map_freesp) = 32
sizeof(struct xfs_parent_name_rec) = 16
sizeof(struct xfs_phys_extent) = 16
sizeof(struct xfs_refcount_key) = 4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] xfs: test clearing of free space
2023-12-31 20:02 ` [PATCHSET 2/2] fstests: defragment free space Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for XFS_IOC_MAP_FREESP Darrick J. Wong
@ 2023-12-27 14:07 ` Darrick J. Wong
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-27 14:07 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
From: Darrick J. Wong <djwong@kernel.org>
Simple regression test for the spaceman clearspace command, which tries
to free all the used space in some part of the filesystem.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
common/rc | 5 +++
tests/xfs/1400 | 57 ++++++++++++++++++++++++++++++++++++
tests/xfs/1400.out | 2 +
tests/xfs/1401 | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/1401.out | 2 +
5 files changed, 148 insertions(+)
create mode 100755 tests/xfs/1400
create mode 100644 tests/xfs/1400.out
create mode 100755 tests/xfs/1401
create mode 100644 tests/xfs/1401.out
diff --git a/common/rc b/common/rc
index 84e509e49b..625494531d 100644
--- a/common/rc
+++ b/common/rc
@@ -2615,6 +2615,11 @@ _require_xfs_io_command()
-c "fsync" -c "$command $blocksize $((2 * $blocksize))" \
$testfile 2>&1`
;;
+ "fmapfree")
+ local blocksize=$(_get_file_block_size $TEST_DIR)
+ testio=`$XFS_IO_PROG -F -f -c "$command $blocksize $((2 * $blocksize))" \
+ $testfile 2>&1`
+ ;;
"fiemap")
# If 'ranged' is passed as argument then we check to see if fiemap supports
# ranged query params
diff --git a/tests/xfs/1400 b/tests/xfs/1400
new file mode 100755
index 0000000000..88a5e055d8
--- /dev/null
+++ b/tests/xfs/1400
@@ -0,0 +1,57 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022-2024 Oracle. All Rights Reserved.
+#
+# FS QA Test 1400
+#
+# Basic functionality testing for FALLOC_FL_MAP_FREE
+#
+. ./common/preamble
+_begin_fstest auto prealloc
+
+# Import common functions.
+. ./common/filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_require_scratch
+_require_xfs_io_command "fmapfree"
+
+_scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mount >> $seqres.full
+. $tmp.mkfs
+
+testfile="$SCRATCH_MNT/$seq.txt"
+touch $testfile
+if $XFS_IO_PROG -c 'stat -v' $testfile | grep -q 'realtime'; then
+ # realtime
+ increment=$((dbsize * rtblocks / 100))
+ length=$((dbsize * rtblocks))
+else
+ # data
+ increment=$((dbsize * dblocks / 100))
+ length=$((dbsize * dblocks))
+fi
+
+free_bytes=$(stat -f -c '%f * %S' $testfile | bc)
+
+echo "free space: $free_bytes; increment: $increment; length: $length" >> $seqres.full
+
+# Map all the free space on that device, 10% at a time
+for ((start = 0; start < length; start += increment)); do
+ $XFS_IO_PROG -f -c "fmapfree $start $increment" $testfile
+done
+
+space_used=$(stat -c '%b * %B' $testfile | bc)
+
+echo "space captured: $space_used" >> $seqres.full
+$FILEFRAG_PROG -v $testfile >> $seqres.full
+
+# Did we get within 10% of the free space?
+_within_tolerance "mapfree space used" $space_used $free_bytes 10% -v
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/1400.out b/tests/xfs/1400.out
new file mode 100644
index 0000000000..601404d7a4
--- /dev/null
+++ b/tests/xfs/1400.out
@@ -0,0 +1,2 @@
+QA output created by 1400
+mapfree space used is in range
diff --git a/tests/xfs/1401 b/tests/xfs/1401
new file mode 100755
index 0000000000..eabe7e18a9
--- /dev/null
+++ b/tests/xfs/1401
@@ -0,0 +1,82 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022-2024 Oracle. All Rights Reserved.
+#
+# FS QA Test No. 1401
+#
+# Basic functionality testing for the free space defragmenter.
+#
+. ./common/preamble
+_begin_fstest auto defrag shrinkfs
+
+# Override the default cleanup function.
+# _cleanup()
+# {
+# cd /
+# rm -r -f $tmp.*
+# }
+
+# Import common functions.
+. ./common/filter
+
+# real QA test starts here
+
+_notrun "XXX test is not ready yet; you need to deal with eof blocks"
+_notrun "XXX clearfree cannot move unwritten extents; does fiexchange work for this?"
+_notrun "XXX csp_buffercopy never returns if we hit eof"
+
+# Modify as appropriate.
+_supported_fs generic
+_require_scratch
+_require_xfs_spaceman_command "clearfree"
+
+_scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null
+cat $tmp.mkfs >> $seqres.full
+. $tmp.mkfs
+_scratch_mount >> $seqres.full
+
+cpus=$(( $(src/feature -o) * 4))
+
+# Use fsstress to create a directory tree with some variability
+FSSTRESS_ARGS=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 4000 $FSSTRESS_AVOID)
+$FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full
+
+$XFS_IO_PROG -c 'stat -v' $SCRATCH_MNT >> $seqres.full
+
+if $XFS_IO_PROG -c 'stat -v' $SCRATCH_MNT | grep -q 'rt-inherit'; then
+ # realtime
+ increment=$((dbsize * rtblocks / agcount))
+ length=$((dbsize * rtblocks))
+ fsmap_devarg="-r"
+else
+ # data
+ increment=$((dbsize * agsize))
+ length=$((dbsize * dblocks))
+ fsmap_devarg="-d"
+fi
+
+echo "start: $start; increment: $increment; length: $length" >> $seqres.full
+$DF_PROG $SCRATCH_MNT >> $seqres.full
+
+TRACE_PROG="strace -s99 -e fallocate,ioctl,openat -o $tmp.strace"
+
+for ((start = 0; start < length; start += increment)); do
+ echo "---------------------------" >> $seqres.full
+ echo "start: $start end: $((start + increment))" >> $seqres.full
+ echo "---------------------------" >> $seqres.full
+
+ fsmap_args="-vvvv $fsmap_devarg $((start / 512)) $((increment / 512))"
+ clearfree_args="-v all $start $increment"
+
+ $XFS_IO_PROG -c "fsmap $fsmap_args" $SCRATCH_MNT > $tmp.before
+ $TRACE_PROG $XFS_SPACEMAN_PROG -c "clearfree $clearfree_args" $SCRATCH_MNT &>> $seqres.full || break
+ cat $tmp.strace >> $seqres.full
+ $XFS_IO_PROG -c "fsmap $fsmap_args" $SCRATCH_MNT > $tmp.after
+ cat $tmp.before >> $seqres.full
+ cat $tmp.after >> $seqres.full
+done
+
+# success, all done
+echo Silence is golden
+status=0
+exit
diff --git a/tests/xfs/1401.out b/tests/xfs/1401.out
new file mode 100644
index 0000000000..504999381e
--- /dev/null
+++ b/tests/xfs/1401.out
@@ -0,0 +1,2 @@
+QA output created by 1401
+Silence is golden
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [NYE PATCHRIVER 4/4] xfs: freespace defrag for online shrink
@ 2023-12-31 18:25 Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 1/2] fstests: functional test for refcount reporting Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 2/2] fstests: defragment free space Darrick J. Wong
0 siblings, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-31 18:25 UTC (permalink / raw)
To: xfs, fstests
Hi everyone,
This fourth patchriver has two faces -- one way of looking at it is that
it is random odds and ends at the tail of my development tree. A second
interpretation is that it is necessary pieces for defragmenting free
space, which is a precursor for online shrink of XFS filesystems.
The kernel side isn't that exciting -- we export refcounting information
for space extents, and add a new fallocate mode for mapping exact
portions of free filesystem space into a file.
Userspace is where things get interesting! The free space defragmenter
is an iterative algorithm that assigns free space to a dummy file, and
then uses the GETFSMAP and GETFSREFCOUNTS information to target file
space extents in order of decreasing share counts. Once an extent has
been targeted, it uses reflinking to freeze the space, copies it
elsewhere, and uses FIDEDUPERANGE to remap existing file data until the
dummy file is the sole owner of the targetted space. If metadata are
involved, the defrag utility invokes online repair to rebuild the
metadata somewhere else.
Since last year, I've also merged in Dave's xfs_spaceman code to move
inodes. I've not had much time to play with it otherwise.
When the defragmenter finishes, all the free space has been isolated to
the dummy file, which can be unlinked and closed if defragmentation was
the goal; or it could be passed to a shrinkfs operation.
--D
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHSET 1/2] fstests: functional test for refcount reporting
2023-12-31 18:25 [NYE PATCHRIVER 4/4] xfs: freespace defrag for online shrink Darrick J. Wong
@ 2023-12-31 20:02 ` Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for the getfsrefs ioctl Darrick J. Wong
2023-12-27 14:06 ` [PATCH 2/2] xfs: test output of new FSREFCOUNTS ioctl Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 2/2] fstests: defragment free space Darrick J. Wong
1 sibling, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-31 20:02 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
Hi all,
Add a short functional test for the new GETFSREFCOUNTS ioctl that allows
userspace to query reference count information for a given range of
physical blocks.
If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.
This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.
--D
kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=report-refcounts
xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=report-refcounts
fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=report-refcounts
---
common/rc | 4 +
doc/group-names.txt | 1
tests/xfs/122.out | 2 +
tests/xfs/1921 | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/1921.out | 4 +
5 files changed, 177 insertions(+), 2 deletions(-)
create mode 100755 tests/xfs/1921
create mode 100644 tests/xfs/1921.out
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHSET 2/2] fstests: defragment free space
2023-12-31 18:25 [NYE PATCHRIVER 4/4] xfs: freespace defrag for online shrink Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 1/2] fstests: functional test for refcount reporting Darrick J. Wong
@ 2023-12-31 20:02 ` Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for XFS_IOC_MAP_FREESP Darrick J. Wong
2023-12-27 14:07 ` [PATCH 2/2] xfs: test clearing of free space Darrick J. Wong
1 sibling, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-31 20:02 UTC (permalink / raw)
To: djwong, zlang; +Cc: guan, linux-xfs, fstests
Hi all,
These patches contain experimental code to enable userspace to defragment
the free space in a filesystem. Two purposes are imagined for this
functionality: clearing space at the end of a filesystem before
shrinking it, and clearing free space in anticipation of making a large
allocation.
The first patch adds a new fallocate mode that allows userspace to
allocate free space from the filesystem into a file. The goal here is
to allow the filesystem shrink process to prevent allocation from a
certain part of the filesystem while a free space defragmenter evacuates
all the files from the doomed part of the filesystem.
The second patch amends the online repair system to allow the sysadmin
to forcibly rebuild metadata structures, even if they're not corrupt.
Without adding an ioctl to move metadata btree blocks, this is the only
way to dislodge metadata.
If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.
This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.
--D
kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=defrag-freespace
xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=defrag-freespace
fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=defrag-freespace
---
common/rc | 5 +++
tests/xfs/122.out | 1 +
tests/xfs/1400 | 57 ++++++++++++++++++++++++++++++++++++
tests/xfs/1400.out | 2 +
tests/xfs/1401 | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/1401.out | 2 +
6 files changed, 149 insertions(+)
create mode 100755 tests/xfs/1400
create mode 100644 tests/xfs/1400.out
create mode 100755 tests/xfs/1401
create mode 100644 tests/xfs/1401.out
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-01-01 1:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-31 18:25 [NYE PATCHRIVER 4/4] xfs: freespace defrag for online shrink Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 1/2] fstests: functional test for refcount reporting Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for the getfsrefs ioctl Darrick J. Wong
2023-12-27 14:06 ` [PATCH 2/2] xfs: test output of new FSREFCOUNTS ioctl Darrick J. Wong
2023-12-31 20:02 ` [PATCHSET 2/2] fstests: defragment free space Darrick J. Wong
2023-12-27 14:06 ` [PATCH 1/2] xfs/122: update for XFS_IOC_MAP_FREESP Darrick J. Wong
2023-12-27 14:07 ` [PATCH 2/2] xfs: test clearing of free space Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox