All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
@ 2014-08-20 10:39 Namjae Jeon
  2014-08-21  4:52 ` Steve French
  2014-08-21 11:26 ` Jeff Layton
  0 siblings, 2 replies; 8+ messages in thread
From: Namjae Jeon @ 2014-08-20 10:39 UTC (permalink / raw)
  To: 'Steve French'
  Cc: 'Shirish Pargaonkar', 'Pavel Shilovsky',
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

Currently cifs have all or nothing approach for directIO operations.
cache=strict mode does not allow directIO while cache=none mode performs
all the operations as directIO even when user does not specify O_DIRECT
flag. This patch enables strict cache mode to honour directIO semantics.

Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 fs/cifs/dir.c  |    4 ++++
 fs/cifs/file.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 3db0c5f..30e377c 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
 		goto out;
 	}
 
+	if (file->f_flags & O_DIRECT &&
+	    CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
+		file->f_op = &cifs_file_direct_ops;
+
 	file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
 	if (file_info == NULL) {
 		if (server->ops->close)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index bee733e..0d07740 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
 	cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
 		 inode, file->f_flags, full_path);
 
+	if (file->f_flags & O_DIRECT &&
+	    cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
+		file->f_op = &cifs_file_direct_ops;
+
 	if (server->oplocks)
 		oplock = REQ_OPLOCK;
 	else
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
  2014-08-20 10:39 [PATCH 2/7] cifs: Allow directIO read/write during cache=strict Namjae Jeon
@ 2014-08-21  4:52 ` Steve French
       [not found]   ` <CAH2r5mvn86=76_O7QT0WMftjnr3Ek4t5PiqcWCy1HpaKVO=GFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-08-21 11:26 ` Jeff Layton
  1 sibling, 1 reply; 8+ messages in thread
From: Steve French @ 2014-08-21  4:52 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: Shirish Pargaonkar, Pavel Shilovsky,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

What if a file is opened twice - once with o_direct and once without?
what happens?

On Wed, Aug 20, 2014 at 5:39 AM, Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> Currently cifs have all or nothing approach for directIO operations.
> cache=strict mode does not allow directIO while cache=none mode performs
> all the operations as directIO even when user does not specify O_DIRECT
> flag. This patch enables strict cache mode to honour directIO semantics.
>
> Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  fs/cifs/dir.c  |    4 ++++
>  fs/cifs/file.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> index 3db0c5f..30e377c 100644
> --- a/fs/cifs/dir.c
> +++ b/fs/cifs/dir.c
> @@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
>                 goto out;
>         }
>
> +       if (file->f_flags & O_DIRECT &&
> +           CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> +               file->f_op = &cifs_file_direct_ops;
> +
>         file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
>         if (file_info == NULL) {
>                 if (server->ops->close)
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index bee733e..0d07740 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
>         cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
>                  inode, file->f_flags, full_path);
>
> +       if (file->f_flags & O_DIRECT &&
> +           cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> +               file->f_op = &cifs_file_direct_ops;
> +
>         if (server->oplocks)
>                 oplock = REQ_OPLOCK;
>         else
> --
> 1.7.7
>



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
       [not found]   ` <CAH2r5mvn86=76_O7QT0WMftjnr3Ek4t5PiqcWCy1HpaKVO=GFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-08-21 10:07     ` Namjae Jeon
  0 siblings, 0 replies; 8+ messages in thread
From: Namjae Jeon @ 2014-08-21 10:07 UTC (permalink / raw)
  To: 'Steve French'
  Cc: 'Shirish Pargaonkar', 'Pavel Shilovsky',
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, 'Ashish Sangwan'

> 
> What if a file is opened twice - once with o_direct and once without?
> what happens?
IMHO nothing bad happens.
Per file file->fop is initialized to inode->i_fop in do_dentry_open.
We are not changing inode->i_fop, so they still point to cached file operations.
The file which is open with O_DIRECT will get its fop changed to
cifs_file_direct_ops while the other file can still use cifs_file_strict_ops.
Also, while checking, I notice that additional check for CIFS_MOUNT_NO_BRL is
needed.
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
        inode->i_fop = &cifs_file_direct_nobrl_ops;
else
        inode->i_fop = &cifs_file_direct_ops;
If there is no objection, I will send v2 included above additional check.

Thanks.
> 
> On Wed, Aug 20, 2014 at 5:39 AM, Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> > Currently cifs have all or nothing approach for directIO operations.
> > cache=strict mode does not allow directIO while cache=none mode performs
> > all the operations as directIO even when user does not specify O_DIRECT
> > flag. This patch enables strict cache mode to honour directIO semantics.
> >
> > Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > ---
> >  fs/cifs/dir.c  |    4 ++++
> >  fs/cifs/file.c |    4 ++++
> >  2 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> > index 3db0c5f..30e377c 100644
> > --- a/fs/cifs/dir.c
> > +++ b/fs/cifs/dir.c
> > @@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
> >                 goto out;
> >         }
> >
> > +       if (file->f_flags & O_DIRECT &&
> > +           CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> > +               file->f_op = &cifs_file_direct_ops;
> > +
> >         file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
> >         if (file_info == NULL) {
> >                 if (server->ops->close)
> > diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> > index bee733e..0d07740 100644
> > --- a/fs/cifs/file.c
> > +++ b/fs/cifs/file.c
> > @@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
> >         cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
> >                  inode, file->f_flags, full_path);
> >
> > +       if (file->f_flags & O_DIRECT &&
> > +           cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> > +               file->f_op = &cifs_file_direct_ops;
> > +
> >         if (server->oplocks)
> >                 oplock = REQ_OPLOCK;
> >         else
> > --
> > 1.7.7
> >
> 
> 
> 
> --
> Thanks,
> 
> Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
  2014-08-20 10:39 [PATCH 2/7] cifs: Allow directIO read/write during cache=strict Namjae Jeon
  2014-08-21  4:52 ` Steve French
@ 2014-08-21 11:26 ` Jeff Layton
       [not found]   ` <20140821072656.372e613c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff Layton @ 2014-08-21 11:26 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: 'Steve French', 'Shirish Pargaonkar',
	'Pavel Shilovsky',
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

On Wed, 20 Aug 2014 19:39:11 +0900
Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:

> Currently cifs have all or nothing approach for directIO operations.
> cache=strict mode does not allow directIO while cache=none mode performs
> all the operations as directIO even when user does not specify O_DIRECT
> flag. This patch enables strict cache mode to honour directIO semantics.
> 
> Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  fs/cifs/dir.c  |    4 ++++
>  fs/cifs/file.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> index 3db0c5f..30e377c 100644
> --- a/fs/cifs/dir.c
> +++ b/fs/cifs/dir.c
> @@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
>  		goto out;
>  	}
>  
> +	if (file->f_flags & O_DIRECT &&
> +	    CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> +		file->f_op = &cifs_file_direct_ops;
> +
>  	file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
>  	if (file_info == NULL) {
>  		if (server->ops->close)
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index bee733e..0d07740 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
>  	cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
>  		 inode, file->f_flags, full_path);
>  
> +	if (file->f_flags & O_DIRECT &&
> +	    cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> +		file->f_op = &cifs_file_direct_ops;
> +
>  	if (server->oplocks)
>  		oplock = REQ_OPLOCK;
>  	else

Looks fine for the most part. You should also avoid requesting an
oplock if you're going to open O_DIRECT since you won't be using it
anyway.

-- 
Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
       [not found]   ` <20140821072656.372e613c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2014-08-21 13:24     ` Steve French
       [not found]       ` <CAH2r5mu6LH1YLqWhi4-1dgJH0BQ2CS5Lbym1mGP9EuvgtCP1Wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Steve French @ 2014-08-21 13:24 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Namjae Jeon, Shirish Pargaonkar, Pavel Shilovsky,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

If you are opening O_DIRECT why wouldn't you use oplock, ie still
request oplock, simply to minimize metadata traffic (you don't have to
send stat across the wire).  The reads and writes aren't cached but
the inode metadata would be.

On Thu, Aug 21, 2014 at 6:26 AM, Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> wrote:
> On Wed, 20 Aug 2014 19:39:11 +0900
> Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
>
>> Currently cifs have all or nothing approach for directIO operations.
>> cache=strict mode does not allow directIO while cache=none mode performs
>> all the operations as directIO even when user does not specify O_DIRECT
>> flag. This patch enables strict cache mode to honour directIO semantics.
>>
>> Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> ---
>>  fs/cifs/dir.c  |    4 ++++
>>  fs/cifs/file.c |    4 ++++
>>  2 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
>> index 3db0c5f..30e377c 100644
>> --- a/fs/cifs/dir.c
>> +++ b/fs/cifs/dir.c
>> @@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
>>               goto out;
>>       }
>>
>> +     if (file->f_flags & O_DIRECT &&
>> +         CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
>> +             file->f_op = &cifs_file_direct_ops;
>> +
>>       file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
>>       if (file_info == NULL) {
>>               if (server->ops->close)
>> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
>> index bee733e..0d07740 100644
>> --- a/fs/cifs/file.c
>> +++ b/fs/cifs/file.c
>> @@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
>>       cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
>>                inode, file->f_flags, full_path);
>>
>> +     if (file->f_flags & O_DIRECT &&
>> +         cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
>> +             file->f_op = &cifs_file_direct_ops;
>> +
>>       if (server->oplocks)
>>               oplock = REQ_OPLOCK;
>>       else
>
> Looks fine for the most part. You should also avoid requesting an
> oplock if you're going to open O_DIRECT since you won't be using it
> anyway.
>
> --
> Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
       [not found]       ` <CAH2r5mu6LH1YLqWhi4-1dgJH0BQ2CS5Lbym1mGP9EuvgtCP1Wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-08-21 15:02         ` Jeff Layton
       [not found]           ` <20140821110254.4f2dcc95-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Layton @ 2014-08-21 15:02 UTC (permalink / raw)
  To: Steve French
  Cc: Namjae Jeon, Shirish Pargaonkar, Pavel Shilovsky,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

On Thu, 21 Aug 2014 08:24:35 -0500
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> If you are opening O_DIRECT why wouldn't you use oplock, ie still
> request oplock, simply to minimize metadata traffic (you don't have to
> send stat across the wire).  The reads and writes aren't cached but
> the inode metadata would be.
> 

What updates the i_size if a DIO write extends the file?

> On Thu, Aug 21, 2014 at 6:26 AM, Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> wrote:
> > On Wed, 20 Aug 2014 19:39:11 +0900
> > Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> >
> >> Currently cifs have all or nothing approach for directIO operations.
> >> cache=strict mode does not allow directIO while cache=none mode performs
> >> all the operations as directIO even when user does not specify O_DIRECT
> >> flag. This patch enables strict cache mode to honour directIO semantics.
> >>
> >> Signed-off-by: Namjae Jeon <namjae.jeon-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> >> Signed-off-by: Ashish Sangwan <a.sangwan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> >> ---
> >>  fs/cifs/dir.c  |    4 ++++
> >>  fs/cifs/file.c |    4 ++++
> >>  2 files changed, 8 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> >> index 3db0c5f..30e377c 100644
> >> --- a/fs/cifs/dir.c
> >> +++ b/fs/cifs/dir.c
> >> @@ -497,6 +497,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
> >>               goto out;
> >>       }
> >>
> >> +     if (file->f_flags & O_DIRECT &&
> >> +         CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> >> +             file->f_op = &cifs_file_direct_ops;
> >> +
> >>       file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
> >>       if (file_info == NULL) {
> >>               if (server->ops->close)
> >> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> >> index bee733e..0d07740 100644
> >> --- a/fs/cifs/file.c
> >> +++ b/fs/cifs/file.c
> >> @@ -467,6 +467,10 @@ int cifs_open(struct inode *inode, struct file *file)
> >>       cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
> >>                inode, file->f_flags, full_path);
> >>
> >> +     if (file->f_flags & O_DIRECT &&
> >> +         cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> >> +             file->f_op = &cifs_file_direct_ops;
> >> +
> >>       if (server->oplocks)
> >>               oplock = REQ_OPLOCK;
> >>       else
> >
> > Looks fine for the most part. You should also avoid requesting an
> > oplock if you're going to open O_DIRECT since you won't be using it
> > anyway.
> >
> > --
> > Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
> 
> 
> 


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
       [not found]           ` <20140821110254.4f2dcc95-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2014-08-21 15:18             ` Steve French
       [not found]               ` <CAH2r5mvAhxXXzG-Rgt2BD4a8EYsdGRcfUeEZC=AF5XTNO6ZXeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Steve French @ 2014-08-21 15:18 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Namjae Jeon, Shirish Pargaonkar, Pavel Shilovsky,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

On Thu, Aug 21, 2014 at 10:02 AM, Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
> On Thu, 21 Aug 2014 08:24:35 -0500
> Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> If you are opening O_DIRECT why wouldn't you use oplock, ie still
>> request oplock, simply to minimize metadata traffic (you don't have to
>> send stat across the wire).  The reads and writes aren't cached but
>> the inode metadata would be.
>>
>
> What updates the i_size if a DIO write extends the file?

Doesn't direct writes call cifs_user_writev which calls
cifs_iovec_write which calls cifs_write_from_iter which calls
cifs_uncached_writev_complete

so looks like i_size should get set


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/7] cifs: Allow directIO read/write during cache=strict
       [not found]               ` <CAH2r5mvAhxXXzG-Rgt2BD4a8EYsdGRcfUeEZC=AF5XTNO6ZXeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-08-21 15:56                 ` Jeff Layton
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Layton @ 2014-08-21 15:56 UTC (permalink / raw)
  To: Steve French
  Cc: Namjae Jeon, Shirish Pargaonkar, Pavel Shilovsky,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Ashish Sangwan

On Thu, 21 Aug 2014 10:18:37 -0500
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Thu, Aug 21, 2014 at 10:02 AM, Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
> > On Thu, 21 Aug 2014 08:24:35 -0500
> > Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> >> If you are opening O_DIRECT why wouldn't you use oplock, ie still
> >> request oplock, simply to minimize metadata traffic (you don't have to
> >> send stat across the wire).  The reads and writes aren't cached but
> >> the inode metadata would be.
> >>
> >
> > What updates the i_size if a DIO write extends the file?
> 
> Doesn't direct writes call cifs_user_writev which calls
> cifs_iovec_write which calls cifs_write_from_iter which calls
> cifs_uncached_writev_complete
> 
> so looks like i_size should get set
> 
> 

Ok, fair enough then. I still think it's a little silly to request an
oplock that you won't really be using, but I suppose there's no reason
to specifically forbid it.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-21 15:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 10:39 [PATCH 2/7] cifs: Allow directIO read/write during cache=strict Namjae Jeon
2014-08-21  4:52 ` Steve French
     [not found]   ` <CAH2r5mvn86=76_O7QT0WMftjnr3Ek4t5PiqcWCy1HpaKVO=GFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-21 10:07     ` Namjae Jeon
2014-08-21 11:26 ` Jeff Layton
     [not found]   ` <20140821072656.372e613c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-08-21 13:24     ` Steve French
     [not found]       ` <CAH2r5mu6LH1YLqWhi4-1dgJH0BQ2CS5Lbym1mGP9EuvgtCP1Wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-21 15:02         ` Jeff Layton
     [not found]           ` <20140821110254.4f2dcc95-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-08-21 15:18             ` Steve French
     [not found]               ` <CAH2r5mvAhxXXzG-Rgt2BD4a8EYsdGRcfUeEZC=AF5XTNO6ZXeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-21 15:56                 ` Jeff Layton

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.