Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	drbd-dev@lists.linbit.com
Subject: Re: [PATCH] drbd: always set BLK_FEAT_STABLE_WRITES
Date: Thu, 12 Feb 2026 16:01:43 +0100	[thread overview]
Message-ID: <eaa83421-a07a-4ee7-81ad-f32d4a237ff8@linbit.com> (raw)
In-Reply-To: <aYWNhtixUGuj3hat@infradead.org>

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


  reply	other threads:[~2026-02-12 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 17:39 [PATCH] drbd: always set BLK_FEAT_STABLE_WRITES Christoph Böhmwalder
2026-02-06  6:43 ` Christoph Hellwig
2026-02-12 15:01   ` Christoph Böhmwalder [this message]
2026-02-13  6:05     ` Christoph Hellwig
2026-02-11 17:36 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eaa83421-a07a-4ee7-81ad-f32d4a237ff8@linbit.com \
    --to=christoph.boehmwalder@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hch@infradead.org \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox