From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.1.81; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0081.outbound.protection.outlook.com [104.47.1.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F013B21CF1D05 for ; Tue, 13 Feb 2018 01:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zkexF54t7Dn1PBd908gjxjTanDAgZf90vlemej5L+Sg=; b=DAQDXmB9BuD4cO44HptNSYABjsWsvKSYiUwYg7eMKx2qmoPIQ5kAPie63DQXAMcS7/SUd+RGtbN5j0pfb0hjounDtrnT9BeSPeWB1f74xIr8pUBjWxfUd+QRJxxVeobCU8OPTE9uTfSwwHiZeN5dNRm0/lvaABLGx7p+En2S++4= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB5PR04MB1623.eurprd04.prod.outlook.com (10.164.38.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Tue, 13 Feb 2018 09:43:12 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::5b4:dfb7:891f:32ce]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::5b4:dfb7:891f:32ce%13]) with mapi id 15.20.0485.015; Tue, 13 Feb 2018 09:43:11 +0000 From: Meenakshi Aggarwal To: Leif Lindholm , "ruiyu.ni@intel.com" CC: "ard.biesheuvel@linaro.org" , "ting.ye@intel.com" , "edk2-devel@lists.01.org" , "jaben.carsey@intel.com" , "siyuan.fu@intel.com" , Udit Kumar Thread-Topic: [PATCH] Tftp assert fix for openfile failure case Thread-Index: AQHTWRVOLqxIhGxCkkG6Y1yGC2kEr6OiqepQ Date: Tue, 13 Feb 2018 09:43:11 +0000 Message-ID: References: <1509719192-16582-1-git-send-email-vabhav.sharma@nxp.com> <20171107175458.f4pgne4rkri7lzch@bivouac.eciton.net> <20171108152225.gy6te7rcroqqjr3j@bivouac.eciton.net> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR04MB1623; 6:+a7uF8OziBfNprTWAYpb3EQxB6Yu9psNj0BGxHo8XZ806i/EP1dywo7HnyZEkFeGWnZm0zmXDe/Az64tu4/ZNG4t3wEw2Ngn22aSSe1ypjdrb4deiBdAut3oq1HZBx47qIjDBJjP2lthBU3yPRvq1qvdvXDUlKAErj7zGyOMxK2fEEyusEt4lsXzRV7lEe+xx0PsFz/ZQMydZiL1C0b0DlvITLpPPchZQi/X4a3XcxIly3OiqTSJWXBvM4pbxmVMCaGebXndJKM68wOy4yE9rG+tDpQxI98QPwFacojiHZdZasj4DP3xTAtq2UH71Ya0bDEMog/z4lv4N2z94l++mr834/+70gUT34qRNqHIOh5XnGgap6Nd4ZITWwcx7+tg; 5:ogtX/3dOuAguF3RN9Y07W+ZJEHA9MTuhChphLY2C8Jlc42TdlcUKVWKiYTBWkoTNZYYSrWxxIwbV5I4ZbypAHABdmLFm5xGdBlpXmR3txbV5R0srVvJHNanPX+L/fhTbIC43MCMonOUwJFwhHkWKDjimFHhklsxyEMJFHLciw1c=; 24:iJQSGncuyXuWNHGKeSNPHs+uvTZeCeD3qpNQcThrdzh47miAv3sLvHl4YzWiw4kyJjqaUiUdlunHAkimsZtNfeZrya0vFq8t/XCf0m3v6JQ=; 7:V/gpkJUxVgqy6ZlP15ThyD2/d0S+TZSwz03LdovOYaokLijJOxRUMc4vJ//JbSA69NAzBdO0Eo8ltHXKXvEqVuURmkUEV1HfBgbXGDuj4SVGS38zSKwkjlYbkeAlZUDIxb67XkO193/Vo6HdxItvvqxUZlSGtABhCXnPonVWz/nIfMWREWXKbCfWNyoCSh5f69lx8ffnTSsMnS2rRuJ5VS28oDBJgiAACCXAMFUbnsBdh4PLdeOQUhkgrzQJUoXJ x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(346002)(396003)(39380400002)(13464003)(199004)(189003)(74316002)(229853002)(105586002)(5660300001)(316002)(106356001)(66066001)(14454004)(102836004)(110136005)(55016002)(7736002)(305945005)(186003)(97736004)(26005)(2950100002)(76176011)(53546011)(6506007)(59450400001)(54906003)(575784001)(86362001)(9686003)(6306002)(2501003)(5250100002)(6436002)(7696005)(6246003)(81166006)(3660700001)(3280700002)(81156014)(2906002)(25786009)(68736007)(33656002)(8676002)(8936002)(478600001)(2900100001)(966005)(4326008)(53936002)(6116002)(99286004)(45080400002)(93886005)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1623; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e3425f7c-dd30-483d-535c-08d572c6328c x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:DB5PR04MB1623; x-ms-traffictypediagnostic: DB5PR04MB1623: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231101)(2400082)(944501161)(6055026)(6041288)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB5PR04MB1623; BCL:0; PCL:0; RULEID:; SRVR:DB5PR04MB1623; x-forefront-prvs: 0582641F53 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0PTRZ5W1o/5oiyhG7ghIIWI2op286Uk7q0m4qhgueoBmUPtCzdkdYpcY6OVmKcRw8i7F8r3brGWyP+YBHuXEzg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3425f7c-dd30-483d-535c-08d572c6328c X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2018 09:43:11.9160 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1623 Subject: Re: [PATCH] Tftp assert fix for openfile failure case X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 09:37:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, As per commit 0961002352e9115b72f544dded239ad226efe87b Tftp command will be maintained to extend internal commands and ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c Looks like a copy of ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c So, below fix is needed in this case as well. Please suggest, so we can send the updated patch [incorporating Leif's comm= ents] Thanks, Meenakshi > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Udit Kumar > Sent: Thursday, November 09, 2017 10:13 AM > To: Leif Lindholm > Cc: ruiyu.ni@intel.com; ard.biesheuvel@linaro.org; ting.ye@intel.com; edk= 2- > devel@lists.01.org; jaben.carsey@intel.com; siyuan.fu@intel.com > Subject: Re: [edk2] [PATCH] Tftp assert fix for openfile failure case >=20 >=20 >=20 > > -----Original Message----- > > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > > Sent: Wednesday, November 08, 2017 8:52 PM > > To: Udit Kumar > > Cc: Vabhav Sharma ; edk2-devel@lists.01.org; > > ruiyu.ni@intel.com; jaben.carsey@intel.com; ard.biesheuvel@linaro.org; > > siyuan.fu@intel.com; ting.ye@intel.com > > Subject: Re: [PATCH] Tftp assert fix for openfile failure case > > > > On Wed, Nov 08, 2017 at 05:15:49AM +0000, Udit Kumar wrote: > > > > > diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > index fbde3bf..6425fc5 100755 > > > > > --- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > +++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > @@ -509,6 +509,7 @@ ShellCommandRunTftp ( > > > > > ); > > > > > goto NextHandle; > > > > > > > > Wow, a goto in a foor loop in a 320-line function. > > > > What could possibly go wrong? > > > > > > Instead of being on some volume, if you are on Shell. > > > Then file open will fail. > > > > Sure. The above was a snarky comment on the state of the existing code. > > > > > > > } > > > > > + DataSize =3D FileSize; > > > > > > > > > > Status =3D DownloadFile (Mtftp4, RemoteFilePath, > > > > > AsciiRemoteFilePath, > > > > FileSize, BlockSize, &Data); > > > > > if (EFI_ERROR (Status)) { > > > > > @@ -539,7 +540,6 @@ ShellCommandRunTftp ( > > > > > goto NextHandle; > > > > > } > > > > > > > > > > - DataSize =3D FileSize; > > > > > Status =3D ShellWriteFile (FileHandle, &FileSize, Data); > > > > > if (!EFI_ERROR (Status)) { > > > > > ShellStatus =3D SHELL_SUCCESS; > > > > > -- > > > > > 1.9.1 > > > > > > > > So, a wider question: > > > > This shell command was introduced in the heyday of "let's > > > > reimplement U-Boot in the EDK2 tree". Mainly, from my impression, i= t > > > > seems to be used in order that people don't need to learn how boot > > > > managers and device paths work. > > > > > > When you say about complete boot, then this may not be useful. > > > > > > > Am I being too harsh? > > > > Are there practical uses for this? > > > > > > For doing some sort of unit testing of given interface. I found this > > > useful. During development, this is useful to transfer generic file t= o > > > development board. > > > > OK, I can see how it could be useful. > > My opposition is based on three things: > > 1) people _are_ trying to use it for boot >=20 > I agree with this, please see my previous comments, > ' When you say about complete boot, then this may not be useful.' >=20 > > 2) not a command described by UEFI Shell spec, but I keep seeing > > platforms including it even in RELEASE builds (most likely because 1= ) > > 3) code quality/maintainability >=20 > > > > If the code is to be kept, I think (from a quick glance) that I > > > > would also like to see > > > > *Data =3D NULL > > > > in the error path of DownloadFile(). > > > > OK, so we don't need to drop it right now, but what's your take on this > > comment? >=20 > I am fine, if you prefer to remove this then we will develop some test > application > for unit tests. > In case, we need to maintain this piece of code then above needs to fix a= s > well. >=20 >=20 > > / > > Leif > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Flist > s.01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7Cc2673b1a07e > 94e9f937b08d5272c6e5b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0 > %7C636457994167308954&sdata=3DgBy9RA5d1NpsvxQkmET0HFzsJB8FK7KLueE > NXFTjSHY%3D&reserved=3D0