Project

General

Profile

Actions

Feature #18490

closed

client: implement delegation support in userland cephfs

Added by Jeff Layton over 7 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
luminous
Reviewed:
Affected Versions:
Component(FS):
Client, Ganesha FSAL
Labels (FS):
Pull request ID:

Description

To properly implement NFSv4 delegations in ganesha, we need something that operates a little like Linux's fcntl(..., F_SETLEASE, ...). Ganesha needs to be able to set a lease on a file, and then be issued a callback when the lease is being revoked.

Fortunately, ceph already has a facility for recallable state -- the caps system. I think we can map the semantics we need on top of that.

At I high level, what I'm envisioning is something like this:

int ceph_ll_setlease(struct ceph_mount *cmount, Fh *fh, int cmd, unsigned mask, setlease_callback_t cb);

This function would create a "ceph_lease" object to hang off the inode with a CEPH_STATX_* mask that indicates what attributes we want to get a lease on. That object would use get_caps to get references to the required caps and then hold them there. When the MDS wants to recall the caps, we'll issue the callback to the application (ganesha in this case).

ganesha would then issue a NFS CB_RECALL and eventually drop the lease via another ceph_setlease call once the client returns the delegation. If that doesn't occur in a certain amount of time (usually two NFSv4 lease periods -- 90s or so), we'll drop the lease unconditionally (and maybe abort() the program?).

One nice thing here is that this shouldn't require any MDS changes (though we may need to work out how to ensure that the client doesn't get evicted).

I think that this mechanism would also be suitable for implementing cluster coherent oplocks for samba as well.


Files

ceph-deleg.txt (2.96 KB) ceph-deleg.txt Ceph delegation design document Jeff Layton, 06/01/2017 03:04 PM
ceph-delegation.pcap.pcapng (9.25 KB) ceph-delegation.pcap.pcapng v4.0 read delegation and recall Jeff Layton, 08/31/2017 01:03 PM

Related issues 1 (0 open1 closed)

Copied to CephFS - Backport #22407: luminous: client: implement delegation support in userland cephfsResolvedNathan CutlerActions
Actions

Also available in: Atom PDF