From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.4.74; helo=eur03-db5-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40074.outbound.protection.outlook.com [40.107.4.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3DEB92095B09A for ; Tue, 10 Oct 2017 06:50:58 -0700 (PDT) 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=X6hpTFAl8nvYSrinOWzlBvLl78cdBroZ1mZMewuHe14=; b=D++Uswd6CfZAfDlXn4M5jbI+m9z0VhR8DNJo9bV6CzBhP6zj5wQL4yHixJmRCKzjjt3LEL04Z5jnsND+t73K0Ik1AJrr6cljdnWtuKnPaFh1VxntLlvmHCJWZaV9oJc7xGvae+qmQU7WjKzwF4qiHkirHo96k5YVRgIi4l4zd9o= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB5PR04MB0999.eurprd04.prod.outlook.com (10.161.199.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 13:54:24 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::411c:6de2:e600:73c0]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::411c:6de2:e600:73c0%14]) with mapi id 15.20.0077.020; Tue, 10 Oct 2017 13:54:24 +0000 From: Meenakshi Aggarwal To: "Ni, Ruiyu" , "Carsey, Jaben" , "Fu, Siyuan" , "edk2-devel@lists.01.org" , "Ye, Ting" Thread-Topic: [PATCH v2] TFTP : tftp fix for full volume case Thread-Index: AQHTNd8lw9VbuA7TWUig4/hWxNcx/KLGVNWAgAHA6zCAEw0+8IAAgqbggAD+DACAAI69QA== Date: Tue, 10 Oct 2017 13:54:23 +0000 Message-ID: References: <1506350249-28082-1-git-send-email-meenakshi.aggarwal@nxp.com> <1506351962-28200-1-git-send-email-meenakshi.aggarwal@nxp.com> <734D49CCEBEEF84792F5B80ED585239D5BA8BD5A@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BA8BD5A@SHSMSX104.ccr.corp.intel.com> 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: [180.188.246.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR04MB0999; 6:N9VXrQSgGTV5ymJY2gYT99+YesuR+OGjRchuRos3WhKTIwlbQDlbcGh6q6mPqlKxrJ+YQ72pgd1Oel7So+oNTuGCWuOF4gNhoaQZS2zjqIx+Y5cudQp8pCXGCE+ozpr2UGHcrNMy0N3K+8Fn0XQ2eyja0cv7Q8glZSRE/3SJKip6y6ZO6jSyVuOwY26Cygg77kRJd0EdV00YcDI7H1eOj8izz0GYU5rCw63j7jCfb6OfeR7raWnsMqRtIgp7uD54detQbMPGZ03rL18s79jIQmhjkamj8YvRIUOJL/VB8G0Eon9Ek9TO5FcMC+jAEXsWSNFyzhnYPNukprDk10eCcA==; 5:khGsXXswuVfpId1kpd+DE2Ur3nlrVeIMfLyDJRYYWoEpfDgMJqSEGuB+9F/cqDGX85TMgrvqnkI6fEMJA+9QaAeDS6A5dBlPlNExycWSw6bMpfOjXbdkJVUx5aau/XQrXHwasgCkyT5khd6tS52KHw3d/p8CIPadnjoeA9v8Qag=; 24:eXunXRqHk4edipDFvuFCMTdyLm12X8O6Qi1/O8iK5eCdBOUF/7O8+ys+uDnOeniw7Z18NnyBPjcylnl69uIHcMuh5ls5YKyLO63b00t0uWg=; 7:NpfbYkAmbGwFLctdzFpo1KtPos3tdyJ25HNVhrV07ImYZqBTqr5mI2oeB7qlRTcfwhZUAueM4O7NJP7bz/AapYkgomNjnbrRG1/d2hWKpgUvg1oCfnJ+vRXPRXzA5hE7sRDEMdrCnWoJR1Pv+lvx7p56qvF1O1iP+obO73/p9s4e0+pTXMGCHqfTmow1UAuXtKhazZ8F51qPMOIw/DNT9zi9U1Zu2qr0sgoRe7KG0xY= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 5f545a01-af90-4406-e66b-08d50fe66a2d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB5PR04MB0999; x-ms-traffictypediagnostic: DB5PR04MB0999: x-exchange-antispam-report-test: UriScan:(185117386973197)(162533806227266)(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR04MB0999; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR04MB0999; x-forefront-prvs: 04569283F9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(189002)(13464003)(199003)(51914003)(377454003)(229853002)(53546010)(2906002)(6506006)(93886005)(66066001)(8676002)(99286003)(74316002)(101416001)(478600001)(6306002)(9686003)(97736004)(305945005)(50986999)(3660700001)(76176999)(8936002)(55016002)(6436002)(54356999)(53936002)(105586002)(966005)(25786009)(86362001)(2950100002)(5250100002)(102836003)(6116002)(3846002)(6246003)(110136005)(81156014)(3280700002)(81166006)(7736002)(2501003)(33656002)(68736007)(14454004)(106356001)(189998001)(316002)(5660300001)(7696004)(2900100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB0999; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2017 13:54:23.9987 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB0999 Subject: Re: [PATCH v2] TFTP : tftp fix for full volume case X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:50:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Kindly apply this patch on edk2 if all reviews are done. Thanks & Regards, Meenakshi > -----Original Message----- > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] > Sent: Tuesday, October 10, 2017 10:52 AM > To: Carsey, Jaben ; Meenakshi Aggarwal > ; Fu, Siyuan ; edk2- > devel@lists.01.org; Ye, Ting > Subject: RE: [PATCH v2] TFTP : tftp fix for full volume case >=20 > Reviewed-by: Ruiyu Ni >=20 > Thanks/Ray >=20 > > -----Original Message----- > > From: Carsey, Jaben > > Sent: Monday, October 9, 2017 10:13 PM > > To: Meenakshi Aggarwal ; Fu, Siyuan > > ; edk2-devel@lists.01.org; Ni, Ruiyu > > ; Ye, Ting > > Subject: RE: [PATCH v2] TFTP : tftp fix for full volume case > > > > I am fine. Ray? > > > > Reviewed-by: Jaben Carsey > > > > > -----Original Message----- > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf > > > Of Meenakshi Aggarwal > > > Sent: Sunday, October 08, 2017 11:28 PM > > > To: Fu, Siyuan ; edk2-devel@lists.01.org; Ni, > > > Ruiyu ; Carsey, Jaben ; > > > Ye, Ting > > > Subject: Re: [edk2] [PATCH v2] TFTP : tftp fix for full volume case > > > Importance: High > > > > > > Hi Team, > > > > > > > > > Any further comments on this patch? > > > > > > Or is it ready to merge in edk2? > > > > > > > > > Thanks, > > > Meenakshi > > > > > > > -----Original Message----- > > > > From: Meenakshi Aggarwal > > > > Sent: Wednesday, September 27, 2017 9:01 AM > > > > To: 'Fu, Siyuan' ; edk2-devel@lists.01.org; > > > > Ni, Ruiyu ; Carsey, Jaben > > > > ; Ye, Ting > > > > Cc: Udit Kumar ; Vabhav Sharma > > > > > > > > Subject: RE: [PATCH v2] TFTP : tftp fix for full volume case > > > > > > > > Hi, > > > > > > > > Thanks for the review Siyuan. > > > > > > > > > > > > Ting, > > > > > > > > Any comment from your side? > > > > > > > > Thanks, > > > > Meenakshi > > > > > > > > > -----Original Message----- > > > > > From: Fu, Siyuan [mailto:siyuan.fu@intel.com] > > > > > Sent: Tuesday, September 26, 2017 6:12 AM > > > > > To: Meenakshi Aggarwal ; edk2- > > > > > devel@lists.01.org; Ni, Ruiyu ; Carsey, > > > > > Jaben > > > > > Cc: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; Ye, > > > > > Ting ; Udit Kumar ; > > > > > Vabhav > > > Sharma > > > > > > > > > > Subject: RE: [PATCH v2] TFTP : tftp fix for full volume case > > > > > > > > > > Reviewed-by: Fu Siyuan > > > > > > > > > > -----Original Message----- > > > > > From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com] > > > > > Sent: Monday, September 25, 2017 11:06 PM > > > > > To: edk2-devel@lists.01.org; Ni, Ruiyu ; > > > > > Carsey, Jaben > > > > > Cc: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; Fu, > > > > > Siyuan ; Ye, Ting ; > > > > > Meenakshi Aggarwal ; Udit Kumar > > > > > ; Vabhav Sharma > > > > > > Subject: [PATCH v2] TFTP : tftp fix for full volume case > > > > > > > > > > Issue : > > > > > When storage media is full, tftp was resulting in ASSERT > > > > > MdeModulePkg/Core/Dxe/Mem/Page.c, because number of pages > was > > > > zero. > > > > > > > > > > Reason: > > > > > While doing tftp, function call ShellWriteFile was modifying > > > > > FileSize > > > variable. > > > > > In case of full disk it was coming out to be Zero. > > > > > > > > > > Fix: > > > > > Storage the original filesize in local variable, and use this > > > > > variable while freeing the pages. > > > > > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > > > Signed-off-by: Udit Kumar > > > > > Signed-off-by: Meenakshi Aggarwal > > > > > > Signed-off-by: Vabhav Sharma > > > > > Signed-off-by: Meenakshi Aggarwal > > > > > > --- > > > > > ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c | 5 ++++- > > > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > index 5c50797..fbde3bf 100755 > > > > > --- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > +++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c > > > > > @@ -284,6 +284,7 @@ ShellCommandRunTftp ( > > > > > EFI_HANDLE Mtftp4ChildHandle; > > > > > EFI_MTFTP4_PROTOCOL *Mtftp4; > > > > > UINTN FileSize; > > > > > + UINTN DataSize; > > > > > VOID *Data; > > > > > SHELL_FILE_HANDLE FileHandle; > > > > > UINT16 BlockSize; > > > > > @@ -294,6 +295,7 @@ ShellCommandRunTftp ( > > > > > AsciiRemoteFilePath =3D NULL; > > > > > Handles =3D NULL; > > > > > FileSize =3D 0; > > > > > + DataSize =3D 0; > > > > > BlockSize =3D MTFTP_DEFAULT_BLKSIZE; > > > > > > > > > > // > > > > > @@ -537,6 +539,7 @@ ShellCommandRunTftp ( > > > > > goto NextHandle; > > > > > } > > > > > > > > > > + DataSize =3D FileSize; > > > > > Status =3D ShellWriteFile (FileHandle, &FileSize, Data); > > > > > if (!EFI_ERROR (Status)) { > > > > > ShellStatus =3D SHELL_SUCCESS; @@ -551,7 +554,7 @@ > > > > > ShellCommandRunTftp ( > > > > > NextHandle: > > > > > > > > > > if (Data !=3D NULL) { > > > > > - gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Data, > > > > > EFI_SIZE_TO_PAGES (FileSize)); > > > > > + gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Data, > > > > > + EFI_SIZE_TO_PAGES (DataSize)); > > > > > } > > > > > > > > > > CloseProtocolAndDestroyServiceChild ( > > > > > -- > > > > > 1.9.1 > > > > > > _______________________________________________ > > > edk2-devel mailing list > > > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel