ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "idryomov@gmail.com" <idryomov@gmail.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Cc: Alex Markuze <amarkuze@redhat.com>,
	Patrick Donnelly <pdonnell@redhat.com>,
	David Howells <dhowells@redhat.com>
Subject: Re:  [PATCH 2/2] libceph: drop started parameter of __ceph_open_session()
Date: Mon, 3 Nov 2025 22:49:53 +0000	[thread overview]
Message-ID: <88d57afe9173f4341058941f08e3b82febbf9c7a.camel@ibm.com> (raw)
In-Reply-To: <20251103215329.1856726-3-idryomov@gmail.com>

On Mon, 2025-11-03 at 22:53 +0100, Ilya Dryomov wrote:
> With the previous commit revamping the timeout handling, started isn't
> used anymore.  It could be taken into account by adjusting the initial
> value of the timeout, but there is little point as both callers capture
> the timestamp shortly before calling __ceph_open_session() -- the only
> thing of note that happens in the interim is taking client->mount_mutex
> and that isn't expected to take multiple seconds.
> 
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>  fs/ceph/super.c              | 2 +-
>  include/linux/ceph/libceph.h | 3 +--
>  net/ceph/ceph_common.c       | 5 ++---
>  3 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index 48f184aea1bb..20cb336ebc9f 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -1152,7 +1152,7 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
>  		const char *path = fsc->mount_options->server_path ?
>  				     fsc->mount_options->server_path + 1 : "";
>  
> -		err = __ceph_open_session(fsc->client, started);
> +		err = __ceph_open_session(fsc->client);
>  		if (err < 0)
>  			goto out;
>  
> diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
> index 733e7f93db66..63e0e2aa1ce9 100644
> --- a/include/linux/ceph/libceph.h
> +++ b/include/linux/ceph/libceph.h
> @@ -306,8 +306,7 @@ struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);
>  u64 ceph_client_gid(struct ceph_client *client);
>  extern void ceph_destroy_client(struct ceph_client *client);
>  extern void ceph_reset_client_addr(struct ceph_client *client);
> -extern int __ceph_open_session(struct ceph_client *client,
> -			       unsigned long started);
> +extern int __ceph_open_session(struct ceph_client *client);
>  extern int ceph_open_session(struct ceph_client *client);
>  int ceph_wait_for_latest_osdmap(struct ceph_client *client,
>  				unsigned long timeout);
> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
> index 285e981730e5..e734e57be083 100644
> --- a/net/ceph/ceph_common.c
> +++ b/net/ceph/ceph_common.c
> @@ -788,7 +788,7 @@ EXPORT_SYMBOL(ceph_reset_client_addr);
>  /*
>   * mount: join the ceph cluster, and open root directory.
>   */
> -int __ceph_open_session(struct ceph_client *client, unsigned long started)
> +int __ceph_open_session(struct ceph_client *client)
>  {
>  	DEFINE_WAIT_FUNC(wait, woken_wake_function);
>  	long timeout = ceph_timeout_jiffies(client->options->mount_timeout);
> @@ -844,12 +844,11 @@ EXPORT_SYMBOL(__ceph_open_session);
>  int ceph_open_session(struct ceph_client *client)
>  {
>  	int ret;
> -	unsigned long started = jiffies;  /* note the start time */
>  
>  	dout("open_session start\n");
>  	mutex_lock(&client->mount_mutex);
>  
> -	ret = __ceph_open_session(client, started);
> +	ret = __ceph_open_session(client);
>  
>  	mutex_unlock(&client->mount_mutex);
>  	return ret;

Looks good.

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>

Thanks,
Slava.

      reply	other threads:[~2025-11-03 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 21:53 [PATCH 0/2] libceph: fix potential use-after-free in have_mon_and_osd_map() Ilya Dryomov
2025-11-03 21:53 ` [PATCH 1/2] " Ilya Dryomov
2025-11-03 22:49   ` Viacheslav Dubeyko
2025-11-03 21:53 ` [PATCH 2/2] libceph: drop started parameter of __ceph_open_session() Ilya Dryomov
2025-11-03 22:49   ` Viacheslav Dubeyko [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=88d57afe9173f4341058941f08e3b82febbf9c7a.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=pdonnell@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).