public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Deepanshu Kartikey <kartikey406@gmail.com>
Cc: axboe@kernel.dk, tytso@mit.edu, dvyukov@google.com,
	adilger.kernel@dilger.ca, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
	syzbot+fb32afec111a7d61b939@syzkaller.appspotmail.com
Subject: Re: [PATCH] loop: block loop reconfiguration of offset/sizelimit on mounted device
Date: Sun, 29 Mar 2026 22:54:12 -0700	[thread overview]
Message-ID: <acoQBLwdc1PqIb0m@infradead.org> (raw)
In-Reply-To: <20260330044334.373480-1-kartikey406@gmail.com>

On Mon, Mar 30, 2026 at 10:13:34AM +0530, Deepanshu Kartikey wrote:
> LOOP_SET_STATUS{64} allows changing lo_offset and lo_sizelimit while
> a filesystem is mounted on the loop device. This effectively mutates
> the data visible to the mounted filesystem, which is equivalent to
> writing directly to the block device.

Increasing the size certainly does not do that.

> Export bdev_writes_blocked() so it can be used from the loop driver.

I'm not sure exporting this is a good idea.  Besides the growing the
device part above, if someone insist on changing the size, they could
do this just fine with a remove block device, so prohibiting it locally
just because we can seems odd.  And exporting a helper with obscure
usage for a strange use case without documenting that is rarely a
good idea.

> -static bool bdev_writes_blocked(struct block_device *bdev)
> +bool bdev_writes_blocked(struct block_device *bdev)
>  {
>  	return bdev->bd_writers < 0;
>  }
> +EXPORT_SYMBOL_GPL(bdev_writes_blocked);
> +
>  
>  static void bdev_block_writes(struct block_device *bdev)

... and if we were to make it public it should be inline, and in a
separate patch.

And if not this would still add a spurious empty line.


      reply	other threads:[~2026-03-30  5:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  4:43 [PATCH] loop: block loop reconfiguration of offset/sizelimit on mounted device Deepanshu Kartikey
2026-03-30  5:54 ` Christoph Hellwig [this message]

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=acoQBLwdc1PqIb0m@infradead.org \
    --to=hch@infradead.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=axboe@kernel.dk \
    --cc=dvyukov@google.com \
    --cc=kartikey406@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+fb32afec111a7d61b939@syzkaller.appspotmail.com \
    --cc=tytso@mit.edu \
    /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