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. Good luck! Amir.