mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: Marc Dionne <marc.dionne@auristor.com>,
	Christian Brauner <brauner@kernel.org>,
	netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fscache: Fix error handling in fscache_begin_operation()
Date: Fri, 15 Mar 2024 14:34:27 -0400	[thread overview]
Message-ID: <026cb22e882ff96040207fbc31d61aaa972ad531.camel@kernel.org> (raw)
In-Reply-To: <3933237.1710514106@warthog.procyon.org.uk>

On Fri, 2024-03-15 at 14:48 +0000, David Howells wrote:
>     
> Fix fscache_begin_operation() to clear cres->cache_priv on error, otherwise
> fscache_resources_valid() will report it as being valid.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> Reported-by: Marc Dionne <marc.dionne@auristor.com>
> cc: Jeff Layton <jlayton@kernel.org>
> cc: netfs@lists.linux.dev
> cc: linux-fsdevel@vger.kernel.org
> ---
>  fs/netfs/fscache_io.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/netfs/fscache_io.c b/fs/netfs/fscache_io.c
> index ad57e4412c6d..cfd58ad95e7c 100644
> --- a/fs/netfs/fscache_io.c
> +++ b/fs/netfs/fscache_io.c
> @@ -83,8 +83,10 @@ static int fscache_begin_operation(struct netfs_cache_resources *cres,
>  	cres->debug_id		= cookie->debug_id;
>  	cres->inval_counter	= cookie->inval_counter;
>  
> -	if (!fscache_begin_cookie_access(cookie, why))
> +	if (!fscache_begin_cookie_access(cookie, why)) {
> +		cres->cache_priv = NULL;
>  		return -ENOBUFS;
> +	}
>  
>  again:
>  	spin_lock(&cookie->lock);
> 
> 

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2024-03-15 18:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 14:48 David Howells
2024-03-15 18:34 ` Jeff Layton [this message]
2024-03-18  8:48 ` Christian Brauner

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=026cb22e882ff96040207fbc31d61aaa972ad531.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netfs@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®