ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: cluster-devel <cluster-devel@redhat.com>, Jan Kara <jack@suse.cz>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper
Date: Sat, 24 Jul 2021 13:37:09 -0700	[thread overview]
Message-ID: <CAHk-=wj1d2ELuN-Qtf59dsJ4OG-YRqAk2YrLS3=PRMTc2trZvA@mail.gmail.com> (raw)
In-Reply-To: <YPx28cEvrVl6YrDk@zeniv-ca.linux.org.uk>

On Sat, Jul 24, 2021 at 1:26 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Sat, Jul 24, 2021 at 12:52:34PM -0700, Linus Torvalds wrote:
>
> > So I think the code needs to return 0 if _any_ fault was successful.
>
> s/any/the first/...

Yes, but as long as we do them in order, and stop when it fails, "any"
and "first" end up being the same thing ;)

> The same goes for fault-in for read

Yeah. That said, a partial write() (ie "read from user space") might
be something that a filesystem is not willing to touch for other
reasons, so I think returning -EFAULT in that case is, I think,
slightly more reasonable.

Things like "I have to prepare buffers to be filled" etc.

The partial read() case is at least something that a filesystem should
be able to handle fairly easily.

And I don't think returning -EFAULT early is necessarily wrong - we
obviously do it anyway if you give really invalid addresses.

But we have generally strived to allow partial IO for missing pages,
because people sometimes play games with unmapping things dynamically
or using mprotect() to catch modifications (ie doing things like catch
SIGSEGV/SIGBUS, and remap it).

But those kinds of uses tend to have to catch -EFAULT anyway, so I
guess it's not a big deal either way.

           Linus

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

  reply	other threads:[~2021-07-24 20:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 19:34 [Ocfs2-devel] [PATCH v4 0/8] gfs2: Fix mmap + page fault deadlocks Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper Andreas Gruenbacher
2021-07-24 19:52   ` Linus Torvalds
2021-07-24 20:24     ` Al Viro
2021-07-24 20:37       ` Linus Torvalds [this message]
2021-07-24 21:38       ` Andreas Gruenbacher
2021-07-24 21:57         ` Al Viro
2021-07-24 22:06           ` Andreas Gruenbacher
2021-07-24 23:39             ` Al Viro
2021-07-27  9:30     ` David Laight
2021-07-27 11:13       ` Andreas Gruenbacher
2021-07-27 17:51         ` Linus Torvalds
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 2/8] gfs2: Add wrapper for iomap_file_buffered_write Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 3/8] gfs2: Fix mmap + page fault deadlocks for buffered I/O Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 4/8] iomap: Fix iomap_dio_rw return value for user copies Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 5/8] iomap: Add done_before argument to iomap_dio_rw Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 6/8] iomap: Support restarting direct I/O requests after user copy failures Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 7/8] iov_iter: Introduce noio flag to disable page faults Andreas Gruenbacher
2021-07-24 19:34 ` [Ocfs2-devel] [PATCH v4 8/8] gfs2: Fix mmap + page fault deadlocks for direct I/O Andreas Gruenbacher

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='CAHk-=wj1d2ELuN-Qtf59dsJ4OG-YRqAk2YrLS3=PRMTc2trZvA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=viro@zeniv.linux.org.uk \
    --subject='Re: [Ocfs2-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper' \
    /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

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).