Re: Overlayfs: Deleting files from the lower dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 25, 2023 at 5:56 PM <alexis.b@xxxxxxxxx> wrote:
>
> Hi,
>
> We are using an overlayfs to make our configuration persistent.
> The lower dir is /etc and the upper dir is located on the persistent
> /data partition. This is the mount command we use to create the overlay:
>
> mount -n -t overlay \
> -o workdir=$WORK_DIR \
> -o lowerdir=/etc \
> -o upperdir=/data \
> -o index=off,xino=off,redirect_dir=off,metacopy=off \
> /data /etc
>

What is the lower (readonly) and upper filesystem type?
Any reason that you explicitly disable redirect_dir?
I am asking because this is not a common configuration
and not one that I test regularly.

> Problem is that when we do remove a file from
> the lower dir  ("rm /etc/file1.txt" for example) and afterwards list the
> directory content with the
> ls command we do get following output:
>
> $ls /etc
> file1.txt file2.txt file3.txt
>
> $rm /etc/file1.txt
>
> $ls /etc
> ls: ./file1.txt: No such file or directory
> file2.txt file3.txt
>
>
> Like expected, the file is not listed anymore but we do get an error
> message ("No such file or directory"). When we list the directory
> using the tree command we do not get an error but the file (possibly the
> character device to white out the deleted file?) still gets listed in
> the
> output contrary to what we would expect.
>

It is very much unexpected.

> We are using linux kernel version 5.10.9.
>

Is this a regression with this kernel version?
Or is this the behavior you always observed?
Do you see any overlayfs related messages in kmsg while observing this?

>
> Any hint on why this does happen or how to solve this would be very
> appreciated.

On quick look you could try to upgrade to kernel >= 5.10.37 with this fix
* 0f8528c78fc8 - ovl: invalidate readdir cache on changes to dir with origin

This is a fix to a bug where lower dir was removed, which is not your case,
but maybe there is something that I am overlooking.

Thanks,
Amir.




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux