All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT.
@ 2015-08-13  9:01 Ma, Jianpeng
  2015-08-13  9:59 ` Yan, Zheng
  0 siblings, 1 reply; 4+ messages in thread
From: Ma, Jianpeng @ 2015-08-13  9:01 UTC (permalink / raw)
  To: Sage Weil; +Cc: ceph-devel, zyan

Because flags removed the O_CREAT, so we should use file->f_flags.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
---
 fs/ceph/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 8b79d87..e1347cf 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file)
        ihold(inode);

        req->r_num_caps = 1;
-       if (flags & O_CREAT)
+       if (file->f_flags & O_CREAT)
                parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
        err = ceph_mdsc_do_request(mdsc, parent_inode, req);
        iput(parent_inode);
--
2.4.3

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

* Re: [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT.
  2015-08-13  9:01 [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT Ma, Jianpeng
@ 2015-08-13  9:59 ` Yan, Zheng
  2015-08-13 12:34   ` Sage Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Yan, Zheng @ 2015-08-13  9:59 UTC (permalink / raw)
  To: Ma, Jianpeng; +Cc: Sage Weil, ceph-devel, zyan

On Thu, Aug 13, 2015 at 5:01 PM, Ma, Jianpeng <jianpeng.ma@intel.com> wrote:
> Because flags removed the O_CREAT, so we should use file->f_flags.
>
> Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
> ---
>  fs/ceph/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index 8b79d87..e1347cf 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file)
>         ihold(inode);
>
>         req->r_num_caps = 1;
> -       if (flags & O_CREAT)
> +       if (file->f_flags & O_CREAT)
>                 parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
>         err = ceph_mdsc_do_request(mdsc, parent_inode, req);
>         iput(parent_inode);

In this case, we do not need parent_inode because file already exists.
I'd like to remove the code that finds parent inode.


Regards
Yan, Zheng

> --
> 2.4.3
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT.
  2015-08-13  9:59 ` Yan, Zheng
@ 2015-08-13 12:34   ` Sage Weil
  2015-08-13 13:25     ` Yan, Zheng
  0 siblings, 1 reply; 4+ messages in thread
From: Sage Weil @ 2015-08-13 12:34 UTC (permalink / raw)
  To: Yan, Zheng; +Cc: Ma, Jianpeng, ceph-devel, zyan

On Thu, 13 Aug 2015, Yan, Zheng wrote:
> On Thu, Aug 13, 2015 at 5:01 PM, Ma, Jianpeng <jianpeng.ma@intel.com> wrote:
> > Because flags removed the O_CREAT, so we should use file->f_flags.
> >
> > Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
> > ---
> >  fs/ceph/file.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > index 8b79d87..e1347cf 100644
> > --- a/fs/ceph/file.c
> > +++ b/fs/ceph/file.c
> > @@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file)
> >         ihold(inode);
> >
> >         req->r_num_caps = 1;
> > -       if (flags & O_CREAT)
> > +       if (file->f_flags & O_CREAT)
> >                 parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
> >         err = ceph_mdsc_do_request(mdsc, parent_inode, req);
> >         iput(parent_inode);
> 
> In this case, we do not need parent_inode because file already exists.
> I'd like to remove the code that finds parent inode.

Do you mean that O_CREAT is only removed in the case where the inode 
already exists?  Because there is at least one case where we do a single 
op to the MDS that does the create + open, and in that case we do need to 
make sure a dir fsync waits for it to commit.  As long as we don't break 
that one!

sage

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

* Re: [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT.
  2015-08-13 12:34   ` Sage Weil
@ 2015-08-13 13:25     ` Yan, Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Yan, Zheng @ 2015-08-13 13:25 UTC (permalink / raw)
  To: Sage Weil; +Cc: Ma, Jianpeng, ceph-devel, zyan

On Thu, Aug 13, 2015 at 8:34 PM, Sage Weil <sage@newdream.net> wrote:
> On Thu, 13 Aug 2015, Yan, Zheng wrote:
>> On Thu, Aug 13, 2015 at 5:01 PM, Ma, Jianpeng <jianpeng.ma@intel.com> wrote:
>> > Because flags removed the O_CREAT, so we should use file->f_flags.
>> >
>> > Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
>> > ---
>> >  fs/ceph/file.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
>> > index 8b79d87..e1347cf 100644
>> > --- a/fs/ceph/file.c
>> > +++ b/fs/ceph/file.c
>> > @@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file)
>> >         ihold(inode);
>> >
>> >         req->r_num_caps = 1;
>> > -       if (flags & O_CREAT)
>> > +       if (file->f_flags & O_CREAT)
>> >                 parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
>> >         err = ceph_mdsc_do_request(mdsc, parent_inode, req);
>> >         iput(parent_inode);
>>
>> In this case, we do not need parent_inode because file already exists.
>> I'd like to remove the code that finds parent inode.
>
> Do you mean that O_CREAT is only removed in the case where the inode
> already exists?  Because there is at least one case where we do a single
> op to the MDS that does the create + open, and in that case we do need to
> make sure a dir fsync waits for it to commit.  As long as we don't break
> that one!
>

create+open case is handled by ceph_atomic_open or ceph_create.
ceph_open is used only when inode already exists.

Regards
Yan, Zheng

> sage

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

end of thread, other threads:[~2015-08-13 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13  9:01 [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT Ma, Jianpeng
2015-08-13  9:59 ` Yan, Zheng
2015-08-13 12:34   ` Sage Weil
2015-08-13 13:25     ` Yan, Zheng

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.