Re: [RFC][PATCH v2 0/5] Experiments with overlayfs filemap

Amir Goldstein
2019-01-25T13:04:37Z

> > One questions about your patch:
> > Skipping the ovl_change_flags() for upper realfile, that's just a
> > quick hack, right?
> > I'll need to fix this up properly.
>
> Yes.
>
> Speaking of hacks: I don't really like the O_RDWR | O_WRONLY thing. I
> understand why it works, but I think handling it explicitly would be
> much cleaner.
>

I figured... in fact, it is not at all interesting to propagate f_flags
to copy up helpers, so I was thinking of translating them to simple
copy_up_flags *before* the call to ovl_maybe_copy_up(), i.e.:

OVL_COPY_UP = 1,
OVL_COPY_UP_DATA = 2,
OVL_COPY_UP_WITH_DATA = 3,

> > About the way forward, implementing writepage() should be quite straight forward
> > from this, so I will add write support re-work the series and re-post.
>
> The one issue is, we don't have the open file available from
> writepage(s) like we do in readpage(s). In fact leaving the
> writeback till after close is an important optimization (e.g.
> compilers write temporary files, that are then immediately deleted, so
> no need to actually do any writeback).
>
> That opens some interesting questions about how to do the writeback...
>

Mmm.... so now using upper page cache for write does sound so bad.
If only we had shared cache pages ;-)
We can treat upper page cache as a vessel for writeback and invalidate
it upon completion, since it is *ours*.
I'll see what I can come up with.

Thanks,
Amir.