mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
dcache: extrace and use d_unlinked()
d_unlinked() will be used in middle-term to ban checkpointing when opened but unlinked file is detected, and in long term, to detect such situation and special case on it. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
8c85e12512
commit
f3da392e9f
3 changed files with 12 additions and 8 deletions
|
|
@ -1384,7 +1384,7 @@ static int graft_tree(struct vfsmount *mnt, struct path *path)
|
|||
goto out_unlock;
|
||||
|
||||
err = -ENOENT;
|
||||
if (IS_ROOT(path->dentry) || !d_unhashed(path->dentry))
|
||||
if (!d_unlinked(path->dentry))
|
||||
err = attach_recursive_mnt(mnt, path, NULL);
|
||||
out_unlock:
|
||||
mutex_unlock(&path->dentry->d_inode->i_mutex);
|
||||
|
|
@ -1566,7 +1566,7 @@ static int do_move_mount(struct path *path, char *old_name)
|
|||
if (IS_DEADDIR(path->dentry->d_inode))
|
||||
goto out1;
|
||||
|
||||
if (!IS_ROOT(path->dentry) && d_unhashed(path->dentry))
|
||||
if (d_unlinked(path->dentry))
|
||||
goto out1;
|
||||
|
||||
err = -EINVAL;
|
||||
|
|
@ -2129,9 +2129,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
|
|||
error = -ENOENT;
|
||||
if (IS_DEADDIR(new.dentry->d_inode))
|
||||
goto out2;
|
||||
if (d_unhashed(new.dentry) && !IS_ROOT(new.dentry))
|
||||
if (d_unlinked(new.dentry))
|
||||
goto out2;
|
||||
if (d_unhashed(old.dentry) && !IS_ROOT(old.dentry))
|
||||
if (d_unlinked(old.dentry))
|
||||
goto out2;
|
||||
error = -EBUSY;
|
||||
if (new.mnt == root.mnt ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue