All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ding Feng <dingf3ng@gmail.com>
To: Matteo Croce <technoboy85@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Paul Eggert <eggert@cs.ucla.edu>, Jens Axboe <axboe@kernel.dk>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] fs: shorten I/O that would extend past the maximum file offset
Date: Thu,  3 Dec 2026 13:20:09 +0800	[thread overview]
Message-ID: <20261203052010.50286-1-dingf3ng@gmail.com> (raw)
In-Reply-To: <20261121003356.290201-1-technoboy85@gmail.com>

Hi Matteo,

I tested v2 RESEND on v7.4-rc5 (fe6ff8d5d), x86_64 under QEMU, on
tmpfs. It applies with offsets only. The test runs each call on the
unpatched and the patched kernel; "huge" is a sparse file of size
LLONG_MAX, "small" is 100 bytes, "mid" is 20 MiB, M is LLONG_MAX:

  call                                       rc5        patched
  pread(huge, 4096, M - 100)                 EINVAL     100
  read(huge, 4096) at M                      EINVAL     0
  preadv2(small, 200, M - 50)                EINVAL     0
  readv(small, 200) at M                     EINVAL     0
  pwrite(new file, 100, M - 10)              EINVAL     10
  pwrite(new file, 100, M)                   EINVAL     EINVAL
  writev(new file, 100) at M                 EINVAL     EINVAL
  splice(mid -> pipe, 0x7FFFFFFFFF000000,
         off_in 16 MiB)                      EINVAL     65536
  sendfile(/dev/null <- huge, 4096, M - 100) EINVAL     100
  aio IOCB_CMD_PREAD(huge, 4096, M - 100)    EINVAL     100
  io_uring READ(huge, 4096, M - 100)         EINVAL     100
  io_uring WRITE(new file, 100, M - 10)      EINVAL     10
  read(/proc/self/mem, 100) at U64_MAX - 9   EOVERFLOW  EIO

After the short pwrite the file size is LLONG_MAX. A write that starts
at LLONG_MAX still fails, and /proc/self/mem now gets EIO from
mem_rw() instead of EOVERFLOW, both as the commit message describes.

Tested-by: Ding Feng <dingf3ng@gmail.com>

Thanks,
Ding Feng

      parent reply	other threads:[~2026-12-03  5:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21  0:33 [PATCH v2] fs: shorten I/O that would extend past the maximum file offset Matteo Croce
2026-11-22  1:37 ` [PATCH v2 RESEND] " Matteo Croce
2026-11-21  0:49 ` [PATCH v2] " Matteo Croce
2026-11-21 21:59   ` Jens Axboe
2026-12-03  5:20 ` Ding Feng [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=20261203052010.50286-1-dingf3ng@gmail.com \
    --to=dingf3ng@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=eggert@cs.ucla.edu \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=technoboy85@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.