From: Marcel Holtmann <marcel@holtmann.org>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Matt Fleming <matt@codeblueprint.co.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-efi@vger.kernel.org,
Matthew Garrett <matthew.garrett@nebula.com>,
Jeremy Kerr <jk@ozlabs.org>,
Matt Fleming <matt.fleming@intel.com>
Subject: Re: efivarfs and writev() support
Date: Thu, 12 Mar 2015 07:58:35 -0700 [thread overview]
Message-ID: <BC49553F-B4CE-4ED5-A1CE-D180E200AA60@holtmann.org> (raw)
In-Reply-To: <20150312063437.GK29656@ZenIV.linux.org.uk>
Hi Al,
>>>> it seems that efivarfs only supports readv(), but when it comes to
>>>> writev(), I am getting an error. Is there any reason to not support
>>>> vectored write on this filesystem? Especially with the uint32 header
>>>> for each file, I think it would make perfect sense to support it.
>>>
>>> What error are you seeing? I thought that the vfs fell back to a looped
>>> write if the file system doesn't support .write_iter()?
>>
>> that seems to work for readv(), but not for writev().
>>
>>> But yes, we definitely should support writev().
>>
>> I just get an EIO error and have not traced this down any further.
>
> What arguments are you feeding to it? Note that the thing is sensitive to
> range boundaries; it's not as if series of write() to it would be equivalent
> to single write() from concatenation. And writev() is equivalent to
> series of write().
I did something really simple and from my point obvious. I took the uint32 header that every file needs and put that in iov[0] pointer and then the rest in iov[1] pointer. The reason was that I didn't want to copy the actual file content around to just add a uint32 header in front of it.
> If you want behaviour a-la UDP sockets (syscall boundaries matter,
> boundaries between vector elements do not), we can certainly do that,
> but this is different from the current semantics. AFAICS, said
> semantics makes little sense, but it's a user-visible change...
I do not know about the specific semantics of efivarfs and frankly I have not tried every single combination. However it sounds to me that currently it requires that the whole file content is provided with a single write(). I have no idea if this is true or not. I do not know enough about the internals here.
Maybe efivarfs just needs to implemented .write_iter properly to actually support writev() and can not rely on a fallback of multiple write() calls.
Regards
Marcel
next prev parent reply other threads:[~2015-03-12 14:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 22:24 efivarfs and writev() support Marcel Holtmann
2015-03-11 13:42 ` Matt Fleming
2015-03-11 15:12 ` Marcel Holtmann
2015-03-12 6:34 ` Al Viro
2015-03-12 14:58 ` Marcel Holtmann [this message]
2015-03-12 17:03 ` Al Viro
2015-03-14 16:33 ` Marcel Holtmann
2015-03-17 15:46 ` Matt Fleming
2015-03-17 16:03 ` Marcel Holtmann
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=BC49553F-B4CE-4ED5-A1CE-D180E200AA60@holtmann.org \
--to=marcel@holtmann.org \
--cc=jk@ozlabs.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=matt@codeblueprint.co.uk \
--cc=matthew.garrett@nebula.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 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).