[PATCH] drbd: always set BLK_FEAT_STABLE_WRITES

Christoph Böhmwalder christoph.boehmwalder at linbit.com
Thu Feb 12 16:01:43 CET 2026


Am 06.02.26 um 07:43 schrieb Christoph Hellwig:
> On Thu, Feb 05, 2026 at 06:39:29PM +0100, Christoph Böhmwalder wrote:
>> DRBD requires stable pages because it may read the same bio data
>> multiple times for local disk I/O and network transmission, and in
>> some cases for calculating checksums.
>>
>> The BLK_FEAT_STABLE_WRITES flag is set when the device is first
>> created, but blk_set_stacking_limits() clears it whenever a
>> backing device is attached. In some cases the flag may be
>> inherited from the backing device, but we want it to be enabled
>> at all times.
> 
> This looks like a bug.  If an underlying device requires
> BLK_FEAT_STABLE_WRITES, the upper device needs to inherit it.

The current block layer logic actually seems correct to me. The
underlying device may or may not require stable writes, but regardless
of that, DRBD itself definitely does need it. In blk_stack_limits, DRBD
is the top device, and DRBD's backing disk is the bottom device. If the
backing disk happens to require stable writes, this would indeed be
correctly inherited.

So the only missing logic is that DRBD still wants to enable stable
writes for itself even if the backing disk does *not* request it.
So it seems to me that this patch is the correct fix for DRBD's special
case.

Is it not supposed to work like that?

-- 
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage



More information about the drbd-dev mailing list