One of the possible file types that can be obtained using stat(2)
is S_IFWHT
, also called a whiteout. What is it?
Asked
Active
Viewed 1,449 times
7

Joseph Sible-Reinstate Monica
- 45,431
- 5
- 48
- 98

GingerBadger
- 312
- 3
- 12
-
2https://askubuntu.com/questions/39826/what-does-whiteout-mean-in-a-copy-on-write-filesystem – Iłya Bursov Jun 25 '20 at 18:33
-
4And why the downvotes, it is not clear to me, after having used Linux for more than 2 decades, when to expect this from `stat` or even *how* to make `stat` produce it, even after having read that askubuntu question or the [LWN article](https://lwn.net/Articles/265240/)! – Antti Haapala -- Слава Україні Jun 25 '20 at 18:41
-
See also DT_WHT in https://stackoverflow.com/q/13132667/7233423 – xhienne Jun 25 '20 at 21:10
1 Answers
9
The official Linux kernel contains no such thing. On UNIX systems where it does exist, and possibly in some unofficial patches for Linux, it's a type of file that stops further lookup for a file but reports that it doesn't exist. It's useful with union and overlay filesystems, to be able to remove files that exist in the base image. The Linux kernel's overlayfs does have whiteouts, but they're S_IFCHR files with major and minor number 0, not S_IFWHT.

Joseph Sible-Reinstate Monica
- 45,431
- 5
- 48
- 98
-
Interesting, how about this then: https://pdfs.semanticscholar.org/a376/35c7ffe018b4c428aa9ddb9ef1f8c8c9e29d.pdf - was it there in the past or what happened... – Antti Haapala -- Слава Україні Jun 25 '20 at 18:46
-
@AnttiHaapala That's describing an unofficial patch, not the official mainline Linux kernel. – Joseph Sible-Reinstate Monica Jun 25 '20 at 18:50