* [PATCH] ceph: properly put ceph_string reference after async create attempt
@ 2022-01-25 21:08 Jeff Layton
2022-01-26 16:22 ` Ilya Dryomov
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2022-01-25 21:08 UTC (permalink / raw)
To: ceph-devel; +Cc: idryomov
The reference acquired by try_prep_async_create is currently leaked.
Ensure we put it.
Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/ceph/file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index ea1e9ac6c465..cbe4d5a5cde5 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -766,8 +766,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
restore_deleg_ino(dir, req->r_deleg_ino);
ceph_mdsc_put_request(req);
try_async = false;
+ ceph_put_string(rcu_dereference_raw(lo.pool_ns));
goto retry;
}
+ ceph_put_string(rcu_dereference_raw(lo.pool_ns));
goto out_req;
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: properly put ceph_string reference after async create attempt
2022-01-25 21:08 [PATCH] ceph: properly put ceph_string reference after async create attempt Jeff Layton
@ 2022-01-26 16:22 ` Ilya Dryomov
2022-01-26 16:25 ` Jeff Layton
0 siblings, 1 reply; 4+ messages in thread
From: Ilya Dryomov @ 2022-01-26 16:22 UTC (permalink / raw)
To: Jeff Layton; +Cc: Ceph Development
On Tue, Jan 25, 2022 at 10:08 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> The reference acquired by try_prep_async_create is currently leaked.
> Ensure we put it.
>
> Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/ceph/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index ea1e9ac6c465..cbe4d5a5cde5 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -766,8 +766,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
> restore_deleg_ino(dir, req->r_deleg_ino);
> ceph_mdsc_put_request(req);
> try_async = false;
> + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> goto retry;
> }
> + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> goto out_req;
> }
> }
> --
> 2.34.1
>
Hi Jeff,
Where is the try_prep_async_create() reference put in case of success?
It doesn't look like ceph_finish_async_create() actually consumes it.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: properly put ceph_string reference after async create attempt
2022-01-26 16:22 ` Ilya Dryomov
@ 2022-01-26 16:25 ` Jeff Layton
2022-01-26 16:47 ` Ilya Dryomov
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2022-01-26 16:25 UTC (permalink / raw)
To: Ilya Dryomov; +Cc: Ceph Development
On Wed, 2022-01-26 at 17:22 +0100, Ilya Dryomov wrote:
> On Tue, Jan 25, 2022 at 10:08 PM Jeff Layton <jlayton@kernel.org> wrote:
> >
> > The reference acquired by try_prep_async_create is currently leaked.
> > Ensure we put it.
> >
> > Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > fs/ceph/file.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > index ea1e9ac6c465..cbe4d5a5cde5 100644
> > --- a/fs/ceph/file.c
> > +++ b/fs/ceph/file.c
> > @@ -766,8 +766,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
> > restore_deleg_ino(dir, req->r_deleg_ino);
> > ceph_mdsc_put_request(req);
> > try_async = false;
> > + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> > goto retry;
> > }
> > + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> > goto out_req;
> > }
> > }
> > --
> > 2.34.1
> >
>
> Hi Jeff,
>
> Where is the try_prep_async_create() reference put in case of success?
> It doesn't look like ceph_finish_async_create() actually consumes it.
>
The second call above puts it in the case of success, or in the case of
any error that isn't -EJUKEBOX.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: properly put ceph_string reference after async create attempt
2022-01-26 16:25 ` Jeff Layton
@ 2022-01-26 16:47 ` Ilya Dryomov
0 siblings, 0 replies; 4+ messages in thread
From: Ilya Dryomov @ 2022-01-26 16:47 UTC (permalink / raw)
To: Jeff Layton; +Cc: Ceph Development
On Wed, Jan 26, 2022 at 5:25 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> On Wed, 2022-01-26 at 17:22 +0100, Ilya Dryomov wrote:
> > On Tue, Jan 25, 2022 at 10:08 PM Jeff Layton <jlayton@kernel.org> wrote:
> > >
> > > The reference acquired by try_prep_async_create is currently leaked.
> > > Ensure we put it.
> > >
> > > Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible")
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > ---
> > > fs/ceph/file.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > > index ea1e9ac6c465..cbe4d5a5cde5 100644
> > > --- a/fs/ceph/file.c
> > > +++ b/fs/ceph/file.c
> > > @@ -766,8 +766,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
> > > restore_deleg_ino(dir, req->r_deleg_ino);
> > > ceph_mdsc_put_request(req);
> > > try_async = false;
> > > + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> > > goto retry;
> > > }
> > > + ceph_put_string(rcu_dereference_raw(lo.pool_ns));
> > > goto out_req;
> > > }
> > > }
> > > --
> > > 2.34.1
> > >
> >
> > Hi Jeff,
> >
> > Where is the try_prep_async_create() reference put in case of success?
> > It doesn't look like ceph_finish_async_create() actually consumes it.
> >
>
> The second call above puts it in the case of success, or in the case of
> any error that isn't -EJUKEBOX.
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Thanks,
Ilya
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-26 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 21:08 [PATCH] ceph: properly put ceph_string reference after async create attempt Jeff Layton
2022-01-26 16:22 ` Ilya Dryomov
2022-01-26 16:25 ` Jeff Layton
2022-01-26 16:47 ` Ilya Dryomov
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.