linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: 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:39:18 -0700	[thread overview]
Message-ID: <aJr9tpeqaLcDKnhB@infradead.org> (raw)
In-Reply-To: <34624336-331d-4047-822f-8091098eeebc@kernel.org>

On Tue, Aug 12, 2025 at 12:42:44PM +0900, Damien Le Moal wrote:
> Since loff_t is "long long", so a signed type, I would keep this interface and
> add a negative error check in the 2 call sites for get_size(). That is simpler.

Not ethat the existing code already treats 0 as error for the
offset smaller than size case.  I'm not arguing against and error
return, but that would require auditing all the call chains.  And I'd
rather not multiplex it into the loff_t as that means people will forget
to handle it way too easily.


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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 19:03 [PATCH v2] loop: use vfs_getattr_nosec() for accurate file size 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
2025-08-12  9:34               ` Yu Kuai
2025-08-12  8:39         ` Christoph Hellwig [this message]
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=aJr9tpeqaLcDKnhB@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=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;
as well as URLs for NNTP newsgroup(s).