From: Jens Axboe <axboe@kernel.dk>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] timerfd: convert to ->read_iter()
Date: Thu, 4 Apr 2024 06:51:21 -0600 [thread overview]
Message-ID: <6bb82916-7c79-4af9-9dd1-f668845aa418@kernel.dk> (raw)
In-Reply-To: <20240403224037.GM538574@ZenIV>
On 4/3/24 4:40 PM, Al Viro wrote:
> On Wed, Apr 03, 2024 at 08:02:52AM -0600, Jens Axboe wrote:
>
>> - res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks);
>> + res = copy_to_iter(&ticks, sizeof(ticks), to);
>
> Umm... That's not an equivalent transformation - different behaviour on
> short copy; try to call it via read(fd, unmapped_buffer, 8) and see what
> happens.
>
> copy_to_iter() returns the amount copied; no data copied => return 0, not -EFAULT.
Gah yes, ironically I did a bunch of conversions yesterday and it's all
fine. Not sure wha thappened here. I'll fix it up.
>> + ufd = get_unused_fd_flags(O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS));
>
> You do realize that get_unused_fd_flags() ignores O_RDWR (or
> O_NDELAY), right? Mixing those with O_CLOEXEC makes sense for
> anon_inode_getfd(), but here you have separate calls of
> get_unused_fd_flags() and anon_inode_getfile(), so...
I do, but figured it was cleaner that way. But I can change the flag
passing, ditto for the other ones.
--
Jens Axboe
next prev parent reply other threads:[~2024-04-04 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 14:02 [PATCHSET v2 0/3] Convert fs drivers " Jens Axboe
2024-04-03 14:02 ` [PATCH 1/3] timerfd: convert " Jens Axboe
2024-04-03 22:40 ` Al Viro
2024-04-04 12:51 ` Jens Axboe [this message]
2024-04-03 14:02 ` [PATCH 2/3] userfaultfd: " Jens Axboe
2024-04-03 22:45 ` Al Viro
2024-04-03 14:02 ` [PATCH 3/3] signalfd: " Jens Axboe
2024-04-03 22:57 ` Al Viro
2024-04-04 12:52 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2024-04-02 20:18 [PATCHSET 0/3] Convert fs drivers " Jens Axboe
2024-04-02 20:18 ` [PATCH 1/3] timerfd: convert " Jens Axboe
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=6bb82916-7c79-4af9-9dd1-f668845aa418@kernel.dk \
--to=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 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®