Details
-
Technical task
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
3
-
9223372036854775807
Description
This issue can be reproduced by the following test case in sanityn.sh:
local dir=$DIR/$tdir
local f=$dir/f
local policy=$(do_facet mds1 $LCTL get_param -n \
mdd.*.trash_can_delete_policy | head -n1)
local trash=$MOUNT/.lustre/trash
trash_setup "uid"
stack_trap "do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param \
mdd.*.trash_can_delete_policy=$policy"
mkdir_on_mdt0 $dir || error "failed to mkdir $dir"
pfid=$(path2fid $dir)
# The first time to rm $f
touch $f || error "failed to touch $f"
rm $f || error "failed to rm $f"
rm $trash/MDT0000/0/$pfid/$(basename $f) ||
error "failed to rm $f from trash"
# This combination is important.
tree $trash
[[ ! -e $trash/MDT0000/0/$pfid/$(basename $f) ]] ||
error "$(basename $f) should not be in trash"
# The second time to rm $f
touch $f || error "failed to touch $f"
rm $f || error "failed to rm $f"
ls -al $trash/MDT0000/0/$pfid/
getfattr -n trusted.unrm $trash/MDT0000/0/$pfid/$(basename $f)
tree $trash
rm $trash/MDT0000/0/$pfid/$(basename $f) ||
error "failed to rm $f from trash"
You can see the file can't be stated correctly in the trash and can't be removed in the second time:
mdd.lustre-MDT0000.trash_can_enable=1
mdd.lustre-MDT0000.trash_can_type=uid
Trash Can Type:
uid
/mnt/lustre/.lustre/trash
`-- MDT0000
`-- 0
`-- 0x200000401:0x3:0x0
3 directories, 0 files
ls: cannot access '/mnt/lustre/.lustre/trash/MDT0000/0/0x200000401:0x3:0x0/f': No such file or directory
total 8
d--------- 2 root root 4096 Dec 16 21:08 .
d--------- 3 root root 4096 Dec 16 21:08 ..
-????????? ? ? ? ? ? f
getfattr: /mnt/lustre/.lustre/trash/MDT0000/0/0x200000401:0x3:0x0/f: No such file or directory
/mnt/lustre/.lustre/trash
`-- MDT0000
`-- 0
`-- 0x200000401:0x3:0x0
3 directories, 0 files
rm: cannot remove '/mnt/lustre/.lustre/trash/MDT0000/0/0x200000401:0x3:0x0/f': No such file or directory