FatPkg/EnhancedFatDxe: Ensure traverse of subtasks is delete-safe
authorHao Wu <hao.a.wu@intel.com>
Sat, 14 Apr 2018 03:06:13 +0000 (11:06 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 18 Apr 2018 07:08:14 +0000 (15:08 +0800)
commit255101471918ed8840f2be347916b90eef0e9c08
tree2d7de144773b3c66e1fdfc00f2f232d7542c60f6
parent104bbee55e1f90d8c7ae64d0d319c9dbfb24e06c
FatPkg/EnhancedFatDxe: Ensure traverse of subtasks is delete-safe

Within function FatQueueTask(), the traverse of FAT subtasks for
executing the disk read/write is not delete-safe.

For the below case:

FatDiskIo(): When non-blocking access, creates subtasks and creates
event (FatOnAccessComplete, NOTIFY level) when subtasks finish.

FatQueueTask(): Traverses the subtasks and submits them one by one at
Tpl lower than NOTIFY.

Disk R/W completes really quick.

FatOnAccessComplete(): Removes the finished subtask, causing the
traverse in FatQueueTask() broken.

This commits will refine the subtask traverse in FatQueueTask() to be
delete-safe.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
FatPkg/EnhancedFatDxe/Misc.c