UBUNTU: SAUCE: shiftfs: fix dentry revalidation
BugLink: https://bugs.launchpad.net/bugs/1872757
Our revalidate methods were very opinionated about whether or not a
dentry was valid when we really should've just let the underlay tell us
what's what. This has led to bugs where a ESTALE was returned for e.g.
temporary files that were created and directly re-opened afterwards
through /proc/<pid>/fd/<nr-of-deleted-file>. When a file is re-opened
through /proc/<pid>/fd/<nr> LOOKUP_JUMP is set and the vfs will
revalidate via d_weak_revalidate(). Since the file has been unhashed or
even already gone negative we'd fail the open when we should've
succeeded.
I had also foolishly provided a .tmpfile method which so far only has
caused us trouble. If we really need this then we can reimplement it
properly but I doubt it. Remove it for now.
Reported-by: Christian Kellner <ckellner@redhat.com>
Reported-by: Evgeny Vereshchagin <evvers@ya.ru>
Cc: Seth Forshee <seth.forshee@canonical.com>
Link: https://github.com/systemd/systemd/issues/14861
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>