On 12/09/2016 06:52 AM, Sandeep Joshi wrote: > > I am building an FSAL wrt 2.4-stable and had a few questions > > https://github.com/nfs-ganesha/nfs-ganesha/blob/V2.4-stable/src/include/fsal_api.h > > 1) When is fsal_set_credentials() to be called ? > > I noticed FSALs call it at varying places. > > VFS does it in get_quota, set_quota, open2, write2, commit2, mkdir, > mknod, symlink, rename, unlink > > CEPH - write2 > > GPFS does it in get_quota, set_quota, create, create2, commit2, open, > read, write, mkdir, mknod, link, rename, symlink, unlink
It should be called whenever an operation needs to be done as the client user, rather than as root (which is what Ganesha runs as). When this is depends on the FSAL, and it's user/permission model. VFS should have the complete set, so some or all of those operations. > > 2) There is a mdcache FSAL layered above the FSAL in 2.4. Is the cache > then per-export or per-fsal ? This depends. The handle cache is global, keyed on the per-FSAL key for the object. The dirent cache is per directory. > 3) What are the situations under which an FSAL would need to mandatorily > take fsal_obj_handle.lock ? > > https://github.com/nfs-ganesha/nfs-ganesha/blob/V2.4-stable/src/include/fsal_api.h#L3002 > > In some cases, the upper layer has already taken the lock (e.g open, > close). There is very little documentation on this aspect. This is, indeed, not well documented. Shares (and share counters) are generally protected. FDs are usually protected. PSEUDO protects it's dirent tree. In general, you need to protect all accesses to shares, and probably to your FD, and feel free to use it to protect anything else in your obj_handle that you need to protect. Daniel ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/xeonphi _______________________________________________ Nfs-ganesha-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel
