Skip to content

Commit db3a754

Browse files
rpembryUlrich Hecht
authored andcommitted
9p: fix /sys/fs/9p/caches overwriting itself
[ Upstream commit 86db0c32f16c5538ddb740f54669ace8f3a1f3d7 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent d421f5a commit db3a754

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/9p/v9fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static ssize_t caches_show(struct kobject *kobj,
573573
spin_lock(&v9fs_sessionlist_lock);
574574
list_for_each_entry(v9ses, &v9fs_sessionlist, slist) {
575575
if (v9ses->cachetag) {
576-
n = snprintf(buf, limit, "%s\n", v9ses->cachetag);
576+
n = snprintf(buf + count, limit, "%s\n", v9ses->cachetag);
577577
if (n < 0) {
578578
count = n;
579579
break;

0 commit comments

Comments
 (0)