-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Disallow overlay/overlay2 on top of NFS #35483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow overlay/overlay2 on top of NFS #35483
Conversation
From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt: > The lower filesystem can be any filesystem supported by Linux and does > not need to be writable. The lower filesystem can even be another > overlayfs. The upper filesystem will normally be writable and if it > is it must support the creation of trusted.* extended attributes, and > must provide valid d_type in readdir responses, so NFS is not suitable. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What about other network-backed FS? SMB? sshfs? HDFS? |
Another option (possibly as a follow-up) would be to reverse the list; and only allow running on backing-filesystems that we know to work; other filesystems will error-out, but we can add a |
SSHFS and HDFS are fuse based, we can't really detect those specifically. We would have to switch to a whitelist approach and imo that is too opinionated. NFS is a common setup so users can easily walk into it and expect it to work, not sure anyone expects the same over FUSE or SMB. |
SMB is only FUSE on Linux hosts -- on Windows hosts it is about as native as it gets. |
Oh, but on Windows we don't support the overlay drivers, only the "Windows" storage driver |
As far as I understand recently NFS become suitable for overlayfs https://lwn.net/Articles/736677/ but it requires very fresh kernel and corresponding NFS options. So I suggest to check a kernel version or/and NFS options. |
Ah, thanks for that information; I'd not be against doing that check. If possible through feature detection (instead of just comparing kernel versions); perhaps it should be in a follow up. ping @amir73il any suggestions on how to detect if overlay is supported on NFS? |
There is a lot of confusion and inaccurate statements in this thread. Quite understandable with the current state of overlayfs documentation. I'll try to add clarity. @kazh000 the mentioned article has nothing to do with supporting an NFS mount as upper layer for overlayfs. It is WIP, not anywhere near mainline, to support exporting an overlayfs mount by NFS server. @MistyHacks the reason that network backed file systems and FUSE are not supported as upper layer is because those file systems can invalidate VFS cache entries (when files are changed remotely) and overlayfs doesn't like things to change under its feet. Incidently, overlayfs doesn't like it when remote file systems change files remotely even when those are used as lower layer, but lower layer files are not supposed to be change at all, while overlay is moutned. @thaJeztah the text you quoted in the bug from overlayfs.txt has mislead you. Overlayfs will throw a warning to dmesg complaining if d_type is not supported ("overlayfs: upper fs needs to support d_type."). |
Thanks for your input @amir73il - detection of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We discussed this change, and for now just disallow overlay on NFS, but contributions are welcome if we can implement this using actual detection if its supported |
LGTM |
From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:
fixes #35476
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)