To get started, you'll need to get bcachefs from the kernel repository
https://evilpiepirate.org/git/bcachefs.git/
and tools from
https://evilpiepirate.org/git/bcache-tools.git/
Build kernel as normal, enabling CONFIG_BCACHEFS_FS (and probably
CONFIG_BCACHEFS_DEBUG), and build and install tools. Then running
fstests is exactly the same as other local filesystems - just set
FSTYP=bcachefs
Also see https://evilpiepirate.org/git/ktest.git/ for a tool for
conveniently building kernel and running fstests inside a qemu VM.
This patch also updates generic/441 to run the more thorough test on
bcachefs, and generic/425 to not run on bcachefs (since bcachefs does
not store xattrs in blocks)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
+ bcachefs)
+ echo 251
+ ;;
9p|ceph|nfs)
MAX_ATTRVAL_SIZE=65536
;;
9p|ceph|nfs)
MAX_ATTRVAL_SIZE=65536
;;
+bcachefs)
+ MAX_ATTRVAL_SIZE=1024
+ ;;
*)
# Assume max ~1 block of attrs
BLOCK_SIZE=`_get_block_size $TEST_DIR`
*)
# Assume max ~1 block of attrs
BLOCK_SIZE=`_get_block_size $TEST_DIR`
btrfs)
export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS"
;;
btrfs)
export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS"
;;
+ bcachefs)
+ export MKFS_OPTIONS=$BCACHEFS_MKFS_OPTIONS
+ ;;
_notrun "Installed kernel does not support quotas"
fi
;;
_notrun "Installed kernel does not support quotas"
fi
;;
;;
xfs)
if [ ! -f /proc/fs/xfs/xqmstat ]; then
;;
xfs)
if [ ! -f /proc/fs/xfs/xqmstat ]; then
VFS_QUOTA=0
case $FSTYP in
VFS_QUOTA=0
case $FSTYP in
- ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2)
+ ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2|bcachefs)
VFS_QUOTA=1
quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
;;
VFS_QUOTA=1
quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
;;
fi
export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
;;
fi
export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
;;
+ bcachefs)
+ $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV
+ ;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
;;
ocfs2)
yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize $SCRATCH_DEV
;;
ocfs2)
yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize $SCRATCH_DEV
;;
+ bcachefs)
+ ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS --block_size=$blocksize $SCRATCH_DEV
+ ;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized"
;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized"
;;
+ bcachefs)
+ # With bcachefs, if fsck detects any errors we consider it a bug and we
+ # want the test to fail:
+ _check_scratch_fs
+ ;;
*)
local dev=$SCRATCH_DEV
local fstyp=$FSTYP
*)
local dev=$SCRATCH_DEV
local fstyp=$FSTYP
# real QA test starts here
_supported_fs generic
# real QA test starts here
_supported_fs generic
+
+[ $FSTYP = bcachefs ] && _notrun "bcachefs does not store xattrs in blocks"
+
_require_scratch
_require_attrs
_require_xfs_io_command "fiemap" "-a"
_require_scratch
_require_attrs
_require_xfs_io_command "fiemap" "-a"
btrfs)
_notrun "btrfs has a specialized test for this"
;;
btrfs)
_notrun "btrfs has a specialized test for this"
;;
+ ext3|ext4|xfs|bcachefs)
# Do the more thorough test if we have a logdev
_has_logdev && sflag=''
;;
# Do the more thorough test if we have a logdev
_has_logdev && sflag=''
;;