# OverlayFS limitation [Limitations on OverlayFS compatibility](https://docs.docker.com/storage/storagedriver/overlayfs-driver/#limitations-on-overlayfs-compatibility) > open(2): OverlayFS only implements a subset of the POSIX standards. This can result in certain OverlayFS operations breaking POSIX standards. One such operation is the copy-up operation. Suppose that your application calls fd1=open("foo", O_RDONLY) and then fd2=open("foo", O_RDWR). In this case, your application expects fd1 and fd2 to refer to the same file. However, due to a copy-up operation that occurs after the second calling to open(2), the descriptors refer to different files. The fd1 continues to reference the file in the image (lowerdir) and the fd2 references the file in the container (upperdir). A workaround for this is to touch the files which causes the copy-up operation to happen. All subsequent open(2) operations regardless of read-only or read-write access mode reference the file in the container (upperdir). > ## Proof-of-concept ```cpp #include <bits/stdc++.h> using namespace std; int main() { { ifstream fin("/etc/host.conf"); { ofstream fout("/etc/host.conf"); fout << "gggg" << endl; } string buffer((istreambuf_iterator<char>(fin)), istreambuf_iterator<char>()); cout << buffer << endl; } { ifstream fin("/etc/host.conf"); string buffer((istreambuf_iterator<char>(fin)), istreambuf_iterator<char>()); cout << buffer << endl; } } ``` Running on host output ``` -> % sudo ./test gggg gggg ``` Running on docker with overlay2 ``` -> % docker run --rm -v ${PWD}/test:/opt/test ubuntu /opt/test # The "order" line is only used by old versions of the C library. order hosts,bind multi on gggg ``` Running on docker with aufs ``` -> % docker run --rm -v ${PWD}/test:/opt/test ubuntu /opt/test gggg gggg ```