[Skiboot] [Skiboot-stable] [PATCH 1/9] gard: Fix data corruption when clearing single records

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Oct 7 20:00:25 AEDT 2019


On 10/3/19 11:23 AM, Andrew Jeffery wrote:
> Attempting to clear a specific gard record leads to corruption of the target
> record rather than the expected removal:
> 
>      $ ./opal-gard -f romulus.pnor list
>      No GARD entries to display
>      $ ./opal-gard -f romulus.pnor create /sys0/node0/proc1
>      $ ./opal-gard -f romulus.pnor list
>       ID       | Error    | Type       | Path
>      ---------------------------------------------------------
>       00000001 | 00000000 | Manual     | /Sys0/Node0/Proc1
>      =========================================================
>      $ ./opal-gard -f romulus.pnor clear 00000001
>      Clearing gard record 0x00000001...done
>      $ ./opal-gard -f romulus.pnor list
>       ID       | Error    | Type       | Path
>      ---------------------------------------------------------
>       00000001 | 00000000 | Unknown    | /Sys0/Node0/Proc1
>      =========================================================
> 
> The GUARD partition needs to be compacted when clearing records as the
> end of the list is a sentinel represented by the erased-flash state. The
> compaction strategy is to read the trailing records and write them to
> the offset of the record to be removed, followed by writing the sentinel
> record at the offset of what was previously the last valid record.
> 
> The corruption occurs due to incorrect calculation of the offset at which the
> trailing records will be written.
> 
> Cc: Skiboot Stable <skiboot-stable at lists.ozlabs.org>
> Fixes: 5616c42d900a ("libflash/blocklevel: Make read/write be ECC agnostic for callers")
> Signed-off-by: Andrew Jeffery <andrew at aj.id.au>

Patch looks good to me. Thanks for the fix.


-Vasant



More information about the Skiboot mailing list