From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 6BB9121F3C195 for ; Mon, 9 Oct 2017 22:18:45 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 22:22:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,503,1500966000"; d="scan'208";a="1204106321" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 09 Oct 2017 22:22:12 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Oct 2017 22:22:12 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Oct 2017 22:22:11 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Tue, 10 Oct 2017 13:22:09 +0800 From: "Ni, Ruiyu" To: "Carsey, Jaben" , Meenakshi Aggarwal , "Fu, Siyuan" , "edk2-devel@lists.01.org" , "Ye, Ting" Thread-Topic: [PATCH v2] TFTP : tftp fix for full volume case Thread-Index: AQHTNd84KLiglX63oUqyR+J3mhxfu6LFzrmAgAHBlQCAEw1ZgIAAge6AgAGD/tA= Date: Tue, 10 Oct 2017 05:22:08 +0000 Deferred-Delivery: Tue, 10 Oct 2017 05:22:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA8BD5A@SHSMSX104.ccr.corp.intel.com> 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, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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: Tue, 10 Oct 2017 05:18:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----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 >=20 > I am fine. Ray? >=20 > Reviewed-by: Jaben Carsey >=20 > > -----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