return 0
}
+
+# check that inject.f2fs supports to inject specific field in specific meta area
+_require_inject_f2fs_command()
+{
+ _require_command "$F2FS_INJECT_PROG" inject.f2fs
+
+ if [ $# -ne 2 ]; then
+ echo "Usage: _require_inject_f2fs_command metaarea member" 1>&2
+ _exit 1
+ fi
+ metaarea=$1
+ member=$2
+
+ case $metaarea in
+ sb|cp|nat|sit)
+ val=0
+ ;;
+ ssa|node|dent)
+ ;;
+ *)
+ _notrun "unsupport metaarea: $metaarea"
+ ;;
+ esac
+
+ $F2FS_INJECT_PROG "--$metaarea" "$val" "-h" | grep "$member:" > /dev/null || \
+ _notrun "--$metaarea --mb $member support is missing"
+}
_begin_fstest auto quick
_require_scratch
-_require_command "$F2FS_INJECT_PROG" inject.f2fs
+_require_inject_f2fs_command node i_links
_require_command "$(type -P socket)" socket
_fixed_by_git_commit f2fs-tools 958cd6e \
export LC_ALL=C.UTF-8
_require_scratch_nocheck
_require_command "$F2FS_IO_PROG" f2fs_io
-_require_command "$F2FS_INJECT_PROG" inject.f2fs
+_require_inject_f2fs_command dent d_hash
#check whether f2fs supports "lookup_mode=x" mount option
mntopt=""
"f2fs: fix to avoid out-of-boundary access in dnode page"
_require_scratch_nocheck
-_require_command "$F2FS_INJECT_PROG" inject.f2fs
+_require_inject_f2fs_command node addr
# remove all mkfs options to avoid layout change of on-disk inode
export MKFS_OPTIONS=""
"f2fs: fix to do sanity check on ino and xnid"
_require_scratch_nocheck
-_require_command "$F2FS_INJECT_PROG" inject.f2fs
+_require_inject_f2fs_command node i_xattr_nid
_require_attrs user
# remove all mkfs options to avoid layout change of on-disk inode
"f2fs: fix to do sanity check on node footer for non inode dnode"
_require_scratch_nocheck
-_require_command "$F2FS_INJECT_PROG" inject.f2fs
+_require_inject_f2fs_command node i_nid
# remove all mkfs options to avoid layout change of on-disk inode
export MKFS_OPTIONS=""