Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934536AbcCPEeH (ORCPT ); Wed, 16 Mar 2016 00:34:07 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:34708 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933343AbcCPEeF (ORCPT ); Wed, 16 Mar 2016 00:34:05 -0400 MIME-Version: 1.0 In-Reply-To: <20160316041717.GJ17997@ZenIV.linux.org.uk> References: <20160316041717.GJ17997@ZenIV.linux.org.uk> Date: Tue, 15 Mar 2016 21:34:03 -0700 X-Google-Sender-Auth: _An9cxp9l7BCjOvgLIEMao3EvmQ Message-ID: Subject: Re: [WTF] utterly tasteless ABI in hfi1 (around ->write()/->write_iter()) From: Linus Torvalds To: Al Viro Cc: Mike Marciniszyn , "linux-rdma@vger.kernel.org" , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1017 Lines: 25 On Tue, Mar 15, 2016 at 9:17 PM, Al Viro wrote: > > 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... We could just decide that if a file descriptor has both ->write and ->write_iter entities, we always pick ->write_iter in the vfs layer. That way it's always consistent. Simple ordering change in __vfs_write().. We can switch is back later, but make sure it hits a release or two. Or at least a few rc's, to flush out any problems. Anybody who thinks that they can have different semantics for write() and writev() is just completely broken. Linus