Commit c644bce
readdir: require opt-in for d_type flags
Commit c31f91c ("fuse: don't allow signals to interrupt getdents
copying") introduced the use of high bits in d_type as flags. However,
overlayfs was not adapted to handle this change.
In ovl_cache_entry_new(), the code checks if d_type == DT_CHR to
determine if an entry might be a whiteout. When fuse is used as the
lower layer and sets high bits in d_type, this comparison fails,
causing whiteout files to not be recognized properly and resulting in
incorrect overlayfs behavior.
Fix this by requiring callers of iterate_dir() to opt-in for getting
flag bits in d_type outside of S_DT_MASK.
Fixes: c31f91c ("fuse: don't allow signals to interrupt getdents copying")
Link: https://lore.kernel.org/all/20260107034551.439-1-luochunsheng@ustc.edu/
Link: containerd/stargz-snapshotter#2214
Reported-by: Chunsheng Luo <luochunsheng@ustc.edu>
Reviewed-by: Chunsheng Luo <luochunsheng@ustc.edu>
Tested-by: Chunsheng Luo <luochunsheng@ustc.edu>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://patch.msgid.link/20260108074522.3400998-1-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent 7d42f2b commit c644bce
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
| |||
569 | 571 | | |
570 | 572 | | |
571 | 573 | | |
| 574 | + | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
| 1858 | + | |
| 1859 | + | |
1858 | 1860 | | |
1859 | 1861 | | |
1860 | 1862 | | |
| |||
3524 | 3526 | | |
3525 | 3527 | | |
3526 | 3528 | | |
3527 | | - | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
3528 | 3532 | | |
3529 | 3533 | | |
3530 | 3534 | | |
| |||
0 commit comments