Commit 86db0c32 authored by Randall P. Embry's avatar Randall P. Embry Committed by Dominique Martinet
Browse files

9p: fix /sys/fs/9p/caches overwriting itself



caches_show() overwrote its buffer on each iteration,
so only the last cache tag was visible in sysfs output.

Properly append with snprintf(buf + count, …).

Signed-off-by: default avatarRandall P. Embry <rpembry@gmail.com>
Message-ID: <20250926-v9fs_misc-v1-2-a8b3907fc04d@codewreck.org>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent 623fa18f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ static ssize_t caches_show(struct kobject *kobj,
	spin_lock(&v9fs_sessionlist_lock);
	list_for_each_entry(v9ses, &v9fs_sessionlist, slist) {
		if (v9ses->cachetag) {
			n = snprintf(buf, limit, "%s\n", v9ses->cachetag);
			n = snprintf(buf + count, limit, "%s\n", v9ses->cachetag);
			if (n < 0) {
				count = n;
				break;