> So, in fact, both ganesha and samba can have the same file open at the same
> time (just as any 2 processes can).  This will, of course, cause issues if 
> both are
> modifying the same sections of the file.  This is why file locking was 
> invented.
> NFSv3 (via NLM) and NFSv4 (built in) have locking modes that are compatible
> with SMB locking, so as long as the clients use those, it "should" work fine. 
>  Of
> course, there's going to be issues, since this isn't tested well (or maybe at 
> all).  I
> have some idea that the Gluster team at one point tested this; they support
> exporting Gluster from both ganesha and samba, although I don't believe they
> support exporting the same FS at the same time.
> 
> So the short answer is that it theoretically can work, and it actually may 
> work,
> but it likely won't, without some work.

It will probably work to some relaxed definition of work... It will work best 
with NFS v4 clients since they will use NFS v4 OPEN calls which define when the 
client is attempting to access the file, and access will be blocked if an SMB 
user has the file open with a conflicting deny mode. Since V2.4, Ganesha has 
had better management of open file descriptors and with NFS v4 access, will 
much more often only have an open fd when the V4 client actually has the file 
open. The key trick is that fetching attributes outside of the context of the 
open file may cause a different file descriptor to be opened, and that may not 
be closed immediately - though we are re-examining how we manage the 
"anonymous" file descriptor and this would be a good reason to only open a 
temporary fd for the duration of a stat system call.

To the extent that better multi-protocol operation is important to our 
stakeholders, we are more likely to improve the situation. We always welcome 
new developers representing new stakeholders...

Frank

> On 03/06/2018 01:01 PM, Pradeep wrote:
> > Hi Daniel,
> >
> > What I meant is a use case where some one needs to access the same
> > export through NFS protocol using Ganesha server and SMB protocol
> > using Samba server. Both Samba and Ganesha are running on the same server.
> > Obviously, file can't be open by both ganesha and samba; so we need to
> > close the open FDs (if those are for caching). Linux provides oplock
> > (fcntl() with F_SETLEASE) for processes to get notification on other
> > processes trying to open and this can be used to synchronize with Samba.
> > Samba seems to support this already:
> > https://github.com/samba-team/samba/blob/master/source3/smbd/oplock_li
> > nux.c
> >
> > Thanks,
> >
> > On Tue, Mar 6, 2018 at 9:29 AM, Daniel Gryniewicz <d...@redhat.com
> > <mailto:d...@redhat.com>> wrote:
> >
> >     Ganesha has multi-protocol (NFS3, NFS4, and 9P).  There are no plans
> >     to add CIFS, since that is an insanely complicated protocol, and has
> >     a userspace daemon implementation already (in the form of Samba).  I
> >     personally wouldn't reject such support if it was offered, but as
> >     far as I know, no one is even thinking about working on it.
> >
> >     Daniel
> >
> >
> >     On 03/06/2018 12:20 PM, Pradeep wrote:
> >
> >         Hello,
> >
> >         Is there plans to implement multiprotocol (NFS and CIFS
> >         accessing same export/share) in ganesha? I believe current FD
> >         cache will need changes to support that.
> >
> >         Thanks,
> >         Pradeep
> >
> >
> >         
> > ------------------------------------------------------------------------------
> >         Check out the vibrant tech community on one of the world's most
> >         engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >
> >
> >
> >         _______________________________________________
> >         Nfs-ganesha-devel mailing list
> >         Nfs-ganesha-devel@lists.sourceforge.net
> >         <mailto:Nfs-ganesha-devel@lists.sourceforge.net>
> >         https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel
> >
> > <https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel>
> >
> >
> >
> >     
> > ------------------------------------------------------------------------------
> >     Check out the vibrant tech community on one of the world's most
> >     engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >     _______________________________________________
> >     Nfs-ganesha-devel mailing list
> >     Nfs-ganesha-devel@lists.sourceforge.net
> >     <mailto:Nfs-ganesha-devel@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel
> >     <https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel>
> >
> >
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most engaging tech
> sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Nfs-ganesha-devel mailing list
> Nfs-ganesha-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to