]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
UBUNTU: SAUCE: shiftfs: fix buggy unlink logic
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 29 Aug 2019 18:45:07 +0000 (20:45 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 16 Sep 2019 13:06:59 +0000 (15:06 +0200)
commit5995fd706bb22d325a5c8db315213ac14e0b7eb0
tree87fcd8b59807dee5d02286f38ef194ae2643dbec
parenteeb126fe13977352de0c5e3f2dd20a2c3f577bec
UBUNTU: SAUCE: shiftfs: fix buggy unlink logic

BugLink: https://bugs.launchpad.net/bugs/1841977
The way we messed with setting i_nlink was brittle and wrong. We used to
set the i_nlink of the shiftfs dentry to be deleted to the i_nlink count
of the underlay dentry of the directory it resided in which makes no
sense whatsoever. We also missed drop_nlink() which is crucial since
i_nlink affects whether a dentry is cleaned up on dput().
With this I cannot reproduce the bug anymore where shiftfs misleads zfs
into believing that a deleted file can not be removed from disk because
it is still referenced.

Fixes: commit 87011da41961 ("shiftfs: rework and extend")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/shiftfs.c