Am 29.10.21 um 14:54 schrieb Miklos Szeredi:
On Fri, Oct 29, 2021 at 01:37:49AM +0300, Amir Goldstein wrote:
On Thu, Oct 28, 2021 at 11:41 PM Georg Müller<georgmueller@xxxxxxx> wrote:
Hi,
I was trying to implement .tmpfile for overlayfs inode_operations to support O_TMPFILE.
Docker with aufs supports it, but this is deprecated and removed from current docker. I now have a work-around in my code (create tmpfile+unlink), but
I thought it might be a good idea to have tmpfile support in overlayfs.
I was trying to do it on my own, but I have some headaches to what is necessary to achieve the goal.
From my understanding, I have to find the dentry for the upper dir (or workdir) and call vfs_tmpdir() for this, but I am running from oops to oops.
Is there some hint what I have to do to achieve the goal?
You'd want to use ovl_create_object() and probably pass a tmpfile argument
then pass it on struct ovl_cattr to ovl_create_or_link() after that
it becomes more complicated. You'd need ovl_create_tempfile() like
ovl_create_upper().
You can follow xfs_generic_create() for some clues.
You need parts of ovl_instantiate() but not all of it - it's a mess.
Here's something I prepared earlier;)
Don't know why it got stuck, quite possibly I realized some fatal flaw that I
can't remember anymore...
Seems to work though, so getting this out for review and testing.
Thank you for the patch. I will give it a try in my local setup here and will come back with the results.
Best regards,
Georg