From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.0.81; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0081.outbound.protection.outlook.com [104.47.0.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 B96BA21CF58CC for ; Sun, 8 Oct 2017 23:24:38 -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=cgG2Q4OQLKM8kjKLNs6c/KfJ5wKz4224hecg/YdeAQ4=; b=LgaoV50U5hQk66cp4KFYMQIi189VGPTYsx8eTq9NM75c2g6K+WhSvud3o7ZbWAOmXTX+JTihIWjozTfe+p6dGFX+8cCvRZxqU0qF3i27O0VKo3v659urTQG9VBgIpYWhzTujLLZPK0eFcUqDLy+JEBJHqt4MMbiPcu8icdf7VSk= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by AM6PR0402MB3333.eurprd04.prod.outlook.com (52.133.18.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 9 Oct 2017 06:28:02 +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; Mon, 9 Oct 2017 06:28:01 +0000 From: Meenakshi Aggarwal To: "Fu, Siyuan" , "edk2-devel@lists.01.org" , "Ni, Ruiyu" , "Carsey, Jaben" , "Ye, Ting" Thread-Topic: [PATCH v2] TFTP : tftp fix for full volume case Thread-Index: AQHTNd8lw9VbuA7TWUig4/hWxNcx/KLGVNWAgAHA6zCAEw0+8A== Date: Mon, 9 Oct 2017 06:28:01 +0000 Message-ID: References: <1506350249-28082-1-git-send-email-meenakshi.aggarwal@nxp.com> <1506351962-28200-1-git-send-email-meenakshi.aggarwal@nxp.com> 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; AM6PR0402MB3333; 6:I7ZX2252RbKu+Wt1jLl3yKf3l6as5KXU7IOQrisAsNfz+5WxoPQHKe5nJOY9BE5ovdX67bbZCHOxdU/2O5E2iNrJuQRbW3P6elTl8prxXd9h7moLxyfvgf9Nj8gsDtbLSbsiDa4CaCHiwDiNMInc5mp5w0ZJHOtFd2Q7Mf7iQ7Fv8iPt4yC68ruREV+lKhipdMQMGYLn+HittrctDGzFNRtdIJzO5ICUPRZljhaZSEvVJJQhgWpGVAWA5g+5dmM5fYOp0oMzK/5f9cKTwiXRMIhc+dKGPKm17VrbRGQQiCnAGoE3wUZP3fp9IMe5j9E89ry3IOQT0rtVTQrD1CcGsA==; 5:kLnrD13QEwF2hbOXUtjFuRXdcYzG1Y4alTCkmz9I2VbbviQC/QhKPBmI6dkiN3Ly5tKc/7aSERjDoXslupr53IA+TCA9/+AdWukDI2GCLFAU950B1XYf/xQf9pdlDZSKzeRXvXPgRBEJPGo6Gdzt3w==; 24:1o0z6Fa08UusdkpsdO+zccHyBoxKq/xcH7W4AJ3IzkfJ2cb3AFYcsmB24818Pu4SbhwQ3iV7iRRiQkwOruk+Xm7CrHvkU5gwDUpWWnGhqy0=; 7:IB3+Yt3t8iNITbZiuJQuqXV0DjbFCCAgodHYLbPAUWOa/Brth7SSeuB3FAeVUm9qLXGuiopfZUDB6LN8baNxxGXQyWqJMpGpEUgsOAT8zUcyquKM3LE1buQxFECU1FayZ+I53hd7jKfMarx62mQ1VgAA2Tw6bvWgzV/dX8vM1b6FsaRTQrAhxAVSGzTENUKDTGbB5AL0omck8zLuxUoH7hLQiLW5Yaah1oxom6kkiaw= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(979002)(6009001)(39860400002)(376002)(346002)(13464003)(377454003)(199003)(51914003)(189002)(229853002)(68736007)(53936002)(6246003)(3846002)(54906003)(189998001)(6436002)(102836003)(9686003)(305945005)(6116002)(99286003)(74316002)(55016002)(7736002)(2950100002)(8676002)(14454004)(33656002)(7696004)(81166006)(86362001)(2501003)(5250100002)(2906002)(66066001)(8936002)(6506006)(110136005)(105586002)(25786009)(93886005)(5660300001)(101416001)(478600001)(53546010)(81156014)(3280700002)(4326008)(316002)(106356001)(97736004)(3660700001)(2900100001)(54356999)(50986999)(76176999)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3333; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: dcca0a26-eabf-4cad-d086-08d50edee400 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:AM6PR0402MB3333; x-ms-traffictypediagnostic: AM6PR0402MB3333: 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)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM6PR0402MB3333; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM6PR0402MB3333; x-forefront-prvs: 045584D28C 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: 09 Oct 2017 06:28:01.2174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3333 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: Mon, 09 Oct 2017 06:24:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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, Ruiy= u > ; Carsey, Jaben ; Ye, Ting > > Cc: Udit Kumar ; Vabhav Sharma > > Subject: RE: [PATCH v2] TFTP : tftp fix for full volume case >=20 > Hi, >=20 > Thanks for the review Siyuan. >=20 >=20 > Ting, >=20 > Any comment from your side? >=20 > Thanks, > Meenakshi >=20 > > -----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 v= ariable. > > 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