X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=FatPkg%2FEnhancedFatDxe%2FInfo.c;h=858b3f4a3e00a12b8a48ac7aff7f42f3e0ce4f88;hp=ae85cce85976096ce3300142275485572e2d8040;hb=55248f85d180b0bbb0409638cc28e28a053123bd;hpb=2433260edf4f46281030cc0b72d2c3c887f14184 diff --git a/FatPkg/EnhancedFatDxe/Info.c b/FatPkg/EnhancedFatDxe/Info.c index ae85cce859..858b3f4a3e 100644 --- a/FatPkg/EnhancedFatDxe/Info.c +++ b/FatPkg/EnhancedFatDxe/Info.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -528,20 +528,16 @@ Returns: // Status = EFI_UNSUPPORTED; if (IsSet) { - if (Volume->ReadOnly) { - Status = EFI_WRITE_PROTECTED; - } else { - if (CompareGuid (Type, &gEfiFileInfoGuid)) { - Status = FatSetFileInfo (Volume, IFile, OFile, *BufferSize, Buffer); - } + if (CompareGuid (Type, &gEfiFileInfoGuid)) { + Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetFileInfo (Volume, IFile, OFile, *BufferSize, Buffer); + } - if (CompareGuid (Type, &gEfiFileSystemInfoGuid)) { - Status = FatSetVolumeInfo (Volume, *BufferSize, Buffer); - } + if (CompareGuid (Type, &gEfiFileSystemInfoGuid)) { + Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetVolumeInfo (Volume, *BufferSize, Buffer); + } - if (CompareGuid (Type, &gEfiFileSystemVolumeLabelInfoIdGuid)) { - Status = FatSetVolumeLabelInfo (Volume, *BufferSize, Buffer); - } + if (CompareGuid (Type, &gEfiFileSystemVolumeLabelInfoIdGuid)) { + Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetVolumeLabelInfo (Volume, *BufferSize, Buffer); } } else { if (CompareGuid (Type, &gEfiFileInfoGuid)) {