Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbcDPTTe (ORCPT ); Sat, 16 Apr 2016 15:19:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:44187 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbcDPTTc (ORCPT ); Sat, 16 Apr 2016 15:19:32 -0400 Date: Sat, 16 Apr 2016 20:19:17 +0100 From: Al Viro To: Leon Romanovsky Cc: Jason Gunthorpe , Christoph Hellwig , Ira Weiny , Dennis Dalessandro , dledford@redhat.com, linux-rdma@vger.kernel.org, linux-fsdevel@vger.kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Message-ID: <20160416191917.GY25498@ZenIV.linux.org.uk> References: <20160414153727.6387.96381.stgit@scvm10.sc.intel.com> <20160414164550.GC6247@obsidianresearch.com> <20160414174830.GA11641@rhel.sc.intel.com> <20160415040126.GB10689@leon.nu> <20160415161754.GA21549@rhel> <20160415173035.GC10689@leon.nu> <20160415173401.GA10868@infradead.org> <20160415212328.GF10689@leon.nu> <20160415233732.GB25662@obsidianresearch.com> <20160416060042.GA6349@leon.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160416060042.GA6349@leon.nu> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1898 Lines: 40 On Sat, Apr 16, 2016 at 09:00:42AM +0300, Leon Romanovsky wrote: > On Fri, Apr 15, 2016 at 05:37:32PM -0600, Jason Gunthorpe wrote: > > On Sat, Apr 16, 2016 at 12:23:28AM +0300, Leon Romanovsky wrote: > > > > > Intel as usual decided to do it in their way and the result is presented > > > on this mailing list. > > > > Dennis was pretty clear he was going to send the patches to address > > Al's concern, which he has done. > > > > I was also pretty clear I was looking to get rid of the char dev :) > > Yes, and I was pretty clear that we need to converge on one common API > prior to converting old code (including drivers in staging) in order to > do it once only. While we are at it, could the person who'd come up with ui_lseek() be located and made to stand up and explain the rationale behind the SEEK_END semantics therein? To quote the manpage (and paraphrase just about any introductory textbook): SEEK_END The file offset is set to the size of the file plus offset bytes. I'm really curious - which part of "plus" might have lead to case SEEK_END: offset = ((dd->kregend - dd->kregbase) + DC8051_DATA_MEM_SIZE) - offset; and, if its author has decided that of course it _must_ have meant "minus", why had he or she failed to post a correction to the manpage? Or, on the off-chance that this "plus" might have something to do with reality, experimented with some file, for that matter. Folks, this is a well-earned "F". And not just for Unix Programming 101 - the same semantics applies to fseek(3), which is a part of C standard. Incidentally, lseek(fd, 0, SEEK_END) is "seek to end", not "fail with EINVAL". As for the use of ioctl... Frankly, considering the above, it does sound like "that'll make them STFU about the weirdness - ioctl *is* weird, so there!" Single-consumer APIs stink, film at 11...