Skip to content

Commit 86db0c3

Browse files
rpembrymartinetd
authored andcommitted
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: Randall P. Embry <rpembry@gmail.com> Message-ID: <20250926-v9fs_misc-v1-2-a8b3907fc04d@codewreck.org> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 623fa18 commit 86db0c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/9p/v9fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static ssize_t caches_show(struct kobject *kobj,
560560
spin_lock(&v9fs_sessionlist_lock);
561561
list_for_each_entry(v9ses, &v9fs_sessionlist, slist) {
562562
if (v9ses->cachetag) {
563-
n = snprintf(buf, limit, "%s\n", v9ses->cachetag);
563+
n = snprintf(buf + count, limit, "%s\n", v9ses->cachetag);
564564
if (n < 0) {
565565
count = n;
566566
break;

0 commit comments

Comments
 (0)