]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
UBUNTU: SAUCE: shiftfs: fix dentry revalidation
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 14 Apr 2020 20:26:53 +0000 (22:26 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 5 May 2020 10:32:22 +0000 (12:32 +0200)
commitcfaa482afb97e3c05d020af80b897b061109d51f
tree67d466b1bf6af8ac7ea9fe4bc36b804b713a83f4
parent0b6519f8d19c00a9bf212f12aa119f09ef4c0c0a
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>
fs/shiftfs.c