Potential for data corruption caused by bcache returning stale data in writeback mode

This document (7021099) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
SUSE Linux Enterprise Server 12 Service Pack 2 (SLES 12 SP2)
SUSE Linux Enterprise Server for SAP Applications 12
SUSE Linux Enterprise Server for SAP Applications 12 Service Pack 1
SUSE Linux Enterprise Server for SAP Applications 12 Service Pack 2

Situation

When using bcache configured in writeback mode, if the caching device goes offline while still containing dirty data, bcache will return stale data from the backing device which can lead to data corruption in the upper layers.

Resolution

To avoid the situation described above, bcache has been updated to only try to recover from the backing device if in writethrough mode. 

NOTE: The code currently does not detect if dirty data still exists on a cache device recently switched from writeback to writetrough mode and therefore it's advised to NOT dynamically switch between those modes.

The kernel update which includes the bcache patch is available as follows:

For SLES 12 and SLES for SAP Applications 12 (no service pack):
Update the kernel to version 3.12.61-52.89.1 released on 30 August 2017, or newer.

For SLES 12 SP1 and SLES for SAP Applications 12 SP1:
Update the kernel to version 3.12.74-60.64.57.1 released on 29 August 2017, or newer.


For SLES 12 SP2 and SLES for SAP Applications 12 SP2:
Update the kernel to version 4.4.74-92.35.1 released on 10 August 2017, or newer.

Cause

If bcache fails to read from the cache device, it will try to recover by forwarding the read to the backing device. If the read from the backing device is successful, that data will be returned to the upper layer. The recovery behavior is fine for writethrough mode, but not safe for writeback mode if the cache device goes offline before all dirty data has been flushed. In that case stale data will returned from backing device to the upper layer.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7021099
  • Creation Date: 14-Jul-2017
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center