ligurio / unreliablefs

A FUSE-based fault injection filesystem.
https://ligurio.github.io/unreliablefs/unreliablefs.1.html
MIT License
173 stars 9 forks source link

plz give me some help #127

Open yumdeer opened 3 weeks ago

yumdeer commented 3 weeks ago

I don't quite understand the difference between mountpoint and -basedir path, and how the config file is called by the unreliablefs binary.

In addition, I don’t quite understand the regular expression for setting matching file operations. Are there any enumeration values ​​available?

It seems that the //unreliablefs.conf path is forced to be specified, but -base_dir does not take effect in my system.

the code :

# cat /tmp/fs/unreliablefs.conf
[errinj_noop]
op_regexp    = .*
path_regexp  = .*
probability  = 30

# ./unreliablefs /tmp/fs -d -base_dir=/tmp -seed=1618680646
random seed = 1618680646
read configuration //unreliablefs.conf
enabled error injection errinj_slowdown
[errinj_slowdown] op_regexp = .*
[errinj_slowdown] path_regexp = .*
[errinj_slowdown] probability = 30
[errinj_slowdown] duration = 100
enabled error injection errinj_noop
[errinj_noop] path_regexp = .*
[errinj_noop] op_regexp = .*
[errinj_noop] probability = 70
enabled error injection errinj_errno
[errinj_errno] path_regexp = *.xlog
[errinj_errno] probability = 4
starting FUSE filesystem unreliablefs
fuse: unknown option(s): `-base_dir=/tmp'

# busyboxhm.elf vi //unreliablefs.conf

Can you give me more help?

yumdeer commented 3 weeks ago

In addition, i got same question as : https://github.com/ligurio/unreliablefs/issues/124

# echo -1000 > /proc/6575/oom_score_adj
# unique: 22, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672
LOOKUP /log
getattr[NULL] /log
errinj 'errinj_slowdown' skipped: probability (30) is not matched
errinj 'errinj_noop' skipped: probability (70) is not matched
errinj 'errinj_errno' skipped: probability (4) is not matched
   NODEID: 3
   unique: 22, success, outsize: 144
unique: 24, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672
LOOKUP /log
getattr[NULL] /log
errinj 'errinj_slowdown' skipped: probability (30) is not matched
errinj 'errinj_noop' skipped: probability (70) is not matched
errinj 'errinj_errno' skipped: probability (4) is not matched
   NODEID: 3
   unique: 24, success, outsize: 144
unique: 26, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672
LOOKUP /log
getattr[NULL] /log
errinj 'errinj_slowdown' skipped: probability (30) is not matched
errinj 'errinj_noop' skipped: probability (70) is not matched
regcomp: No error information
errinj 'errinj_errno' skipped: path_regexp (*.xlog) is not matched
   NODEID: 3
   unique: 26, success, outsize: 144

# cd /data
unique: 28, opcode: ACCESS (34), nodeid: 1, insize: 48, pid: 5179
access / 01
errinj_slowdown triggered on operation 'access', /
start of 'access' slowdown for '1000000000' ns
ls
unique: 30, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672
LOOKUP /log
getattr[NULL] /log
end of 'access' slowdown with '1000000000' ns
errinj 'errinj_noop' skipped: probability (70) is not matched
errinj 'errinj_errno' skipped: probability (4) is not matched
errinj 'errinj_slowdown' skipped: probability (30) is not matched
   unique: 28, success, outsize: 16
errinj_noop triggered on operation 'getattr', /log
errinj 'errinj_errno' skipped: probability (4) is not matched
   NODEID: 3
   unique: 30, success, outsize: 144
# lsunique: 32, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672

LOOKUP /log
getattr[NULL] /log
unique: 34, opcode: FORGET (2), nodeid: 3, insize: 48, pid: 0
FORGET 3/4
errinj_slowdown triggered on operation 'getattr', /log
start of 'getattr' slowdown for '1000000000' ns
unique: 36, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 6656
getattr[NULL] /
cd /daend of 'getattr' slowdown with '1000000000' ns
errinj_noop triggered on operation 'getattr', /log
errinj 'errinj_errno' skipped: probability (4) is not matched
   NODEID: 3
   unique: 32, success, outsize: 144
errinj 'errinj_slowdown' skipped: probability (30) is not matched
errinj_noop triggered on operation 'getattr', /
errinj 'errinj_errno' skipped: probability (4) is not matched
   unique: 36, success, outsize: 120
ls: .: I/O error
unique: 38, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 672
LOOKUP /log
getattr[NULL] /log
errinj_slowdown triggered on operation 'getattr', /log
start of 'getattr' slowdown for '1000000000' ns
# cd /dataend of 'getattr' slowdown with '1000000000' ns
errinj_noop triggered on operation 'getattr', /log
errinj 'errinj_errno' skipped: probability (4) is not matched
   NODEID: 3
   unique: 38, success, outsize: 144
mobil
/bin/sh: cd: /datamobil: No such file or directory
#
#
#
# cd /data/
# ls
ls: .: I/O error
#
# ls
ls: .: I/O error