diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-03-01 08:01:54 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-04-27 23:52:23 +0200 |
commit | aa60cfc3f7ee32766766f71e6bfbea963b4f94bc (patch) | |
tree | eab5168f12d68b2371ace2eb91a5eea95e560d7d /fs/ceph/super.h | |
parent | d3c51ae1b8cce5bdaf91a1ce32b33cf5626075dc (diff) | |
download | linux-stable-aa60cfc3f7ee32766766f71e6bfbea963b4f94bc.tar.gz linux-stable-aa60cfc3f7ee32766766f71e6bfbea963b4f94bc.tar.bz2 linux-stable-aa60cfc3f7ee32766766f71e6bfbea963b4f94bc.zip |
ceph: don't use d_add in ceph_handle_snapdir
It's possible ceph_get_snapdir could end up finding a (disconnected)
inode that already exists in the cache. Change the prototype for
ceph_handle_snapdir to return a dentry pointer and have it use
d_splice_alias so we don't end up with an aliased dentry in the cache.
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 188565d806b2..07a3fb52ae30 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1193,7 +1193,7 @@ extern const struct dentry_operations ceph_dentry_ops; extern loff_t ceph_make_fpos(unsigned high, unsigned off, bool hash_order); extern int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry); -extern int ceph_handle_snapdir(struct ceph_mds_request *req, +extern struct dentry *ceph_handle_snapdir(struct ceph_mds_request *req, struct dentry *dentry, int err); extern struct dentry *ceph_finish_lookup(struct ceph_mds_request *req, struct dentry *dentry, int err); |