Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbcCKSZd (ORCPT ); Fri, 11 Mar 2016 13:25:33 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:36294 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbcCKSZb (ORCPT ); Fri, 11 Mar 2016 13:25:31 -0500 MIME-Version: 1.0 In-Reply-To: References: <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> <20160303180924.GA4116@infradead.org> <20160303223952.GE24012@thunk.org> <20160303231050.GU29057@dastard> <20160309230819.GB3949@thunk.org> <56E18B9B.5070503@gmail.com> <56E24CA5.3030702@redhat.com> <20160311135952.57a44931@lxorguk.ukuu.org.uk> Date: Fri, 11 Mar 2016 10:25:30 -0800 X-Google-Sender-Auth: TixbzhcIlV4rc5XawsxWR4FPws4 Message-ID: Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks From: Linus Torvalds To: Andy Lutomirski Cc: One Thousand Gnomes , Ric Wheeler , "Theodore Ts'o" , Gregory Farnum , Dave Chinner , "Martin K. Petersen" , Christoph Hellwig , "Darrick J. Wong" , Jens Axboe , Andrew Morton , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton , Eric Sandeen 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: 730 Lines: 17 On Fri, Mar 11, 2016 at 9:30 AM, Andy Lutomirski wrote: > > What if we had an ioctl to do these data-leaking operations that took, > as an extra parameter, an fd to the block device node. They allow > access if the fd points to the right inode and has FMODE_READ (and LSM > checks say it's okay). Sure, it's awkward, but it's much safer. That sounds absolutely horrible. I'd *much* prefer the suggestion from Alan to simply have a mount-time option to enable it. That way, you will never get any surprises, and no "subtle new behavior for somebody who set their system up in a way that doesn't allow for this". So you'd have to explicitly say "my setup is ok with hole punching". Linus