From: Al Viro <viro@ZenIV.linux.org.uk>
To: Mike Marciniszyn <infinipath@intel.com>
Cc: linux-rdma@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: [WTF] utterly tasteless ABI in hfi1 (around ->write()/->write_iter())
Date: Wed, 16 Mar 2016 04:17:18 +0000 [thread overview]
Message-ID: <20160316041717.GJ17997@ZenIV.linux.org.uk> (raw)
Folks, we'd discussed that kind of crap already; why, in name of
everything unholy, is that kind of garbage brought back in a new driver?
Having both ->write() and ->write_iter() *AND* having entirely
unrelated interpretation of user input on those two on the same device
is bogus, with the capital Stop That Shit Right Now.
As it is, write(fd, p, len) and writev(fd, &(struct iovec){p,len}, 1)
are interpreted in absolutely unrelated ways. As in, entirely different
set of commands. Moreover, aio IOCB_CMD_PWRITE matches writev(), not write().
What's going on? Sure, ipathfs is a precious snowflake with the same
kind of braindamage. Back when it had been brought to your attention
(along with the fact that this piece of idiocy happens to be a file on
filesystem of your own, under your full control and no need whatsofuckingever
to multiplex completely unrelated sets of commands on the same file with
"was it write(2) or writev(2)?" used as a selector) the answer had been
basically "it doesn't have to make sense, it's Special". Now it turns out
that it has grown an equally special sibling. With the idiocy directly
exposed as userland ABI. Could we please fix that thing before it's cast in
stone?
Take a look at drivers/staging/rdma/hfi1/file_ops.c in -next and
compare hfi1_write_iter() with hfi1_file_write(). Folks, this ABI is too
ugly to live, let alone to be allowed breeding.
It's also brittle as hell - trivial massage around fs/read_write.c
and fs/aio.c is quite capable of breaking that shit. Arguably, IOCB_CMD_PWRITE
and IOCB_CMD_PWRITEV both triggering your writev() semantics is an example of
just such breakage. Sigh...
next reply other threads:[~2016-03-16 4:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 4:17 Al Viro [this message]
2016-03-16 4:34 ` [WTF] utterly tasteless ABI in hfi1 (around ->write()/->write_iter()) Linus Torvalds
2016-03-16 15:46 ` Doug Ledford
2016-03-16 16:02 ` Theodore Ts'o
2016-03-16 16:36 ` Linus Torvalds
2016-03-16 17:06 ` Al Viro
[not found] ` <20160316220029.GA5213@scvm10.sc.intel.com>
2016-03-16 22:52 ` Dalessandro, Dennis
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=20160316041717.GJ17997@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=infinipath@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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).