fscache: Fix error handling in fscache_begin_operation()
authorDavid Howells <dhowells@redhat.com>
Fri, 15 Mar 2024 14:48:26 +0000 (14:48 +0000)
committerChristian Brauner <brauner@kernel.org>
Mon, 18 Mar 2024 09:33:48 +0000 (10:33 +0100)
commit449ac5514631dd9b9b66dd708dd5beb1428e2812
tree26b51e67139e6ac4965cb0b245948eeb681eb4b7
parent59a55a63c24624c7ad268f12c8f82d142ef6a6d4
fscache: Fix error handling in fscache_begin_operation()

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>
Link: https://lore.kernel.org/r/3933237.1710514106@warthog.procyon.org.uk
Reviewed-by: Jeff Layton <jlayton@kernel.org>
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
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/netfs/fscache_io.c