On Fri, Jun 29, 2018 at 5:29 AM, Supriti Singh <Supriti.Singh(a)suse.com> wrote:
Hello,
I am looking at how to implement synthetic uid/gids for flex layout.
From rfc section "Implementation Notes for Synthetic uids/gids": [0]
" When the metadata server had a request to access a file, a SETATTR would
be sent to the storage device to set the owner and group of the data file.
The user and group might be selected in a round robin fashion from the range
of available ids. Those ids would be sent back as ffds_user and ffds_group
to the client. And it would present them as the RPC credentials to the
storage device. When the client was done accessing the file and the
metadata server knew that no other client was accessing the file, it
could reset the owner and group to restrict access to the data file."
Few questions regarding implementation:
1. To implement it in nfs-ganesha, we would have to add a way to generate
uids/gids, store a mapping between uids/gids and the corresponding data
file. Is there already such structure in nfs-ganesha that can be reused?
No, and I suspect this doesn't belong in Ganesha, but in the
underlying clustered filesystem's MDS. When we call layoutget() into
the FSAL, it should contact it's MDS, and that MDS should do whatever
is necessary t provide access to the underlying files (such as
generate and set synthetic UID/GID, if that's the fencing mechanism
that the FS uses). The results are then passed up to Ganesha, which
passes them back to the client.
2. As I understood, once metadata server generates uid/gid, it needs to send
a setattr to the storage device to set owner and group of data file. But I
am not sure how does this synthetic uid/gid maps to real uid/gid that a data
file might have. The same data file in cephfs can be opened through clients
other than nfs as well.
The underlying OSDs don't have any idea about the "real" owner of the
file. All concept of owner and UID/GID lives in the ceph MDS, not on
the OSDs, so the synthetic UID/GID would have to be unrelated to the
real owner of the file, but instead meaningful to the OSD.
[0]
https://tools.ietf.org/html/draft-ietf-nfsv4-flex-files-19#page-3
------
Supriti Singh
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton,
HRB 21284 (AG Nürnberg)
_______________________________________________
Devel mailing list -- devel(a)lists.nfs-ganesha.org
To unsubscribe send an email to devel-leave(a)lists.nfs-ganesha.org
Daniel