summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2017-01-27 13:07:10 -0500
committerIlya Dryomov <idryomov@gmail.com>2017-02-20 12:16:10 +0100
commitcdde7c43513de7d8baec3ad7f6a01a177e00e968 (patch)
tree4baf1a7202439a9fb41864087219c07dfa17f167 /fs/ceph
parentf5d55f03973f79a008bf8635452849f8ef589c23 (diff)
downloadop-kernel-dev-cdde7c43513de7d8baec3ad7f6a01a177e00e968.zip
op-kernel-dev-cdde7c43513de7d8baec3ad7f6a01a177e00e968.tar.gz
ceph: call update_dentry_lease even when r_locked dir is not set
We don't really require that the parent be locked in order to update the lease on a dentry. Lease info is protected by the d_lock. In the event that the parent is not locked in ceph_fill_trace, and we have both parent and target info, go ahead and update the dentry lease. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/inode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index f5111df..68f4613 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1360,6 +1360,26 @@ retry_lookup:
goto done;
}
req->r_dentry = dn; /* may have spliced */
+ } else if (rinfo->head->is_dentry) {
+ struct ceph_vino *ptvino = NULL;
+
+ if ((le32_to_cpu(rinfo->diri.in->cap.caps) & CEPH_CAP_FILE_SHARED) ||
+ le32_to_cpu(rinfo->dlease->duration_ms)) {
+ dvino.ino = le64_to_cpu(rinfo->diri.in->ino);
+ dvino.snap = le64_to_cpu(rinfo->diri.in->snapid);
+
+ if (rinfo->head->is_target) {
+ tvino.ino = le64_to_cpu(rinfo->targeti.in->ino);
+ tvino.snap = le64_to_cpu(rinfo->targeti.in->snapid);
+ ptvino = &tvino;
+ }
+
+ update_dentry_lease(req->r_dentry, rinfo->dlease,
+ session, req->r_request_started, ptvino,
+ &dvino);
+ } else {
+ dout("%s: no dentry lease or dir cap\n", __func__);
+ }
}
done:
dout("fill_trace done err=%d\n", err);
OpenPOWER on IntegriCloud