Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757569AbcCCSWF (ORCPT ); Thu, 3 Mar 2016 13:22:05 -0500 Received: from imap.thunk.org ([74.207.234.97]:56740 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753757AbcCCSWC (ORCPT ); Thu, 3 Mar 2016 13:22:02 -0500 Date: Thu, 3 Mar 2016 13:21:46 -0500 From: "Theodore Ts'o" To: Linus Torvalds Cc: "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , "Martin K. Petersen" , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks Message-ID: <20160303182146.GG9772@thunk.org> Mail-Followup-To: Theodore Ts'o , Linus Torvalds , "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , "Martin K. Petersen" , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton References: <20160302040932.16685.62789.stgit@birch.djwong.org> <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> <20160303170205.GD24012@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1261 Lines: 25 On Thu, Mar 03, 2016 at 09:55:38AM -0800, Linus Torvalds wrote: > But that essentially says that we shouldn't expose this interface at > all (unless we trust our white-lists - I'm sure they are getting > better, but if nobody has ever really _relied_ on the zeroing behavior > of trim, then I guess there could be tons of bugs lurking). We don't, so this interface won't be useful for SATA disks, where we'll need to write zeros until the SATA folks get off their duffs and fix it with a new, reliable trim command. But it will be useful for other storage systems, such as eMMC devices, which *do* have a reliable trim command. So it may be that the first place we'll see widepspread usage of this will be in the low-end and high-end systems (where we can rely on eMMC's reliable trim and SCSI's WRITE SAME command). But that's why we want to have a new interface which is distinct from BLKDISCARD. We want one interface for an advisory hint (we don't care about the contents, so if it's convenient, feel free to forget about the contents and replace it by zeros), and something where it truly is a zeroout command. The intention is that BLKZEROOUT will be the reliable zeroout command, while BLKDISCARD will be the unreliable advisory hint. - Ted