Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Pavel Shilovsky
	<piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Shirish Pargaonkar
	<shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org
Subject: Re: Regression tests for CIFS client
Date: Fri, 10 Aug 2012 06:41:31 -0400	[thread overview]
Message-ID: <20120810064131.682541e8@corrin.poochiereds.net> (raw)
In-Reply-To: <50249BC7.2000205-IBi9RG/b67k@public.gmane.org>

On Fri, 10 Aug 2012 10:57:35 +0530
Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org> wrote:

> On 08/09/2012 08:33 PM, Jeff Layton wrote:
> > On Thu, 09 Aug 2012 20:07:56 +0530
> > Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org> wrote:
> >>>
> >>> With all of the recent changes to the read/write code, I think we can
> >>> reasonably do O_DIRECT now. Just make sure that you don't request an
> >>> oplock on open and ensure that you're not using cache=loose codepaths.
> >>>
> >> Hmm, I'm not sure yet what is going on wrong.. I disabled oplocks by doing
> >>
> >>    echo N > /sys/module/cifs/parameters/enable_oplocks
> >>
> >> (Is there a way for an application to not request oplocks?)
> >> and mounted with cache=strict and ran the directIO test alone.
> >>
> >> strace output (snip)
> >> --------------
> >> stat("/mnt/cifstests", 0x7fff317e68f0)  = -1 ENOENT (No such file or
> >> directory)
> >> mkdir("cifstests", 0755)                = 0
> >> chdir("cifstests")                      = 0
> >> open("testfile", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
> >> fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> >> close(3)                                = 0
> >> open("testfile", O_RDONLY|O_DIRECT)     = -1 EINVAL (Invalid argument)
> >> write(1, "[Errno 22] Invalid argument: 'te"..., 40) = 40
> >>
> >> But I see from dmesg oplocks are being granted.
> >>
> > Sorry, I might not have been clear. I meant that in principle, we could
> > probably fix the cifs client to do O_DIRECT properly now that we have
> > the strictcache code. It doesn't do that currently, of course...
> 
> Ah, ok. What does it take to fix the cifs client? I could take a look.
> Are there pointers to discussion threads on this topic?
> 

No real discussion on this so far, just something I had considered when
Pavel did the strictcache code. cache=strict (and cache=none for that
matter) basically does dio already when it doesn't have an oplock. When
cache=strict is in force you can just make an O_DIRECT open not request
one at all and you're basically done.

There are some things to be worked out:

1) what to do about cache=loose? Should an O_DIRECT open make it use a
different codepath?

2) what to do about mmap? Currently we fall back to buffered I/O
codepaths for mmap even when we don't have an oplock. Should we do
anything different if someone tries to mmap an O_DIRECT file?

One of the complicating factors is that we have different sets of
file_operations for different cache= values. If you unify those, it
might make it easier to do all of this.

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

      parent reply	other threads:[~2012-08-10 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 12:01 Regression tests for CIFS client Suresh Jayaraman
     [not found] ` <50225505.3080303-IBi9RG/b67k@public.gmane.org>
2012-08-08 12:41   ` Jeff Layton
     [not found]     ` <20120808084149.26325074-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-08-08 13:50       ` Steve French
     [not found]         ` <CAH2r5mt_ss8YGYLRjQ5dKiRntWCribtScFOtz3hTno6TJQXQqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-09 14:45           ` Suresh Jayaraman
2012-08-09 14:37       ` Suresh Jayaraman
     [not found]         ` <5023CB44.8000802-IBi9RG/b67k@public.gmane.org>
2012-08-09 15:03           ` Jeff Layton
     [not found]             ` <20120809110351.22847557-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-08-10  5:27               ` Suresh Jayaraman
     [not found]                 ` <50249BC7.2000205-IBi9RG/b67k@public.gmane.org>
2012-08-10 10:41                   ` Jeff Layton [this message]

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=20120810064131.682541e8@corrin.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org \
    --cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sjayaraman-IBi9RG/b67k@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox