Message ID | 20200716043815.605448-4-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Mike Snitzer |
Headers | show
Return-Path: <SRS0=Z8l/=A3=redhat.com=dm-devel-bounces@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FBE1618 for <patchwork-dm-devel@patchwork.kernel.org>; Thu, 16 Jul 2020 04:38:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44C0D2071B for <patchwork-dm-devel@patchwork.kernel.org>; Thu, 16 Jul 2020 04:38:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44C0D2071B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-132--cuHUodUNs20Hx10Xha6-w-1; Thu, 16 Jul 2020 00:38:34 -0400 X-MC-Unique: -cuHUodUNs20Hx10Xha6-w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B541610059BB; Thu, 16 Jul 2020 04:38:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FFA81001B2C; Thu, 16 Jul 2020 04:38:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F39339622F; Thu, 16 Jul 2020 04:38:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06G4cQBV010367 for <dm-devel@listman.util.phx.redhat.com>; Thu, 16 Jul 2020 00:38:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6888110CB297; Thu, 16 Jul 2020 04:38:26 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 646F010CB296 for <dm-devel@redhat.com>; Thu, 16 Jul 2020 04:38:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B85F085A5B3 for <dm-devel@redhat.com>; Thu, 16 Jul 2020 04:38:23 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-lQyxvcAKM6CyEg9C_N_hhg-1; Thu, 16 Jul 2020 00:38:21 -0400 X-MC-Unique: lQyxvcAKM6CyEg9C_N_hhg-1 IronPort-SDR: IVVl8xYpiWFrwZd5OYxmAXG0AE4VNiSq7RZnSM47VZCPyG2yuDROM8Pspdxp4W4tjIxC8gS0sP UeN5zd6DEsZkHfgrr9ktzoxh38pXmbK4EyxZsU+4TTsSLKFKroq0toouffpDFxXNkJHl29uyy5 oOGUTXex/kG8BX2Lq1voZJy5KoYmFWZZhDDmwJ2Vzu3JRaoTdvS4yGni2yfcYaPa3j+JgxIQW1 Kg9FBiOHb2cEh8IxA8O3IPsTymQTv5oznwjCURN4xSM3B8Vm1ETqQzGzaYjm8MLWm2utyYLqWq s/c= X-IronPort-AV: E=Sophos;i="5.75,358,1589212800"; d="scan'208";a="142711056" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Jul 2020 12:38:19 +0800 IronPort-SDR: BiaVJSFWU87i2nxeLt//MjCS05pG1VstIsVqml2Zfw7qfT9FOOgg7kpPSQyimbWumV2oBYS6pW MdSUViXwiDLkuuuFmKRzdwvU4MtADv2E0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2020 21:26:44 -0700 IronPort-SDR: 5yvs1HQkVnBq38SpGu10txQN+fn4taK/hhz3MLsf14E/30uLROeKyibQc53iJuChgw/badonGC TWlK4kirHNFA== WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip01.wdc.com with ESMTP; 15 Jul 2020 21:38:19 -0700 From: Damien Le Moal <damien.lemoal@wdc.com> To: dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com> Date: Thu, 16 Jul 2020 13:38:14 +0900 Message-Id: <20200716043815.605448-4-damien.lemoal@wdc.com> In-Reply-To: <20200716043815.605448-1-damien.lemoal@wdc.com> References: <20200716043815.605448-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: dm-devel@redhat.com Cc: Damien Le Moal <damien.lemoal@wdc.com> Subject: [dm-devel] [PATCH 3/4] dm ioctl: Fix compilation warning X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development <dm-devel.redhat.com> List-Unsubscribe: <https://www.redhat.com/mailman/options/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=unsubscribe> List-Archive: <https://www.redhat.com/archives/dm-devel> List-Post: <mailto:dm-devel@redhat.com> List-Help: <mailto:dm-devel-request@redhat.com?subject=help> List-Subscribe: <https://www.redhat.com/mailman/listinfo/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=subscribe> Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 |
Series |
Various cleanups
|
expand
|
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 489935d5f22d..5792878dbff6 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1168,7 +1168,7 @@ static void retrieve_status(struct dm_table *table, spec->sector_start = ti->begin; spec->length = ti->len; strncpy(spec->target_type, ti->type->name, - sizeof(spec->target_type)); + sizeof(spec->target_type) - 1); outptr += sizeof(struct dm_target_spec); remaining = len - (outptr - outbuf);
In retrieve_status(), when copying the target type name in the target_type string field of struct dm_target_spec, copy at most DM_MAX_TYPE_NAME - 1 character to avoid the compilation warning: warning: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] when compiling with W-1. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> --- drivers/md/dm-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)