ceph: don't clear I_NEW until inode metadata is fully populated
authorJeff Layton <jlayton@kernel.org>
Wed, 11 Dec 2019 20:21:24 +0000 (15:21 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jan 2020 15:53:39 +0000 (16:53 +0100)
commit893e456b2c0bae61e172d2600a89c96abf9b3daf
tree4cb487e297445eaf405dcd70275b23b8a953bd52
parentc4853e9776caefbd2f59739ce1a75798a2b4b7a5
ceph: don't clear I_NEW until inode metadata is fully populated

Currently, we could have an open-by-handle (or NFS server) call
into the filesystem and start working with an inode before it's
properly filled out.

Don't clear I_NEW until we have filled out the inode, and discard it
properly if that fails. Note that we occasionally take an extra
reference to the inode to ensure that we don't put the last reference in
discard_new_inode, but rather leave it for ceph_async_iput.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c