common/fuzzy: try to clear blocking flags first in _scratch_fuzz_modify
authorGao Xiang <hsiangkao@redhat.com>
Fri, 12 Jun 2020 01:40:18 +0000 (09:40 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 21 Jun 2020 14:27:23 +0000 (22:27 +0800)
commit57eba17be8f840b9d642194bddb22c5d099fb09c
treec1873a97c595e62a6ae42b62ff8d2b5f4c060ddc
parent59877e5071652b2c5bcb11e922eeb39ad991ef43
common/fuzzy: try to clear blocking flags first in _scratch_fuzz_modify

When stressing xfs/083, I found it sometimes fails as the following:

+++ touch 50000 files
setfattr: /home/fsgqa/scratchmnt/INOBT/20627: Operation not permitted
./common/fuzzy: line 18: /home/fsgqa/scratchmnt/INOBT/20627: Operation not permitted
mv: cannot move '/home/fsgqa/scratchmnt/INOBT/20627' to '/home/fsgqa/scratchmnt/INOBT/20627.longer': Operation not permitted
...
xfs_repair did not fix everything

It's simply that INOBT/20627 was an immutable file generated from
fuzzing. Therefore, this patch tries to clear append, immutable flag
first before modification. Note that it clears dax flag as well
since it prevents immutable flag from clearing.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/fuzzy