Received: by 10.223.164.221 with SMTP id h29csp77882wrb; Fri, 3 Nov 2017 05:57:11 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Te1C57V3oOCuP07RwXz+lZGOfSr2/6HtQTojwL9lk+oZXhkLJHed4BYFRCjf3lhiZRJCD5 X-Received: by 10.99.108.2 with SMTP id h2mr7156794pgc.362.1509713831859; Fri, 03 Nov 2017 05:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509713831; cv=none; d=google.com; s=arc-20160816; b=y/KEwZT/TkFLupMJFxOzJke/yuMdZaLcKY7jOZ7qb3gQXKUqUEn+zSgkLWookG/KDi qcDAm90AGyDm8v4g8eB0vjWv+Qzonbe7G5z4XxLyDERfFFbJj9qANUSPOyeylu6g0x1M /ywabKEij2GpNsckZqwv38EKpQRDIWwaUjv5geyEv99xaSby74WbAiDGyrtRLkwyd6Be LynDAgQrKUzBiBH4mrfXYXsTiC1amXdkuDWECqLHtUm6IPwaF4LdL40g3lRHhhO6kYEb dX685b+vW/j0Oy8kcww0C+Q3eVaONEOp+bxQqGjs1uNWLEf/D+86PNGZ9Z0MT8ChJUR6 4LnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature :arc-authentication-results; bh=FLFNtQ0buvBi8/7dLeSzzJnDVf3dMylkgsXJ6jUcxr4=; b=LCMq+LB0QKAdHdf5i31M6bRnBPO8bv3ff8nTz2qP5TZaLIQ57Nm8+MVS4akPltn6fZ iYthHx6UGLUjdYj1jkROxDLYO+Jj2vUbMDG6w5jAisyVam2Qql9f4ZiuPqkBLIT52XKt o3hnU04GKG4BZ3/EAbjyeCgDBG38yCbu8VrpXpLHkw1i78qucbTSFg37+y3o25pSRPXx jfb9qhezGyFwlW0wkvrVfcdHgij/L+3hm9Km8QBYqatbGkTX4n054T3j7DYe9X+0Q00i I0zu1rAueGz7t0Q+rD32RTOR+k2DFPvdP5Hs0RiwGqCU3Oo6U7pFDWUpsMbowhkN0TZZ IqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=owb3szlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8si4276922plb.717.2017.11.03.05.56.57; Fri, 03 Nov 2017 05:57:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=owb3szlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756147AbdKCM4Q (ORCPT + 96 others); Fri, 3 Nov 2017 08:56:16 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:51267 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbdKCM4O (ORCPT ); Fri, 3 Nov 2017 08:56:14 -0400 Received: by mail-wm0-f66.google.com with SMTP id b9so1395168wmh.0 for ; Fri, 03 Nov 2017 05:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=FLFNtQ0buvBi8/7dLeSzzJnDVf3dMylkgsXJ6jUcxr4=; b=owb3szlSLkvjsxq9nT8gEzDMaPPJ0drzk4VL6OD/nXGKliRocUBRbVJ8zTxYYfS33l uJrJsDOC2qc9FBuusV4J8dfI6yaYP/0Q6sRuwxcioOzfaZyy7zfUUo+e3CtcodvnFVy1 idJamjQl52Z4ZANNSXfOvyQ+1IMoTnTIRWD4lOHL76mvzIQU2EKiiZYAx2LPShfixgV5 VDrD0DPFW4sQ5JZzmnMm+LV1HA8HDkdLP5FkPpClrD3bKqdkRhSLmW7yenaqic3pxUWs hYO0ixaei2c07DsGF92QhdmPiSWMP0D+coNpwXOh2iqSj4fvSGxlU4RfEcIFDOrqc2pW vMdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=FLFNtQ0buvBi8/7dLeSzzJnDVf3dMylkgsXJ6jUcxr4=; b=UIylEdOG+kr4QwRMnGVVP5vsrpmtKgOoMUkWEFZRLpf3jH7wXUNJj2J1U33wm1T4P+ tzYRmu+95Puz7Bl7gGqiaXv0OsxzuWuV9wt43b9loKoaA5PkzmGa/CNNkhl49qIKftWE TAxC+OZroFy611gbI8k/XDwZyYndSQbvBuJjaxHBdDQpWkB4WrgM/eXbpmUubkhrZozQ j/nGeRMkb0JVCjnrgD62h3iA6DgfcbMnee9ZuMkYVHq1F1iN5S+8Izh7qr0ixtCU+Uke HkRY/37likB0qqJFPTaBT78rI2Atla99P+ygvk4xQJjfYE3tJCuDDIcDQ8/sOq7FYzZv iWUg== X-Gm-Message-State: AMCzsaU+6YKxI2z3Y3zzf8M3t3UW/Qh1pEN/pV+80+lYkMhdmhszpKnP hkl/bgKS/kEySHcKsCH3qrFZdQ== X-Received: by 10.80.213.14 with SMTP id u14mr8568165edi.87.1509713773715; Fri, 03 Nov 2017 05:56:13 -0700 (PDT) Received: from mac-halley13.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id k5sm4566137edc.61.2017.11.03.05.56.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 05:56:13 -0700 (PDT) From: =?utf-8?Q?Javier_Gonz=C3=A1lez?= Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_95D3AB21-3E0D-44A7-B5BB-C4A5F9AB119A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH 2/3] nvme: compare NQN string with right size Date: Fri, 3 Nov 2017 13:56:11 +0100 In-Reply-To: <20171103125429.GB25186@lst.de> Cc: Sagi Grimberg , Keith Busch , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig References: <1509703370-20379-1-git-send-email-javier@cnexlabs.com> <1509703370-20379-3-git-send-email-javier@cnexlabs.com> <20171103125429.GB25186@lst.de> X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_95D3AB21-3E0D-44A7-B5BB-C4A5F9AB119A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 3 Nov 2017, at 13.54, Christoph Hellwig wrote: >=20 > On Fri, Nov 03, 2017 at 11:02:49AM +0100, Javier Gonz=C3=A1lez wrote: >> Compare subnqns using NVMF_NQN_SIZE as it is < 256 >>=20 >> Signed-off-by: Javier Gonz=C3=A1lez >> --- >> drivers/nvme/host/core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c >> index bd1d5ff911c9..ae8ab0a1ef0d 100644 >> --- a/drivers/nvme/host/core.c >> +++ b/drivers/nvme/host/core.c >> @@ -1743,7 +1743,7 @@ static void nvme_init_subnqn(struct nvme_ctrl = *ctrl, struct nvme_id_ctrl *id) >>=20 >> nqnlen =3D strnlen(id->subnqn, NVMF_NQN_SIZE); >> if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) { >> - strcpy(ctrl->subnqn, id->subnqn); >> + strncpy(ctrl->subnqn, id->subnqn, NVMF_NQN_SIZE); >> return; >> } >=20 > This isn't a compare, but a copy. Except for that it looks ok to me. True. Can you change the message when picking it up? --Apple-Mail=_95D3AB21-3E0D-44A7-B5BB-C4A5F9AB119A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEm1mT7zen+vs9+T8kYx8FO3WZGMoFAln8Z2sACgkQYx8FO3WZ GMrbABAAieU9sDa3a3J1dPjWv0BWw8qGRNo4n1UUeAufE+pFC+kHvbCAxkHC5ATh kULh6bWLiKsr6nuRbwNzeHeq2cyqxfMwgCurFleiDAXHmSQFrWo0KyRNfsD3uIG5 Xp/XvTlpmjkK1oPPovlAwtbzwejPUlTPB8VwG4yTDmIqg7vV9oXStiFfp4YZyISD 1FjL0zs430Put8gKjgqA7X93/BmjfntIPFDaelAlYa6Acloct45gmjLdcP52bISU QH61QAeWWnodW5Rbw8HfrmpkBctSkNFcI4La5b2Tchi2pL2LAgPXEX7FHe8uuXFR 7I4RXn/EQZnkD7TeP/6dxZx4GcZQVA5mIQI5KvIm1tWaMe1GzR83rfavITFA8CU0 cXfGdl4gpxqCdFU7mLzGGyY6qmey+ukw/mWov8ZP+V1/HyayUeAlgb9thmHl5r6W 45Wyg2KrQcJ/0uN62EvdGVedlSedP1Ezp6HXAcknWa2jaxqXgi4z/Ead+0Tuzbg6 DfkXqQLK8u5wkmFgpJCrv4NgY2vQ0SQnGvCIMpEZLEmX+jNe3ffJAl2slRdR/hU7 r3mkc+llipr7syXVXcLUdwMa+6SeU8dlxe0HqexVm7LNPNe72Y6pAfO7sMNAq+hD 2mtXWPYAS/Vc/j9SzedSFw4f2gOHhQUFc6+AL3wJBj3FQ+AEUKU= =sToE -----END PGP SIGNATURE----- --Apple-Mail=_95D3AB21-3E0D-44A7-B5BB-C4A5F9AB119A-- From 1583049596812419669@xxx Fri Nov 03 12:55:42 +0000 2017 X-GM-THRID: 1583038890881081104 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread