ovl: port ovl_nlink_end() to cred guard

Use the scoped ovl cred guard.

Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-29-b31603935724@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner
2025-11-17 10:34:00 +01:00
parent 062c5b48d2
commit 9e5ec68f3a

View File

@@ -1211,11 +1211,8 @@ void ovl_nlink_end(struct dentry *dentry)
ovl_drop_write(dentry);
if (ovl_test_flag(OVL_INDEX, inode) && inode->i_nlink == 0) {
const struct cred *old_cred;
old_cred = ovl_override_creds(dentry->d_sb);
ovl_cleanup_index(dentry);
ovl_revert_creds(old_cred);
with_ovl_creds(dentry->d_sb)
ovl_cleanup_index(dentry);
}
ovl_inode_unlock(inode);