mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Rajeev Mishra <rajeevm@hpe.com>,
	axboe@kernel.dk, yukuai1@huaweicloud.com,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] loop: use vfs_getattr_nosec() for accurate file size
Date: Tue, 12 Aug 2025 01:37:36 -0700	[thread overview]
Message-ID: <aJr9UKtIJ74XExf-@infradead.org> (raw)
In-Reply-To: <a7cb5d59-8af5-47b2-8549-05c9322971e5@kernel.org>

On Tue, Aug 12, 2025 at 02:17:01PM +0900, Damien Le Moal wrote:
> And indeed, that:
> 
> 	/* size of the new backing store needs to be the same */
>         if (get_loop_size(lo, file) != get_loop_size(lo, old_file))
>                 goto out_err;
> 
> Will need some massaging.

Why?  get_loop_size just derives the first arguments to get_size
from the passed in loop device in the same way the only other caller
to get_size does.  So we can just:

  1) convert loop_set_status to use get_loop_size
  2) Fold get_size into get_loop_size
  3) Maye rename get_size to lo_calculate_size to have a descriptive
     name while we're touching it?
  4) switch to vfs_getattr


  reply	other threads:[~2025-08-12  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 19:03 Rajeev Mishra
2025-08-12  1:40 ` Damien Le Moal
2025-08-12  2:05   ` Yu Kuai
2025-08-12  3:32     ` Rajeev Mishra
2025-08-12  3:42       ` Damien Le Moal
2025-08-12  4:28         ` Al Viro
2025-08-12  5:17           ` Damien Le Moal
2025-08-12  8:37             ` Christoph Hellwig [this message]
2025-08-12  9:34               ` Yu Kuai
2025-08-12  8:39         ` Christoph Hellwig
2025-08-12  4:25       ` Al Viro
2025-08-12  8:39 ` Christoph Hellwig

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=aJr9UKtIJ74XExf-@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajeevm@hpe.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yukuai1@huaweicloud.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

all inboxes | Powered by JetHome®