Bug 218822 - Delete the file from the upper layer directly, the file will become "Stale"
Summary: Delete the file from the upper layer directly, the file will become "Stale"
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: fs_ext4@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-09 06:14 UTC by Squall.Zhou
Modified: 2024-05-10 03:05 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Test result for 6.8.0 (17.01 KB, image/png)
2024-05-10 03:04 UTC, Squall.Zhou
Details

Description Squall.Zhou 2024-05-09 06:14:56 UTC
The FS mount as following:
/dev/sda7 on / type ext4 (rw,relatime)
/dev/sda5 on /persistent type ext4 (rw,relatime)
overlay on /etc type overlay (rw,relatime,lowerdir=/sysroot/etc,upperdir=/sysroot/persistent/platform/B/etc/upper,workdir=/sysroot/persistent/platform/B/etc/work)

1. I touched a file named "A" on /etc
2. I remove the file "A" from "/persistent/platform/B/etc/upper"
3. The file "A" in /etc will become "Stale"

root@exs1610ada83b:~ [B]# touch /etc/A
root@exs1610ada83b:~ [B]# rm /persistent/platform/B/etc/upper/A
root@exs1610ada83b:~ [B]# rm /etc/A
rm: can't remove '/etc/A': Stale file handle

Linux version:
root@exs1610ada83b:~ [B]# uname -a
Linux exs1610ada83b 5.10.184-intel-pk-standard #1 SMP PREEMPT Sun Jun 25 06:48:28 UTC 2023 x86_64 GNU/Linux

Thought, the /etc/A will be removed also.
Comment 1 Squall.Zhou 2024-05-09 09:05:12 UTC
1. The issue has also been reproduced on:
29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux 

~:mount -t overlay -o  lowerdir=etc,upperdir=upper,workdir=work overlay etc 
~:~/overlaytest$ touch etc/a 
rm upper/a 
rm etc/a 
rm: cannot remove 'etc/a': Stale file handle 

2. But not reproduced on WSL(Ubuntu 20.04.6)
Squall.Zhou[~/over1]:mkdir etc
mkdir upper
mkdir work
sudo mount -t overlay -o  lowerdir=etc,upperdir=upper,workdir=work overlay etc
sudo touch etc/a
sudo rm upper/a
sudo rm etc/a
rm: cannot remove 'etc/a': No such file or directory
Squall.Zhou[~/over]:uname -a
Linux PC3203 4.4.0-22621-Microsoft #2506-Microsoft Fri Jan 01 08:00:00 PST 2016 x86_64 x86_64 x86_64 GNU/Linux
Comment 2 Artem S. Tashkinov 2024-05-09 18:57:39 UTC
Is this reproducible on mainline 6.8.9?
Comment 3 Squall.Zhou 2024-05-10 01:23:34 UTC
(In reply to Artem S. Tashkinov from comment #2)
> Is this reproducible on mainline 6.8.9?

I don't have such a new system.
I have tried it on "Linux allenwei-VirtualBox 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux"
On this version, I can reproduce this issue.
This is the newest version I can get for test.
Comment 4 Squall.Zhou 2024-05-10 03:04:23 UTC
Created attachment 306279 [details]
Test result for 6.8.0
Comment 5 Squall.Zhou 2024-05-10 03:05:13 UTC
Comment on attachment 306279 [details]
Test result for 6.8.0

I have also reproduced it on 6.8.0

Note You need to log in before you can comment on or make changes to this bug.