OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>, khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v2 1/1] block: let container root set the block size of and flush its device
Date: Fri, 23 Oct 2026 12:52:30 +0200	[thread overview]
Message-ID: <f7c0b8ba-9854-45ce-b426-ee486f0b92f2@virtuozzo.com> (raw)
In-Reply-To: <20261022022554.2427456-2-eva.kurchatova@virtuozzo.com>

On 10/22/26 04:25, Eva Kurchatova wrote:
>  static int blkdev_flushbuf(struct block_device *bdev, unsigned cmd,
>  		unsigned long arg)
>  {
> -	if (!capable(CAP_SYS_ADMIN))
> +	if (!blkdev_admin_capable(bdev))
>  		return -EACCES;
>  
>  	mutex_lock(&bdev->bd_holder_lock);
> -	if (bdev->bd_holder_ops && bdev->bd_holder_ops->sync)
> +	if (bdev->bd_holder_ops && bdev->bd_holder_ops->sync) {
> +		/* A filesystem on the device is synced by its own mount, not from a container */
> +		if (!ve_is_super(get_exec_env())) {
> +			mutex_unlock(&bdev->bd_holder_lock);
> +			return -EBUSY;
> +		}
>  		bdev->bd_holder_ops->sync(bdev);

This looks a bit overprotective, if we allow writing to this disk directly, why not allow syncing it directly, mounted fs or not.

Not a blocker though, fine either way.

Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-10-23 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  2:25 [Devel] [PATCH hci-8.1 v2 0/1] " Eva Kurchatova
2026-10-22  2:25 ` [Devel] [PATCH hci-8.1 v2 1/1] " Eva Kurchatova
2026-10-22  2:29   ` no-reply
2026-10-23 10:52   ` Pavel Tikhomirov [this message]
2026-10-29 15:49     ` Konstantin Khorenko

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=f7c0b8ba-9854-45ce-b426-ee486f0b92f2@virtuozzo.com \
    --to=ptikhomirov@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=khorenko@virtuozzo.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