From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 887C321FC7471 for ; Mon, 9 Oct 2017 07:09:38 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 07:13:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,500,1500966000"; d="scan'208";a="161033119" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 09 Oct 2017 07:13:04 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Oct 2017 07:13:04 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.182]) by FMSMSX109.amr.corp.intel.com ([169.254.15.122]) with mapi id 14.03.0319.002; Mon, 9 Oct 2017 07:13:04 -0700 From: "Carsey, Jaben" To: Meenakshi Aggarwal , "Fu, Siyuan" , "edk2-devel@lists.01.org" , "Ni, Ruiyu" , "Ye, Ting" Thread-Topic: [PATCH v2] TFTP : tftp fix for full volume case Thread-Index: AQHTNd8lw9VbuA7TWUig4/hWxNcx/KLGVNWAgAHA6zCAEw0+8IAAgqbg Date: Mon, 9 Oct 2017 14:13:03 +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-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDU3ZmZlNGYtMmFiMS00MDdmLTg2MzQtZDQ5NTFmZTE0NmE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im5NMkFFZTlhekFvV3pseWxuSVk0MUw0NHMxVjVZbzJobWNYcnhpWUJFems9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 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 14:09:38 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 >=20 > Hi Team, >=20 >=20 > Any further comments on this patch? >=20 > Or is it ready to merge in edk2? >=20 >=20 > Thanks, > Meenakshi >=20 > > -----Original Message----- > > From: Meenakshi Aggarwal > > Sent: Wednesday, September 27, 2017 9:01 AM > > To: 'Fu, Siyuan' ; edk2-devel@lists.01.org; Ni, Ru= iyu > > ; 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 variabl= e > > > 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 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel