Message ID | 20200715095217.441885-8-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Mike Snitzer |
Headers | show
Return-Path: <SRS0=6HR9=A2=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 9C41D1510 for <patchwork-dm-devel@patchwork.kernel.org>; Wed, 15 Jul 2020 09:52:39 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52B7A2064C for <patchwork-dm-devel@patchwork.kernel.org>; Wed, 15 Jul 2020 09:52:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52B7A2064C 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-364-D6VsJmKFNZuTO_MR97WL-g-1; Wed, 15 Jul 2020 05:52:36 -0400 X-MC-Unique: D6VsJmKFNZuTO_MR97WL-g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C980E800EB6; Wed, 15 Jul 2020 09:52:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABCAE19C4F; Wed, 15 Jul 2020 09:52:31 +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 83BE7180954D; Wed, 15 Jul 2020 09:52:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06F9qTTZ007910 for <dm-devel@listman.util.phx.redhat.com>; Wed, 15 Jul 2020 05:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37E71215688E; Wed, 15 Jul 2020 09:52:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 321932156A4D for <dm-devel@redhat.com>; Wed, 15 Jul 2020 09:52:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 EA7FC185A797 for <dm-devel@redhat.com>; Wed, 15 Jul 2020 09:52:28 +0000 (UTC) Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-31-VbhgQGY7OqGYJP-4Oc0sGw-4; Wed, 15 Jul 2020 05:52:24 -0400 X-MC-Unique: VbhgQGY7OqGYJP-4Oc0sGw-4 IronPort-SDR: 0Ur6ZNExi/dSKt/xJy5QxxKqGfCgW6o62N7DMBbdJrgALOarXlhXR9XWC9uvJdqZFsTKd+pV43 wpxADaeRCKCQr4Wa5m9WY/0puzBy7P2MenxWG/3gMQ3Qt5NbCz4oFtk20tYnCgQ7tpmy1YXdjB DSVP/rX4aMpDT1MaE4jPG9d/dT84doR0Q6ogyS/Q3IRC60IYSIcivVaW+O7pQcncYfYv/I/Snh mMOcmW2JXTpYtJnbfaJxfLMSfbkTmvHKW0nl1SeuWlz72jl9I6KfhVPkwrkRVMN5mfh3MLtQS4 U8M= X-IronPort-AV: E=Sophos;i="5.75,354,1589212800"; d="scan'208";a="251769674" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 15 Jul 2020 17:52:24 +0800 IronPort-SDR: e3w/WQi5Frh9nZXKtLr7ZspomL5yeq7iDvJiOE/lkSsUOx4CmKmh6R0k5/P3+7mafMMra+HJMh rXgWh2g4rUALcBodoE2fbDcq+rnNdt+kk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2020 02:40:17 -0700 IronPort-SDR: LxE990Ie3FlcgV7fqCnmSy/VdkIeSQ7P9yzSMahf8szQTUEqJkb4NfuCyyuSQ5obVNemmyRQ2n Yuqb+Hcq5Ljw== WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip01.wdc.com with ESMTP; 15 Jul 2020 02:52:23 -0700 From: Damien Le Moal <damien.lemoal@wdc.com> To: dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com> Date: Wed, 15 Jul 2020 18:52:16 +0900 Message-Id: <20200715095217.441885-8-damien.lemoal@wdc.com> In-Reply-To: <20200715095217.441885-1-damien.lemoal@wdc.com> References: <20200715095217.441885-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com Cc: Damien Le Moal <damien.lemoal@wdc.com> Subject: [dm-devel] [PATCH 7/8] 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.23 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(-)