From nobody Sat Feb 7 17:54:49 2026 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7801678F2E for ; Tue, 27 Jan 2026 22:47:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769554057; cv=none; b=BsTkbXKpAkexmGvf97+7sQtbATpM25o6q3vv7A83rMgaOzPxIaCNl6xDU9BPNbncLEa3yf4J0bQKjxQuUPcTObBTl68LRu2uvnNxYv1ZlSRIE0XjiuuaLJ8dYp1jNxYPRCwElGzkCobeQsdlIRLnK2vIOupqWo78dFiqmVNx4IY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769554057; c=relaxed/simple; bh=rxKPwcFV5LiWbF8J192T52CToC0Im8WcvNbwQCSPe48=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PU2KI0BUc2qo37RYkrEBZgWJq9OtVq+qAqXnj1SOCzrkTjdgGT/VjaSW/+dSmShwAhCoHiQJ9y+LerDeIyPX6gSSN9T4zWU5apsobfFH9SIBAdTQ0gw2ln92HTTvRCf07j8Ud2LVGbbUpe+9DbslOWicjFvhYfaeAV6ldBCOtoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ov1wHpv1; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ov1wHpv1" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769554042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LPzlGaYUwAZGiguRuCxkDSRCIUPpFM+cmPr/UWKmARM=; b=ov1wHpv1orAuCQX8ZaTr9x3OOM6s1euRxC6GqS1NFebtTcZNkjgp40sUPxf+39oyS8Xu62 8UQgN83oLckWv6aHMXvQM4rf6zJXhRz4/EcNwbGzXSn18Il6us6Mp1nuYKmLvTVGOj9kfc mm/glncJPn2X1ymviDPppNkJlneidtM= From: Thorsten Blum To: Jens Axboe Cc: Thorsten Blum , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: Replace snprintf with strscpy in check_partition Date: Tue, 27 Jan 2026 23:47:01 +0100 Message-ID: <20260127224704.440877-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace snprintf("%s", ...) with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum --- block/partitions/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 815ed33caa1b..079057ab535a 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -130,7 +131,7 @@ static struct parsed_partitions *check_partition(struct= gendisk *hd) state->pp_buf[0] =3D '\0'; =20 state->disk =3D hd; - snprintf(state->name, BDEVNAME_SIZE, "%s", hd->disk_name); + strscpy(state->name, hd->disk_name); snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name); if (isdigit(state->name[strlen(state->name)-1])) sprintf(state->name, "p"); --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4