Up

Traces

linux[3.13.0-29-generic][system[GNU C Library (GNU libc) stable release version 2.21, by Roland McGrath et al.]][ext4_loop[mke2fs 1.42.9 (4-Feb-2014)]]@[2015-07-24T13:23:26Z./nix/store/fxisrpncjn4cxxwnq2lvilriqx63s9k9-fs_test]

Checked Trace
linux_spec@[/nix/store/fxisrpncjn4cxxwnq2lvilriqx63s9k9-fs_test] sexp stdout stderr
Traced Execution stdout stderr
Script script

Combined Trace

1 # processing file 'adhoc_unlink_count-int.trace' ...
2 @type trace
3
4 # ##########################################
5 # Test link count of files after unlink
6 # ##########################################
7
8 # a new created file should have link count 1
9
10 open_close "/f1.txt" [O_RDONLY;O_CREAT] 0o666
11 Tau
12 RV_none
13
14 # unlink the file should remove the file
15
16 unlink "/f1.txt"
17 Tau
18 RV_none
19 stat "/f1.txt"
20 Tau
21 ENOENT
22
23 # removing a linked file should reduce count of the link
24
25 open_close "/f1.txt" [O_RDONLY;O_CREAT] 0o666
26 Tau
27 RV_none
28 link "/f1.txt" "/f1_hl.txt"
29 Tau
30 RV_none
31 unlink "f1.txt"
32 Tau
33 RV_none
34
35 stat "/f1_hl.txt"
36 Tau
37
RV_stat {
st_dev=1792;
st_ino= 13;
st_kind= S_IFREG;
st_perm= 0o644;
st_nlink=1;
st_uid= 0;
st_gid= 0;
st_rdev=0;
st_size= 0;
}
38
39 # unlink the link should delete the file
40
41 unlink "/f1_hl.txt"
42 Tau
43 RV_none
44 stat "/f1_hl.txt"
45 Tau
46 ENOENT
47
48 # removing the link to a linked file should reduce count of the file
49
50 open_close "/f1.txt" [O_RDONLY;O_CREAT] 0o666
51 Tau
52 RV_none
53 link "/f1.txt" "/f1_hl.txt"
54 Tau
55 RV_none
56 unlink "f1_hl.txt"
57 Tau
58 RV_none
59
60 stat "/f1.txt"
61 Tau
62
RV_stat {
st_dev=1792;
st_ino= 13;
st_kind= S_IFREG;
st_perm= 0o644;
st_nlink=1;
st_uid= 0;
st_gid= 0;
st_rdev=0;
st_size= 0;
}
63
64 # # uncomment this test when we have lstat in place
65 # unlinking a linked symlink should decrease the symlink link count
66
67 # symlink "/f1.txt" "f3_sl.txt"
68 # link "f3_sl.txt" "f3_sl_hl.txt"
69 # lstat "f3_sl.txt"
70 # lstat "f3_sl_hl.txt"
71 # unlink "f3_st_hl.txt"
72 # lstat "f3_sl.txt"
73
74