All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Gionatan Danti <g.danti-N44kj/XGErOonA0d6jMUrA@public.gmane.org>,
	"linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	James McDonough <jmcd-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Subject: Re: Problem with Samba re-share of a CIFS mount
Date: Thu, 13 Feb 2014 06:37:38 -0500	[thread overview]
Message-ID: <20140213063738.1b345466@tlielax.poochiereds.net> (raw)
In-Reply-To: <CAH2r5mvQ590zaniv3cDuu+Do0N9TePasTaEFkrNSAdatTiaZ5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 11 Feb 2014 12:01:50 -0600
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Tue, Feb 11, 2014 at 11:45 AM, Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
> > On Tue, 11 Feb 2014 16:50:45 +0100
> > Gionatan Danti <g.danti-N44kj/XGErOonA0d6jMUrA@public.gmane.org> wrote:
> >
> >> Hi Jeff,
> >> I had the same idea.
> >>
> >> When mounting the CIFS directory, the problematic installations return 0
> >> links for both dirs and files. On the other hand, the stock CentOS
> >> installation return 1 or more links.
> >>
> >> It puzzled me. Two questions:
> >> - anyone know the rationale behind this?
> >
> > The rationale is that windows servers always send a NumberOfLinks value
> > of '0' for directories. We have a hack in place that went in around a
> > year ago to work around that for (arguably broken) applications that
> > try to infer something about an inode that has a zero st_nlink value.
> >
> >> - how it is possible to work-around that with an unpatched kernel?
> >>
> >
> > There is no workaround. Either fix the application such that it doesn't
> > care or patch the kernel. I'll cc Jim since he did a fair bit of
> > looking at this several months ago.
> >
> > In truth though, resharing a cifs mount is probably not a great
> > solution. It sounds like the kind of setup that's going to end up being
> > fraught with cache coherency problems...
> 
> Problem is that there are situations where it is required (usually
> due to legacy dialect support or due to legacy authentication
> support).
> 
> I am not as worried about the cache coherence issues if
> we are mounting "cache=none" and we can even set
> actimeo lower if needed
> 

Using cache=none sort of defeats the purpose. After all Gionatan said
that he was doing this specifically to use fscache, and that won't work
with cache=none.

But, lets leave that aside for a moment and consider whether this could
work at all. Assume we have samba set up re-share a cifs mount:

Client sends an open to samba and requests an oplock. Samba then opens
a file on the cifs mount, and does not request an oplock (because of
cache=none). We then attempt to set a lease, which will fail because we
don't have an oplock. Now you're no better off (and probably worse off)
since you have zero caching going on and are having to bounce each
request through an extra hop.

So, suppose you disable "kernel oplocks" in samba in order to get samba
to hand out L2 oplocks in this situation. Another client then comes
along on the main (primary) server and changes a file. Samba is then
not aware of that change and hilarity (aka data corruption) ensues.

I just don't see how re-sharing a cifs mount is a good idea, unless you
are absolutely certain that the data you're resharing won't ever
change. If that's the case, then you're almost certainly better off
keeping a local copy on the samba server and sharing that out.

-- 
Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>

  parent reply	other threads:[~2014-02-13 11:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  9:30 Problem with Samba re-share of a CIFS mount Gionatan Danti
     [not found] ` <52F9EDA5.1020004-N44kj/XGErOonA0d6jMUrA@public.gmane.org>
2014-02-11 15:33   ` Jeff Layton
     [not found]     ` <20140211103302.6d74b90d-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-11 15:50       ` Gionatan Danti
     [not found]         ` <52FA46D5.8020904-N44kj/XGErOonA0d6jMUrA@public.gmane.org>
2014-02-11 16:59           ` Steve French
     [not found]             ` <CAH2r5mvXh2A_LOm5y7BpgKS6bQhNGjEDR8CYn=K2CnMv01HQeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-11 17:05               ` Gionatan Danti
2014-02-11 17:45           ` Jeff Layton
     [not found]             ` <20140211124536.5fdcb56f-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-11 18:01               ` Steve French
     [not found]                 ` <CAH2r5mvQ590zaniv3cDuu+Do0N9TePasTaEFkrNSAdatTiaZ5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-13 11:37                   ` Jeff Layton [this message]
     [not found]                     ` <20140213063738.1b345466-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-13 17:29                       ` Gionatan Danti
     [not found]                         ` <52FD0109.5030909-N44kj/XGErOonA0d6jMUrA@public.gmane.org>
2014-02-13 18:04                           ` Steve French
     [not found]                             ` <CAH2r5msMZsnC8hxh6=P=f_vsuB=DR_Hv9xyLUEZtG+WpzYU=Sg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-14 10:27                               ` Gionatan Danti
2014-02-13 19:40                           ` Jeff Layton
     [not found]                             ` <20140213144038.2101ea44-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-14  2:14                               ` Suresh Jayaraman
     [not found]                                 ` <52FDC978020000F4000256F9-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2014-02-14 12:06                                   ` Jeff Layton
2014-02-14 10:25                               ` Gionatan Danti
     [not found]                                 ` <52FDEF0D.8010708-N44kj/XGErOonA0d6jMUrA@public.gmane.org>
2014-02-14 12:17                                   ` Jeff Layton
     [not found]                                     ` <20140214071724.725d8545-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-14 14:10                                       ` Gionatan Danti
2014-02-14 12:08                           ` Jeff Layton
     [not found]                             ` <20140214070846.09904331-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-02-14 14:05                               ` Gionatan Danti
2014-02-11 18:09               ` Gionatan Danti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140213063738.1b345466@tlielax.poochiereds.net \
    --to=jlayton-eunubhrolfbytjvyw6ydsg@public.gmane.org \
    --cc=g.danti-N44kj/XGErOonA0d6jMUrA@public.gmane.org \
    --cc=jmcd-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.