public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fscache: drop fscache_cookie_put on duplicated cookies in the hash
@ 2020-03-09 16:16 Luis Henriques
  2020-04-03 14:48 ` Luis Henriques
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Henriques @ 2020-03-09 16:16 UTC (permalink / raw)
  To: David Howells; +Cc: linux-cachefs, linux-kernel

When there's a collision due to a duplicate cookie, __fscache_register_netfs
will do an fscache_cookie_put.  This, however, isn't required as
fscache_cookie_get hasn't been executed, and will lead to a NULL pointer as
fscache_unhash_cookie will be called.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
---
 fs/fscache/netfs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/fscache/netfs.c b/fs/fscache/netfs.c
index cce92216fa28..07a55371f0a4 100644
--- a/fs/fscache/netfs.c
+++ b/fs/fscache/netfs.c
@@ -52,7 +52,6 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
 	return 0;
 
 already_registered:
-	fscache_cookie_put(candidate, fscache_cookie_put_dup_netfs);
 	_leave(" = -EEXIST");
 	return -EEXIST;
 }

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

* Re: [PATCH] fscache: drop fscache_cookie_put on duplicated cookies in the hash
  2020-03-09 16:16 [PATCH] fscache: drop fscache_cookie_put on duplicated cookies in the hash Luis Henriques
@ 2020-04-03 14:48 ` Luis Henriques
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Henriques @ 2020-04-03 14:48 UTC (permalink / raw)
  To: David Howells; +Cc: linux-cachefs, linux-kernel

Ping?

Cheers,
--
Luis

On Mon, Mar 09, 2020 at 04:16:43PM +0000, Luis Henriques wrote:
> When there's a collision due to a duplicate cookie, __fscache_register_netfs
> will do an fscache_cookie_put.  This, however, isn't required as
> fscache_cookie_get hasn't been executed, and will lead to a NULL pointer as
> fscache_unhash_cookie will be called.
> 
> Signed-off-by: Luis Henriques <lhenriques@suse.com>
> ---
>  fs/fscache/netfs.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/fscache/netfs.c b/fs/fscache/netfs.c
> index cce92216fa28..07a55371f0a4 100644
> --- a/fs/fscache/netfs.c
> +++ b/fs/fscache/netfs.c
> @@ -52,7 +52,6 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
>  	return 0;
>  
>  already_registered:
> -	fscache_cookie_put(candidate, fscache_cookie_put_dup_netfs);
>  	_leave(" = -EEXIST");
>  	return -EEXIST;
>  }


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

end of thread, other threads:[~2020-04-03 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-09 16:16 [PATCH] fscache: drop fscache_cookie_put on duplicated cookies in the hash Luis Henriques
2020-04-03 14:48 ` Luis Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox