ceph: allow dentry_lease_is_valid to work under RCU walk
authorJeff Layton <jlayton@redhat.com>
Fri, 1 Jul 2016 13:39:20 +0000 (09:39 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 28 Jul 2016 01:00:39 +0000 (03:00 +0200)
commit14fb9c9efe3570459b6bddd76a990140917237ad
treedaf8c348ec9487c5d3466dbb00b39dbf28e562e4
parent5b484a513149f53613d376a9d1cd0391de099fb4
ceph: allow dentry_lease_is_valid to work under RCU walk

Under rcuwalk, we need to take extra care when dereferencing d_parent.
We want to do that once and pass a pointer to dentry_lease_is_valid.

Also, we must ensure that that function can handle the case where we're
racing with d_release. Check whether "di" is NULL under the d_lock, and
just return 0 if so.

Finally, we still need to kick off a renewal job if the lease is getting
close to expiration. If that's the case, then just drop out of rcuwalk
mode since that could block.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/dir.c