lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100317182136.0f2ab805@notabene.brown>
Date:	Wed, 17 Mar 2010 18:21:36 +1100
From:	Neil Brown <neilb@...e.de>
To:	Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	Greg KH <greg@...ah.com>, linux-next@...r.kernel.org,
	linux-kernel@...r.kernel.org, Sage Weil <sage@...dream.net>
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, 17 Mar 2010 15:41:45 +1100
Stephen Rothwell <sfr@...b.auug.org.au> wrote:

> Hi Greg,
> 
> After merging the driver-core tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> fs/ceph/msgpool.c: In function 'ceph_msgpool_put':
> fs/ceph/msgpool.c:173: error: implicit declaration of function 'kref_set'
> 
> Caused by commit 10c5d9fdc9ba89606b34f01cbe6ea287abba7395 ("kref: remove
> kref_set") from the driver-core tree interacting with commit
> c2e552e76e2c6907ca50cd9a4b747a2e2e8c615e ("ceph: use kref for ceph_msg")
> from the ceph tree.
> 
> I applied the following patch for today (which may not be correct):

I would say this is correct.

The msg has seen it's last_put and is being placed in the pool of
free messages, so it needs to be in the same state that ceph_msg_new
(called in __fill_msgpool) leaves it in.
ceph_msg_new used kref_init, so ceph_msgpool_put should use kref_init too to
match.

It is a pity that this code cannot use mempool_t....
What if mempool_t were changed to only re-alloc the vector of pointers when
it grew, or when it shrank to less than 1/2 it's current size.  Would that
reduce the frequency of allocations enough for you to be comfortable with it? 
i.e. always make the vector a power-of-2 size (which is what is probably
allocated anyway) while the pool size might be less.
??

NeilBrown

> 
> [Sage, if this patch is correct, it should be applied to the ceph tree.]
> 
> From: Stephen Rothwell <sfr@...b.auug.org.au>
> Date: Wed, 17 Mar 2010 15:35:22 +1100
> Subject: [PATCH] ceph: update for removal of kref_set
> 
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
> ---
>  fs/ceph/msgpool.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ceph/msgpool.c b/fs/ceph/msgpool.c
> index ca3b44a..030297f 100644
> --- a/fs/ceph/msgpool.c
> +++ b/fs/ceph/msgpool.c
> @@ -170,7 +170,7 @@ void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg)
>  		msg->front.iov_len = pool->front_len;
>  		msg->hdr.front_len = cpu_to_le32(pool->front_len);
>  
> -		kref_set(&msg->kref, 1);  /* retake a single ref */
> +		kref_init(&msg->kref);  /* retake a single ref */
>  		list_add(&msg->list_head, &pool->msgs);
>  		pool->num++;
>  		dout("msgpool_put %p reclaim %p, now %d/%d\n", pool, msg,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ