ceph: set DCACHE_NOKEY_NAME flag in ceph_lookup/atomic_open()
authorJeff Layton <jlayton@kernel.org>
Tue, 26 Jan 2021 19:12:24 +0000 (14:12 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 24 Aug 2023 09:24:34 +0000 (11:24 +0200)
commitcb3524a8bd96fbc614e0f9295866c28dc17cafe6
treeb9ef70e165861b2081b54e49916503fb5963fbe3
parent4ac4c23eaa389859f746a6ef31e1c71d880312f4
ceph: set DCACHE_NOKEY_NAME flag in ceph_lookup/atomic_open()

This is required so that we know to invalidate these dentries when the
directory is unlocked.

Atomic open can act as a lookup if handed a dentry that is negative on
the MDS. Ensure that we set DCACHE_NOKEY_NAME on the dentry in
atomic_open, if we don't have the key for the parent. Otherwise, we can
end up validating the dentry inappropriately if someone later adds a
key.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c
fs/ceph/file.c