mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fscache_aquire_cache: error instead of asserting name is set
@ 2022-03-11 14:12 Dominique Martinet
  0 siblings, 0 replies; only message in thread
From: Dominique Martinet @ 2022-03-11 14:12 UTC (permalink / raw)
  To: David Howells; +Cc: linux-cachefs, linux-kernel, Dominique Martinet

name comes straight from the cachefilesd config file, so return an error that
the daemon handles and reports instead of printing a kernel stack in dmesg

Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
 fs/fscache/cache.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c
index 2749933852a9..6115b974585d 100644
--- a/fs/fscache/cache.c
+++ b/fs/fscache/cache.c
@@ -150,7 +150,9 @@ struct fscache_cache *fscache_acquire_cache(const char *name)
 {
 	struct fscache_cache *cache;
 
-	ASSERT(name);
+	if (!name)
+		return ERR_PTR(-EINVAL);
+
 	cache = fscache_lookup_cache(name, true);
 	if (IS_ERR(cache))
 		return cache;
-- 
2.35.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-11 14:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 14:12 [PATCH] fscache_aquire_cache: error instead of asserting name is set Dominique Martinet

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®